Find isomorphic pairs in list of graphs networkx

354 Views Asked by At

I have a list of edge lists of some graphs. For example, let's consider the following list

G_list = [[(0,1), (0,2)], [(0,3), (1,3)], [(0,3), (1,3)], [(0,3), (1,3), (2,3)]]

The graphs generated from the above list, G0, G1, G2 and G3 are shown below:

enter image description here

We can see (and check) that G0 is isomorphic to G3. Also, note that G0 is isomorphic to G1, but G0 and G1 are automorphic to each other.

Now I want to find the fastest way to find all pairs of isomorphic graphs in such a list and output them as a list of tuples. It would be even better if we can reject automorphisms from this list.

Here the ideal output from the list should be G_iso = [(G0, G3)]. However note that there can be more than one isomorphic pairs of graphs in the list.

Thanks a ton in advance! Sorry if this is an extremely noob question.

0

There are 0 best solutions below