2012-12-04 40 views

回答

2

您可以检索两个图之间的同构映射。会这样吗?见here

>>> from networkx.algorithms import isomorphism 
>>> G1 = nx.path_graph(4) 
>>> G2 = nx.path_graph(4) 
>>> GM = isomorphism.GraphMatcher(G1,G2) 
>>> GM.is_isomorphic() 
True 
>>> GM.mapping 
{0: 0, 1: 1, 2: 2, 3: 3}