Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Hamiltonian Graphs
A Hamiltonian graph is a connected graph that contains a cycle which visits every vertex exactly once and returns to the starting vertex. This cycle is called a Hamiltonian cycle. A Hamiltonian path (or walk) passes through each vertex exactly once but does not need to return to the starting vertex.
Unlike Eulerian graphs (which require traversing every edge), Hamiltonian graphs focus on visiting every vertex.
Sufficient Conditions for Hamiltonian Graphs
There is no simple necessary and sufficient condition to determine if a graph is Hamiltonian. However, two important theorems provide sufficient conditions −
Dirac's Theorem
If G is a simple graph with n vertices (where n ≥ 3), and if −
deg(v) ≥ n/2 for each vertex v
then the graph G is Hamiltonian.
Ore's Theorem
If G is a simple graph with n vertices (where n ≥ 3), and if −
deg(x) + deg(y) ≥ n for each pair of non-adjacent vertices x and y
then the graph G is Hamiltonian.
Note − These are sufficient conditions, not necessary. A graph may still be Hamiltonian even if it does not satisfy these theorems.
Example: Hamiltonian Graph
In the above example, the graph has n = 5 vertices. The Hamiltonian cycle a → b → c → d → e → a visits every vertex exactly once and returns to the start. The sum of degrees of non-adjacent vertices a and c is 4 + 3 = 7, which is greater than 5. By Ore's theorem, this is a Hamiltonian graph.
n = 5 Hamiltonian cycle: a ? b ? c ? d ? e ? a Ore's theorem check (non-adjacent pairs): deg(a) + deg(c) = 4 + 3 = 7 ? 5 ? deg(b) + deg(d) = 2 + 3 = 5 ? 5 ? deg(b) + deg(e) = 2 + 2 = 4 < 5 ? Note: Ore's condition fails for (b,e), but the graph is still Hamiltonian ? the theorem is sufficient, not necessary.
Example: Non-Hamiltonian Graph
In the above example, the graph has n = 6 vertices. Vertices e and f each have degree 1 (they are pendant vertices), making it impossible for a Hamiltonian cycle to pass through them and continue. The sum of degrees of non-adjacent vertices a and f is only 3, which is less than 6.
n = 6 Ore's theorem check: deg(a) + deg(f) = 2 + 1 = 3 < 6 ? Vertices e and f have degree 1 (pendant vertices). A Hamiltonian cycle requires every vertex to have degree ? 2, so no Hamiltonian cycle can exist.
Note − Failing Ore's or Dirac's theorem does not automatically prove a graph is non-Hamiltonian. It only means the theorem cannot be used to confirm it. However, in this case, the pendant vertices (degree 1) independently prove no Hamiltonian cycle exists.
Conclusion
A Hamiltonian graph contains a cycle that visits every vertex exactly once. Dirac's and Ore's theorems provide sufficient conditions to identify Hamiltonian graphs based on vertex degrees, but no simple necessary and sufficient condition exists for all graphs.
