gives a list of n Hamiltonian cycles.
gives a list of one Hamiltonian cycle.
- HamiltonianCycles functionality is now available in the built-in Wolfram Language function FindHamiltonianCycle.
- To use HamiltonianCycles, you first need to load the Graph Utilities Package using Needs["GraphUtilities`"].
- HamiltonianCycles[g,n] returns an empty list if no Hamiltonian cycle exists.
- HamiltonianCycles considers the input graph as undirected.
- The complexity of the algorithm is such that finding all Hamiltonian cycles for a large graph can take an exponential amount of time.
Examplesopen allclose all
Basic Examples (2)
HamiltonianCycles has been superseded by FindHamiltonianCycle:
Wolfram Research (2007), HamiltonianCycles, Wolfram Language function, https://reference.wolfram.com/language/GraphUtilities/ref/HamiltonianCycles.html.
Wolfram Language. 2007. "HamiltonianCycles." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphUtilities/ref/HamiltonianCycles.html.
Wolfram Language. (2007). HamiltonianCycles. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphUtilities/ref/HamiltonianCycles.html