Hi, you can query the list of edges, sort them (in case they are returned unsorted), and then just compare the sorted list.
Gabor On Sun, Dec 14, 2014 at 8:54 AM, Robin Müller-Bady <[email protected]> wrote: > Dear all, > > I'm currently looking for a method in the igraph Python implementation that > provides checking for graph equality of two graph, e.g. something like > >>>> g1 = Graph(3, directed=False) >>>> g1.add_edges([(0,1), (1,2)]) >>>> g2 = Graph(3, directed=False) >>>> g2.add_edges([(1,2), (0,1)]) >>>> g1.equals(g2) > True > > I know that there is a "g1.isomorphic(g2)" function, but isomorphism is not > necessarily equality, e.g.: >>>> g3 = Graph(3, directed=False) >>>> g3.add_edges([(0,1), (0,2)]) >>>> g3.equals(g2) > False >>>> g3.isomorphic(g2) > True > > Is there anything like that? > I'm (more or less) new to python, in case I was missing something I am very > sorry in advance. > > Best regards, > > Robin > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
