I found the second definition of the function FindGraphIsomorphism
not working.
Here's the definition Mathematica 8 gives:
FindGraphIsomorphism[g1,g2]
finds an isomorphism that maps the graphg1
tog2
by renaming vertices.FindGraphIsomorphism[g1,g2,n]
finds at most n isomorphisms.
I tried the following two tests. Define a simple graph by
graph = AdjacencyGraph[{{1,0},{0,1}}];
Then running FindGraphIsomorphism[graph,graph]
yields {1->1, 2->2}
, this is good.
but running
FindGraphIsomorphism[graph,graph,2]
makes the Mathematica kernel dead. So I tried another graph,
graph = AdjacencyGraph[{{1,1},{1,1}}];
Running FindGraphIsomorphism[graph,graph,2]
yielded error message:
FindGraphIsomorphism::nonopt: Options expected (instead of 2) beyond position 2 in FindGraphIsomorphism[graph,graph,2]. An option must be a rule or a list of rules.
My conclusion is that FindGraphIsomorphism[g1,g2,n]
is a bug. Or am I wrong somewhere? What should I do to obtain a result like:
Input: FindGraphIsomorphism[graph,graph,2]
Output: {{1->1,2->2}, {1->2,2->1}}
Update:
It seems that the latest version of Mathematica does not support the third argument n in FindGraphIsomorphism. The form FindGraphIsomorphism[g1,g2,n] is no longer in the online documentation center. However, it exists in my older version 8.0.0, but fails to work.
I still want to know if there is any way to make it work: FindGraphIsomorphism[g1,g2] gives one isomorphism, but how to get the list of more than one, or, all isomorphisms?
FindGraphIsomorphism
takes a third argument. What version are you running? $\endgroup$