Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

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 web forum at https://forum.skewed.de/c/graph-tool.


(If unsure, use the forum first.)


IMPORTANT: 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
  • #110
Closed
Open
Issue created Aug 06, 2014 by Tiago Peixoto@count0Owner

remove_edge become broken after graph save and load

Unfortunately, I can't make a reproducing code sample at the moment (may be I'll try later, i it'll be necessary). But the scenario is like this...

I have a big algorithm that makes a very long calculations on some graph and changes it during calculation somehow. Everything was OK, but I decided to save intermediate states of the graph to be able to stop and resume calculations later. After I added save/load code and debuged it a bit, I've into this:

  File "...", line ... in reverse_edge
    self.graph.remove_edge(edge)
  File "/usr/lib/python3/dist-packages/graph_tool/__init__.py", line 1216, in remove_edge
    return libcore.remove_edge(self.__graph, edge)
TypeError: No registered converter was able to extract a C++ reference to type graph_tool::PythonEdge<boost::adj_list<unsigned long> > from this Python object of type Edge

Seems very strange, it can't remove edge with type Edge. My code just gets an edge with .out_edges() function and later removes it with .remove_edge(). And doesn't change it in between.

        op_out_edge = next(op.out_edges())
        ...
        self.reverse_edge(op_out_edge)

    def reverse_edge(self, edge):
        s = edge.source()
        t = edge.target()
        self.graph.remove_edge(edge)
        return self.graph.add_edge(t, s)

When I comment out my save/load code (that just uses Graph.save and load_graph with adding/removing some vertex properties) everything goes OK. When I put code back, remove_edge() become broken after the first save/load.

Assignee
Assign to
Time tracking