yields True if the graph g is Hamiltonian, and False otherwise.
Examplesopen allclose all
HamiltonianGraphQ works with undirected graphs:
HamiltonianGraphQ gives False for expressions that are not graphs:
HamiltonianGraphQ works with large graphs:
Test whether the Icosian game [MathWorld] has a solution:
Test whether there is a sequence of moves by a knight chess piece that visits each square of an chessboard exactly once:
Properties & Relations (4)
A Hamiltonian cycle can be found using FindHamiltonianCycle:
Skeleton graphs of platonic solids are Hamiltonian:
The line graph of a Hamiltonian graph is Hamiltonian:
An Eulerian graph is not always Hamiltonian:
Wolfram Research (2010), HamiltonianGraphQ, Wolfram Language function, https://reference.wolfram.com/language/ref/HamiltonianGraphQ.html.
Wolfram Language. 2010. "HamiltonianGraphQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HamiltonianGraphQ.html.
Wolfram Language. (2010). HamiltonianGraphQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HamiltonianGraphQ.html