GraphIsomorphism: IndexError
Bug reports:
Please follow the general troubleshooting steps first:
-
Are you running the latest graph-tool
version? 2.31 (commit 8561bac9, Fri Mar 27 23:59:57 2020 +0100)
Bug description
Trying to perform an isomorphism between two graphs. The isomorphism fails when we use a vertex_property with "large" numbers.
Sample case
# The values must be large but the actual number does not matter much
values = [851733746, 1390959473, 0, 0]
edge_list = [[0, 1], [2, 1], [2, 3]]
g1 = graph_tool.Graph()
g1.add_edge_list(edge_list)
g1.vp.prop_int = g1.new_vertex_property('int')
g1.vp.prop_int.get_array()[:] = values
g2 = graph_tool.Graph()
g2.add_edge_list(edge_list)
g2.vp.prop_int = g2.new_vertex_property('int')
g2.vp.prop_int.get_array()[:] = values
# This fails:
graph_tool.topology.isomorphism(g1, g2, vertex_inv1=g1.vp.prop_int, vertex_inv2=g2.vp.prop_int)
General information
-
Your operating system : Debian 10 (buster) - Linux 5.4.0-0.bpo.4-amd64 Debian 5.4.19-1~bpo10+1 (2020-03-09) x86_64 GNU/Linux -
The Python version you are using: 3.7.3
Error report
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "bug.py", line 22, in main
return graph_tool.topology.isomorphism(g1, g2, vertex_inv1=g1.vp.prop_int, vertex_inv2=g2.vp.prop_int)
File "/usr/lib/python3/dist-packages/graph_tool/topology/__init__.py", line 626, in isomorphism
_prop("v", g1, imap))
IndexError: vector::_M_range_check: __n (which is 18446744073587462741) >= this->size() (which is 2242693221)