Dirac’s Theorem at a Dinner Party
Gabriel Dirac (the famous graph theorist) was the stepson of Paul Dirac (the even more famous physicist). Paul Dirac spent the last years of his career at Florida State University, and my father took his course in General Relativity in the 1970s.
Gabriel formulated an important theorem about Hamiltonian cycles. In this post I want to give a refresher on Hamiltonian cycles, and go over a fun proof of his theorem that involves a hypothetical dinner party.
Over the course of several decades, Dirac’s theorem was improved when mathematicians formulated similar theorems that work with a broader range of graphs. In the following figure, each theorem is more general than the one to its left. Each graph meets its own theorem’s condition, but none of the ones to its left, and its Hamiltonian cycle is blue.
Why am I writing about Dirac’s Theorem? Well, I wanted to write about a simple proof relating to Hamiltonian cycles as prep for my next post, which will be about Barnette’s Conjecture, one of my favorite graph theory conjectures. It got promoted to a theorem in the 6-Oct-2026 Mathocalypse. In my next post I’ll talk more about that.
A Hamiltonian cycle is a walk along the edges of a graph that visits every vertex exactly once and ends up back where it started. A graph that has one is Hamiltonian.
Hamiltonian cycles are related to the Traveling Salesman Problem (e.g. designing delivery routes for Amazon packages). But my personal favorite application is an old-school computer graphics problem: given a triangle mesh, can you render it using a single triangle strip?
Intuitively, it should be easier to find a Hamiltonian cycle in a graph that has lots of edges relative to its vertex count. In a way, that intuition is what Dirac formalized:
If a simple graph has
The following figure shows a random graph with 10 vertices, where every vertex has exactly 5 neighbors, so the theorem guarantees a Hamiltonian cycle. On the right, the same graph has been rearranged so that its Hamiltonian cycle runs around the outside…like a circular dinner table.
1. Dinner party
To see why the theorem is true, first imagine a party where each guest is a vertex and each friendship is an edge. Friendship goes both ways, and nobody is their own friend, which is what simple means in graph theory. A Hamiltonian cycle is a way to seat everyone at a round table so that each guest sits between two friends:
If a party has
Here’s the plan. Seat everyone in random order. Two guests who sit side by side are seatmates, and they might be friends, or strangers. Seatmates who are friends get a blue edge, and other friends get a gray edge. Seatmates who are strangers make a gap, which gets a dotted orange line. Here’s the graph from before as a party, seated in random order, with four gaps:
So, if we can find a way that always gets rid of all the gaps, then we will have shown that the theorem is true. We’ll do it with a sequence of moves somewhat akin to playing musical chairs.
2. Musical chairs
Say that strangers
Here’s the move: everyone from
In the following figure, the stretch that flips is shaded blue. Drag the slider under it to watch it flip.
A flip closes the gap between
Why is Lemma 1 true? Inside the stretch that flips, each guest has the same two seatmates as before, just on opposite sides. So the only seatmates who change are at the two endpoints. Before the flip, those were
The friendship of
The following interactive figure runs the algorithm on the party from before, starting with the seating arrangement that happens to have four gaps, and flips until there are none.
Here’s the algorithm:
seat everyone in any order
while some strangers u and v sit side by side, with v just clockwise of u:
find a friend x of u who sits just counterclockwise of a friend y of v
reverse the order of everyone from v around to x
So the whole proof comes down to one question. Do gaps always have corresponding crossings? In the next section we’ll answer that question.
3. Pass the potatoes
Recall that
Say strangers
One way to see how this is true is the following thought experiment. Give a red potato to each friend of
After that, note that
Let’s use
Back to Dirac’s theorem. If every guest has at least
4. References
Edgar Palmer discovered this proof in the work of Øystein Ore and wrote about it in The hidden algorithm of Ore’s theorem on Hamiltonian cycles (though he did not use dinner tables and potatoes).
Dirac’s theorem first appeared in his paper Some theorems on abstract graphs, in the Proceedings of the London Mathematical Society in 1952.
Homo sapiens. What an inventive, invincible species.
— The Fourth Doctor, The Ark in Space (1975)