ipycytoscape: Bug: Multiple edges between same nodes not shown

For a graph with edges A,B, weight=15 B,A, weight=10

Only the first edge object is retained in the add_edges(self, edges, directed=False) method, which is wrong behaviour.

This add_edges method is used in add_graph_from_networkx method, which leads to deletion of certain edges from networkx graph.

image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Initial work on support for multiple edges https://github.com/QuantStack/ipycytoscape/pull/146

IMO it should be 3, and that’s why I raised the idea of having a clear graph method whenever add_graph_from_networkx is called. This is an API design decision if add_graph_from_networkx is supposed to be used successively or not, I feel we should relegate the graph manipulation to functions like add_node, add_edge, we shouldn’t use add_graph_from_networkx to manipulate the graph object. But again this is just my opinion so ¯\(ツ)

Figure 1 becomes a MultiGraph it’s not a Graph anymore, Figure 2 is what is happening right now.

And currently the way code is structured, ipycytoscape doesn’t support MultiGraphs, only Graph and Directed Graphs, we should definitely add support for MultiGraphs too, and be more explicit about it.

NOTE: I use the terms MultiGraph and Graph the way NetworkX defines it.