On this page
Picture a map of towns joined by roads. A Hamiltonian cycle is a round trip that passes through every town exactly once and comes home. It is named after William Rowan Hamilton, whose icosian game asked for such a round trip on a dodecahedron (Hamiltonian path, Wikipedia).
What is a Hamiltonian cycle?
A graph is a set of dots (vertices) joined by lines (edges). A Hamiltonian cycle is a cycle that visits each vertex exactly once and returns to where it started (Hamiltonian path). A Hamiltonian path does the same without having to return. A graph that has a Hamiltonian cycle is called Hamiltonian.
The diagram at the top shows one on the dodecahedron graph: 20 vertices and 30 edges (Regular dodecahedron, Wikipedia), with three edges at every vertex. The gold loop uses 20 of the edges and never needs the other 10.
How is a Hamiltonian cycle different from an Euler circuit?
The two sound alike but are nothing alike in difficulty. An Euler circuit uses every edge exactly once and may pass through a vertex many times (Eulerian path, Wikipedia). Euler first discussed it in 1736 with the Seven Bridges of Königsberg, and it has a clean answer: a connected graph has an Euler circuit if and only if every vertex has even degree. Hierholzer's algorithm builds such a circuit in linear time (same source).
No such rule exists for vertices. Two small graphs show the ideas are independent:
The bowtie (two triangles sharing one vertex) has degrees 2, 2, 4, 2, 2, all even, so it has an Euler circuit. It has no Hamiltonian cycle, because any round trip has to pass through the shared vertex twice.
The complete graph on 4 vertices has degree 3 at every vertex, which is odd, so it has no Euler circuit. But 1-2-3-4-1 is a Hamiltonian cycle.
What does Dirac's theorem say?
In 1952 G. A. Dirac published "Some Theorems on Abstract Graphs" in the Proceedings of the London Mathematical Society. Dirac's theorem says that a simple graph with n ≥ 3 vertices is Hamiltonian if every vertex has degree at least n/2 (Dirac's theorem, Wikipedia).
The condition is sufficient, not necessary. If a graph passes, a cycle is guaranteed. If it fails, the test tells you nothing either way.
How do you check a graph for a Hamiltonian cycle?
Count the vertices, n, and write down each vertex's degree.
Is any vertex of degree 1? Then there is no Hamiltonian cycle, because a cycle needs two edges at every vertex.
Is there a cut vertex, one whose removal splits the graph in two? Then there is no Hamiltonian cycle. The bowtie fails here.
Is every degree at least n/2? Then Dirac guarantees a cycle. If not, search by hand or look for a parity or colouring argument.
Try it on the dodecahedron. There n = 20 and every degree is 3, far below 10, so Dirac says nothing. Yet the diagram shows a cycle.
Does every chessboard have a closed knight's tour?
A knight's tour is a Hamiltonian path on the graph whose vertices are squares and whose edges are knight moves. The tour is closed if the last square is one knight's move from the first (Knight's tour, Wikipedia).
In 1991 Schwenk settled closed tours on rectangular boards. On an m × n board with m ≤ n, a closed tour exists unless m and n are both odd, or m is 1, 2 or 4, or m = 3 and n is 4, 6 or 8 (Schwenk's theorem). The standard 8 × 8 board has 26,534,728,821,064 directed closed tours (same source).
You can prove the odd-by-odd case yourself. A knight always lands on a square of the opposite colour, so a closed tour alternates colours and must have an even number of squares. An odd-by-odd board has an odd number of squares, so no closed tour fits. The same trick drives parity arguments for olympiad impossibility proofs.
Why is there no simple test for a Hamiltonian cycle?
Deciding whether a graph has a Hamiltonian cycle is NP-complete (Hamiltonian path). In 1972 Richard Karp included both the directed and the undirected Hamilton circuit problems in "Reducibility among Combinatorial Problems" (Complexity of Computer Computations; Karp's 21 problems).
A proposed cycle is quick to check, but no known method quickly finds one, or rules one out, for every large graph. A polynomial-time method for every graph would settle the P versus NP question. The Clay Mathematics Institute lists that problem as unsolved and uses the Hamiltonian path problem as its example.
So exam questions hide structure for you to use: high degrees, a degree-1 vertex, a cut vertex or a colouring. For more, try a 4-week plan to start olympiad combinatorics or S. S. Shrikhande's graph and Latin squares.
If a graph question stalls, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For the words underneath, such as degree, cycle and cut vertex, the Fermi Concept Library covers mathematics and computing concepts, each with its own lesson.



