Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
graph-tool
graph-tool
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #653

Closed
Open
Opened Apr 24, 2020 by DarkaMaul@DarkaMaul

Graph Isomorphism with VertexPropertyMap of type long

Bug reports:

Informations

  • graph-tool version: 2.31 (commit 8561bac9, Fri Mar 27 23:59:57 2020 +0100)
  • System: Debian 10 / 5.4.0-0.bpo.4-amd64 / Python version 3.7.3

Bug description

I want to compute an isomorphism between two graph using an invariant. This does not work if the type of the VertexPropertyMap is long (while it works for int or bool).

Reproducible example (may not be minimal)

import graph_tool

# Create g
g: graph_tool.Graph = graph_tool.Graph()
g.add_vertex(3)
g.vp.prop_int = g.new_vertex_property('int')
g.vp.prop_long = g.new_vertex_property('long')

g.vp.prop_int.get_array()[:] = [3, 1, 2]
g.vp.prop_long.get_array()[:] = [2**32, 2**32-1, 2**32-5]

g.add_edge_list([(0, 1), (1, 2)])

# Create g2
g2: graph_tool.Graph = graph_tool.Graph()
g2.add_vertex(3)
g2.vp.prop_int = g2.new_vertex_property('int')
g2.vp.prop_long = g2.new_vertex_property('long')

g2.vp.prop_int.get_array()[:] = [3, 1, 2]
g2.vp.prop_long.get_array()[:] = [2**32, 2**32-1, 2**32-5]

g2.add_edge_list([(0, 1), (1, 2)])


# Works as expected
graph_tool.topology.isomorphism(g, g2, vertex_inv1=g.vp.prop_int, vertex_inv2=g2.vp.prop_int)

# This fails:
graph_tool.topology.isomorphism(g, g2, vertex_inv1=g.vp.prop_long, vertex_inv2=g2.vp.prop_long)

Python error

MemoryError                               Traceback (most recent call last)
<ipython-input-34-0535769d768c> in <module>
----> 1 graph_tool.topology.isomorphism(g1, g2, vertex_inv1=g1.vp.prop_long, vertex_inv2=g2.vp.prop_long)

/usr/lib/python3/dist-packages/graph_tool/topology/__init__.py in isomorphism(g1, g2, vertex_inv1, vertex_inv2, isomap)
    624                              _prop("v", g2, vertex_inv2),
    625                              inv_max,
--> 626                              _prop("v", g1, imap))
    627     if isomap:
    628         return iso, imap

MemoryError: 
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: count0/graph-tool#653