In graph theory, an isomorphism of graphs $G$ and $H$ is a bijection between the vertex sets of $G$ and $H$ ${\displaystyle f\colon V(G)\to V(H)}$ such that any two vertices $u$ and $v$ of $G$ are adjacent in $G$ if and only if ${\displaystyle f(u)}$ and ${\displaystyle f(v)}$ are adjacent in $H$. We know that IsomorphicGraphQ can return True if two graphs $G$ and $H$ are isomorphic, False otherwise. We can use FindGraphIsomorphism to find an isomorphic mapping of $G$ and $H$.
My problem is that if two graphs are not isomorphic, the IsomorphicGraphQ will only return False. Its correctness cannot be checked manually. I was wondering if IsomorphicGraphQ could give some additional information to help us understand why these two graphs are not isomorphic.
The following just a simple example. We can say that the first graph has a cycle and the second graph has no cycle, so the two graphs are not isomorphic.
g = CycleGraph[5];
h = PathGraph[Range[5]];
IsomorphicGraphQ[g, h]
I actually came across the next two planar graphs.
G1 = Graph[
ImportString["W{`I@CoC?o`_@_?o?K?@`?C??KG?K??EC?@_??EG??[???N",
"Graph6"], VertexLabels -> Automatic];
G2 = Graph[
ImportString["WspB@CoC?o`_@@@_?GGB??KC?O??WG?CK?B_??K???W_??N",
"Graph6"], VertexLabels -> Automatic];
IsomorphicGraphQ[G1, G2]
False
In general, I trust the results returned by IsomorphicGraphQ, but I wish it can provide more readable information.
GroupOrder@GraphAutomorphismGroup[g]
. With IGraph/M:IGBlissAutomorphismCount[g]
.GroupOrbits
also provides useful information: there are two orbits in G1, but only one in G2. $\endgroup$