This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

FindHamiltonianCycle

FindHamiltonianCycle[g]
finds a Hamiltonian cycle in the graph g if one exists.
  • A Hamiltonian cycle visits each vertex exactly once.
Find a Hamiltonian cycle:
Turn the result into a cycle graph and highlight it:
Find a Hamiltonian cycle:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Turn the result into a cycle graph and highlight it:
In[3]:=
Click for copyable input
Out[3]=
Solve the Icosian game, that is, find a Hamiltonian cycle along the edges of the dodecahedron:
New in 8