Replies: 1 comment 2 replies
-
As you are using a MultiDiGraph, you should use You can see what the resulting edge match function actually is in ipython or jupyter using >>> nm = nx.isomorphism.categorical_node_match('name', None)
>>> em = nx.isomorphism.numerical_multiedge_match("weight", 0.5)
>>> nx.is_isomorphic(G1, G2)
True
>>> nx.is_isomorphic(G1, G2, node_match=nm)
True
>>> nx.is_isomorphic(G1, G2, node_match=nm, edge_match=em)
False |
Beta Was this translation helpful? Give feedback.
-
I am trying to get NetworkX to determine if two graphs are equivalent. Some things about the graphs:
The following is an example of two graphs I am comparing:
The is_isomorphic function returns True for this case. However, I thought the "weight" attribute would make the function return False because the edges with weights 1 and 2 go to different vertices.
Is this expected, and if so, does it make it such that these two graphs return False?
The graphs can be seen here:
https://stackoverflow.com/questions/78313307/isomorphism-with-multidigraph-and-weighted-edges
Beta Was this translation helpful? Give feedback.
All reactions