Hamiltonian Graph — Definition, Formula & Examples
A Hamiltonian graph is a graph that contains a Hamiltonian cycle — a closed path that visits every vertex exactly once before returning to the starting vertex.
A graph is Hamiltonian if there exists a cycle in that includes every vertex exactly once. Equivalently, contains a spanning cycle. A graph that contains a Hamiltonian path (visiting every vertex exactly once) but no Hamiltonian cycle is called traceable but not Hamiltonian.
How It Works
To determine whether a graph is Hamiltonian, you look for a cycle that passes through every vertex exactly once. There is no efficient general algorithm for this — the problem is NP-complete. However, sufficient conditions exist. Dirac's theorem states that if every vertex in a simple graph on vertices has degree at least , then the graph is Hamiltonian. Ore's theorem generalizes this: if for every pair of non-adjacent vertices and , , then the graph is Hamiltonian. These are sufficient but not necessary conditions, so a graph can be Hamiltonian without satisfying either theorem.
Worked Example
Problem: Determine whether the complete graph (5 vertices, every pair connected) is Hamiltonian.
Check vertex degrees: In , every vertex has degree 4. Since , we check Dirac's condition: each degree must be at least .
Apply Dirac's theorem: The condition is satisfied for all vertices, so Dirac's theorem guarantees a Hamiltonian cycle exists.
Exhibit a Hamiltonian cycle: Label the vertices . One Hamiltonian cycle is the sequence below, which visits every vertex exactly once and returns to the start.
Answer: is Hamiltonian. One Hamiltonian cycle is .
Why It Matters
The Hamiltonian cycle problem is the foundation of the famous Traveling Salesman Problem, which seeks the shortest Hamiltonian cycle in a weighted graph. It appears in logistics, circuit design, and genome sequencing. Understanding Hamiltonicity is essential in any discrete mathematics or algorithms course.
Common Mistakes
Mistake: Confusing Hamiltonian with Eulerian. Students often mix up visiting every vertex once (Hamiltonian) with traversing every edge once (Eulerian).
Correction: A Hamiltonian cycle covers all vertices; an Eulerian circuit covers all edges. A graph can be one, both, or neither.
