Dirac's theorem on Hamiltonian Graphs
Published on July 31, 2024Three different proofs of Dirac's theorem on Hamiltonian cycles in graphs with sufficient minimum degree.
Overview & Background
Continuing the theme of last post, we will look at a classic result in graph theory, namely Dirac’s theorem on Hamiltonian cycles. This result was first published by Gabriel A. Diracin 1952 [1], with later refinements by Ore, as well as Bondy and Chvátal. Three proofs of the theorem will be presented: the original proof from Dirac’s paper, an induction proof, and a short and direct proof. We will also consider the tightness of the bound as well as a generalization by Ore.
As a little historical sidenote before diving into the mathematics, Gabriel Dirac was the son of Margit Wigner, the sister of famous physicist Eugene Wigner. After a first marriage, from which Gabriel was born, Margit later remarried Eugene Wigner’s friend Paul Dirac, another equally famous physicist and one of the founders of Quantum Mechanics. Subsequently, Gabriel chose to take on the name Dirac. More interesting biographical details can be found in the essay about Paul Diracon MacTutor.
Table of contents
Dirac’s theorem
Although the following definitions are standard in graph theory, it is useful to specify them at the outset as these terms are often used rather loosely. A path is a sequence of non-repeating vertices and edges, where subsequent vertices are connected by an edge in the graph. Usually we distinguish between open and closed paths, where as the name implies, an open path just has different start and end vertices, while a closed path starts and ends with the same vertex. A closed path is also called a cycle. The length of a cycle is the number of distinct vertices on the cycle (the equal start- and end-vertex is not counted twice). As always, I will try to stick to common graph theoretical notation and conventions, but for the sake of both readability and completeness an overview of notation is given at the end of the post.
A Hamiltonian cycle is a cycle through a graph that visits every vertex exactly once. This concept might sound similar to Euler tours, that are historically at the origin of graph theory. An Euler tour is a cycle that visits every edge exactly once, while repeated vertices are allowed. However, in contrast to Euler tours which can be found in a graph in linear time , finding and even checking whether a graph contains a Hamiltonian cycle is in general -complete, i.e. no known polynomial time exists for this problem. Finding a Hamiltonian cycle and the related optimization problem of finding a lowest weight Hamiltonian cycle (known as the travelling salesperson problem) has many applications from computer graphics and circuit design to cargo routing and bioinformatics.
We will consider Dirac’s theorem, which is a sufficient condition for graphs to contain a Hamiltonian cycle:
Let be a graph with and minimum degree on every vertex. Then contains a Hamiltonian cycle.
Equivalently, every graph with minimum degree and at most vertices contains a Hamiltonian cycle.
Notice that the conditions of this theorem are not necessary for a Hamiltonian cycle, as for example a cycle graph on vertices violates the degree condition but clearly contains a Hamiltonian cycle.
Connectedness
As a warm-up we’ll start by showing that such a “Dirac-graph” is connected, ie. contains a path between any two vertices. In his original paper, Dirac writes in the theorem formulation that the graph must be connected, but as we will see now, this is not strictly necessary. Every graph that obeys the degree condition must also be connected.
In fact, we will see that any two vertices are connected by a path of length at most two, where the length of a path is defined as the number of edges along that path. Consider two arbitrary vertices . Without loss of generality we may assume that , as otherwise we would be done. We therefore know that the neighborhoods of and respectively do not contain the other vertex. But by the assumption on the minimum degree in we also know that as well as . We can now apply the pigeonhole principle to conclude that and must have a neighbor in common, and are therefore connected by a path of length : Both neighborhoods do not contain and by the previous observation, so we are trying to distribute two neighborhoods of size at least onto vertices. The two must necessarily intersect.
Alternatively, this same fact can be seen by applying the inclusion-exclusion principle:
We can already start seeing, why this theorem is tight. Relaxing the degree constraint on the vertices would for example allow a graph that is the disjoint union of two complete subgaphs on half of the vertices: for and (ignoring odd for simplicity here) we could construct with a minimum degree of for every vertex. This graph clearly does not contain a Hamiltionian cycle
In the following three proofs, we will always assume that is a graph as described in the theorem, i.e. with .
Original proof
Dirac’s original proof [1:1] is a little more convoluted, but we will consider it for completeness. It contains a few unnecessary convolutions, such as two nested proofs by contradiction, that hide the essence of the argument. Feel free to skip to the next section if you are not interested in the exact technical details of the original paper.
We will start by showing the following lemma:
Let be a graph as defined in Dirac’s theorem. Then contains a cycle of length at least .
A longest path in must contain at least vertices, because has at least neighbors. Otherwise would have a neighbor outside of that we could use to extend . Therefore, all neighbors of must lie on , which immediately yields a cycle of length at least : where is the highest index of neighbors of along .
Now assume for sake of contradiction that the theorem is false, i.e. there exists a graph satisfying and on every vertex that does not contain a Hamiltonian cycle. Let be the longest cycle in . By our assumption, has length at most . From the lemma it also follows that the cycle must have length at least .
As is connected, some node in , let’s assume without loss of generality that it is , must be connected to some node in . We will now consider the longest path that is entirely contained in except for . By the same observation as in the proof for the lemma, can only be connected to .
Under these assumptions made for sake of contradiction, the following lemma holds:
Under the assumption that Dirac’s theorem is false, it holds that .
We will show this lemma again by contradiction. If , then must be connected to at least vertices in , excluding vertices in . So must be connected to another vertex with . We can estable the following two inequalities on :
- : We can form a new cycle of length . Because is the longest cycle in , we obtain
- : We could also form a new cycle of length . Just as before we obtain .
By the two inequalities, we conclude that is connected to at least vertices in . Notice that there are such vertices.
However, it is also not possible that is joined to two neighboring vertices and in , as this would contradict the maximality of the original cycle . Otherwise could have been extended to of length . By this observation, there must therefore be at least such vertices in in order to intersperse every neighboring vertex of with a non-neighbor. Putting all these inequalities together, we finally obtain:
But this cannot be, as we assumed that is not a Hamiltonian cycle. This proves lemma 2.
Proving Dirac’s theorem is now fairly straightforward, by completing the outer proof by contradiction. As we have already observed previously, has length at least by lemma 1. Because is composed of at least and , both distinct from each other by construction, we can apply our bound on from lemma 2:
This contradiction concludes the proof.
Double induction
As a first proof of Dirac’s theorem, we will consider a proof by induction. This uses the so-called rotation-extension technique by Pósa[2]. Personally, I find this proof to be the most elegant of the three, especially because of the neat double induction that is used. The general structure of the proof consists of two parts:
- A -cycle implies the existence of a -path, as is connected
- A -path implies the existence of a -path or a cycle.
By induction thus has an -cycle, i.e. a Hamiltonian cycle.
Recall that we already saw previously, that G is connected. This fact will be needed in the induction proof.
Induction I
For , a -cycle implies the existence of a -path.
Let be such a cycle in . Because is connected, there exists an edge from to , where is a vertex outside of the cycle. Without loss of generality we may assume that . We have found a -path .
Induction II
A -path implies the existence of a -path or a -cycle.
Let be such a path in .
Case : can be extended to a -path , where is a neighbor of not in .
Case : same as above
Case and :
Let the extended neighborhood be the set of successors of neighbors on the path. Note that by assumption, all neighbors (and their successors) of lie on . By applying the inclusion-exclusion principle again we obtain:
This implies that there exists a in . We have found a -cycle
Conclusion
By combining both parts of the induction, we conclude that there must exist an -path, and by Induction II, an -cycle, i.e. a Hamiltonian cycle in , as cannot contain an path (paths have distinct vertices).
Direct proof
This is the shortest of the three proofs that will be presented, and is conceptually very similar to the induction proof. It can be found in standard textbooks on graph theory, such as the one by Diestel [3]. We will first inspect a longest path in and show that it can be extended to a cycle. We will then prove that this cycle must actually be a Hamiltonian cycle.
Consider a longest path in . All edges of and must end in , as otherwise we could extend , contradicting the fact that is a longest path. By the same argument as in case 3 of Induction II, we can find an edge in the path, where also both and . We can then turn into a cycle .
Finally, assume for sake of contradiction that is not a Hamiltonian cycle. Then there must exist at least one vertex in . However, as is connected, there must also exist an edge for and , where we can assume without loss of generality. This is a contradiction to our initial assumption that is a longest path in , as would form a longer path.
Tightness
We will use the second equivalent formulation of Dirac’s theorem, that bounds the number of vertices as a function of the minimum degree . This will make the tightness result simpler to formulate.
Let us first make a general observation about bipartite graphs that will come in handy in a moment. Recall that bipartite graphs are graphs that can be seperated into a disjoint union of two sets and with edges only between these two sets.
Bipartite graphs cannot contain cycles of odd length (where length refers to the number of edges along the path).
Equivalently, a cycle with odd cannot exist.
First, notice that any path in a bipartite graph consists of alternating vertices from both sets, because a vertex is only connected to vertices from the other set. Therefore any path of odd length must have start and end vertices in different sets, which cannot possibly form a cycle where start and end vertex are the same.
The construction exhibiting tightness is a simple bipartite construction. We will construct a graph with vertices and show that this graph does not contain a Hamiltonian cycle. Consider vertices and let “even” vertices be those with an even index while “odd” vertices refer to those with an odd index. We connect every even vertex only to all other odd vertices and vice-versa. This construction can also be compactly written as using standard graph theory notation.
There are odd vertices and even vertices, i.e. we are “barely” violating the degree conditions of the initial theorem. Even vertices have degree while odd vertices have degree .
Notice however, that this graph is clearly bipartite: Color say all even vertices red and all odd vertices blue, then by construction vertices of the same parity are not connected. But bipartite graphs cannot contain odd-length cycles as seen in the lemma above, which shows that this construction cannot contain a Hamiltonian cycle.
Ore’s theorem
Finally, let’s consider a generalization of Dirac’s theorem. The Norwegian mathematician Øystein Orepublished the following theorem in a one-page paper in 1960[4]:
Let be a graph with . If for every pair of non-adjacent vertices and with we have , then contains a Hamiltonian cycle.
This observation essentially follows from the proofs presented above. In the previous proofs, we repeatedly made use of the fact that two disconnected vertices can be connected through two adjacent neighbors. The condition that for two non-adjacent vertices ensures exactly this: The neighborhoods and must intersect.
We will prove this by contrapositive:
Assume for sake of contradiction that Ore’s theorem is false, i.e. there exists a graph with satisfying for that does not contain a Hamiltonian cycle. Let be the the one with a maximum number of edges among those. Notice that must contain a non-edge , as the complete graph clearly contains a Hamiltonian cycle. Therefore we know the statement does not just hold vacuously.
Now, adding to must necessarily close a Hamiltonian cycle by our choice of . Here we can however again apply case 3 of the induction proof (with the knowledge that ) to conclude that was not necessary to close the Hamiltonian cycle. There must be an edge in the path, where also both and . We obtain a cycle in , a contradiction.
Further reading
- Wikipedia: Hamiltonian Path
- Wikipedia: Ore’s theorem
- Dirac’s original paper: https://doi.org/10.1112/plms/s3-2.1.69
Overview of notation
- Complete graph on vertices
- Neighborhood : set of vertices adjacent to
- Extended neighborhood over an order of vertices: sucessors of neighbors of
- Minimum degree
References
Dirac, G.A. (1952), Some Theorems on Abstract Graphs. Proceedings of the London Mathematical Society, s3-2: 69-81. https://doi.org/10.1112/plms/s3-2.1.69↩︎ ↩︎
Pósa, L. (1976). Hamiltonian circuits in random graphs. Discrete Mathematics, 14, 359-364. https://doi.org/10.1016/0012-365X(76)90068-6↩︎
Diestel, R. (2017). Graph theory. Graduate texts in mathematics. https://doi.org/10.1007/978-3-662-53622-3↩︎
Ore, O. (1960). Note on Hamilton Circuits. The American Mathematical Monthly, 67(1), 55–55. https://doi.org/10.2307/2308928↩︎