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.

About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (8 by maintainers)
Commits related to this issue
- fixes #125, pass the status of direction while creating edges — committed to MridulS/ipycytoscape by MridulS 4 years ago
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_networkxis called. This is an API design decision ifadd_graph_from_networkxis supposed to be used successively or not, I feel we should relegate the graph manipulation to functions likeadd_node,add_edge, we shouldn’t useadd_graph_from_networkxto 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.