Tutorials › Graph Theory (Undergraduate) › A Proof of Ore’s Theorem

Hamiltonian Cycles and Sufficient Conditions · Tutorial 502 of 799

A Proof of Ore's Theorem

Follow the longest-path argument that turns Ore’s degree-sum condition into a Hamiltonian cycle.

Intermediate 10 min read

What You'll Learn

  • State Ore’s theorem with its order and nonadjacent-pair hypotheses
  • Prove that the degree-sum condition forces a graph to be connected
  • Analyze the endpoints of a longest path and count their neighbors
  • Use an intersecting pair of index sets to construct a cycle
  • Explain why that cycle must contain every vertex
  • Identify why the condition cannot be applied to adjacent vertex pairs

The Strategy: From a Longest Path to a Cycle

Ore’s theorem gives a sufficient condition for a graph to have a Hamiltonian cycle: a cycle that visits every vertex exactly once before returning to its start. The proof does not try to build such a cycle directly. Instead, it begins with a longest path. Its endpoints cannot have neighbors outside the path, so their degrees count positions along that path. The degree-sum hypothesis then forces two useful edges in complementary positions, which can be joined with the path edges to make a cycle.

All graphs in this tutorial are finite and simple. A path is a sequence of distinct vertices in which consecutive vertices are adjacent; its length is its number of edges. A longest path is a path of maximum length in the graph. A Hamiltonian cycle is a cycle containing every vertex of the graph. The degree \(\deg(v)\) of a vertex \(v\) is the number of its neighbors.

Theorem (Ore): Let \(G\) be a simple graph of order \(n\ge 3\). If every pair of nonadjacent vertices \(u,v\) satisfies \(\deg(u)+\deg(v)\ge n\), then \(G\) has a Hamiltonian cycle.

The condition concerns only nonadjacent pairs. There is no requirement on the degree sum of a pair that already forms an edge. We prove the theorem by first establishing that the condition makes \(G\) connected, then using a longest path in \(G\).

The Degree-Sum Condition Forces Connectedness

Lemma: If \(G\) has order \(n\ge3\) and every nonadjacent pair \(u,v\) satisfies \(\deg(u)+\deg(v)\ge n\), then \(G\) is connected.

Proof. Suppose instead that \(G\) is disconnected. Choose vertices \(u\) and \(v\) from two different connected components, and let those components have vertex sets \(C_u\) and \(C_v\). There is no edge between \(u\) and \(v\), so the hypothesis applies. Every neighbor of \(u\) lies in \(C_u\), and every neighbor of \(v\) lies in \(C_v\). Therefore \(\deg(u)\le |C_u|-1\) and \(\deg(v)\le |C_v|-1\). The components are disjoint and contain at most all \(n\) vertices, so \[ \deg(u)+\deg(v)\le |C_u|+|C_v|-2\le n-2<n. \] This contradicts the required degree sum. Hence \(G\) is connected. \(\square\)

Connectedness will be used at the end of the proof. If a cycle contains all the vertices of a longest path but misses other vertices of the graph, connectedness supplies an edge from the cycle to the outside. That edge would let us make a longer path.

Proof of Ore’s Theorem

Proof. Let \(G\) satisfy the hypotheses. By the lemma, \(G\) is connected. Choose a longest path and write it in order as \[ P=v_1v_2\cdots v_k. \] Since \(G\) is connected and \(n\ge3\), it has a path with at least three vertices: otherwise every path would have at most two vertices, which is impossible in a connected graph with at least three vertices. Thus \(k\ge3\).

Neither endpoint of \(P\) can have a neighbor outside \(P\), because such a neighbor could be added at that endpoint to produce a longer path. We consider whether the endpoints \(v_1\) and \(v_k\) are adjacent.

If \(v_1v_k\in E(G)\), then \(v_1v_2\cdots v_kv_1\) is a cycle containing the \(k\) vertices of \(P\). If \(k<n\), this cycle does not contain every vertex of \(G\). Since \(G\) is connected, there must be an edge \(xw\) with \(x\) outside the cycle and \(w\) on it; otherwise no vertex outside the cycle could be connected to a vertex on it. Starting at \(x\), moving to \(w\), and then following the cycle from \(w\) through its other \(k-1\) vertices gives a path with \(k+1\) distinct vertices. This contradicts the choice of \(P\) as a longest path. Hence in this case \(k=n\), and the cycle is Hamiltonian.

It remains to consider the case \(v_1v_k\notin E(G)\). Every neighbor of \(v_1\) lies among \(v_2,\ldots,v_{k-1}\); it cannot be \(v_k\), by the case assumption, or outside \(P\), by maximality of the path. Similarly, every neighbor of \(v_k\) lies among \(v_2,\ldots,v_{k-1}\). Define index sets \[ A=\{i\in\{1,\ldots,k-1\}:v_1v_{i+1}\in E(G)\},\qquad B=\{i\in\{1,\ldots,k-1\}:v_iv_k\in E(G)\}. \] The index \(k-1\) cannot belong to \(A\), because that would mean \(v_1v_k\in E(G)\). The index \(1\) cannot belong to \(B\), for the same reason. The remaining indices in \(A\) correspond one-to-one with the neighbors of \(v_1\), and the indices in \(B\) correspond one-to-one with the neighbors of \(v_k\). Thus \(|A|=\deg(v_1)\) and \(|B|=\deg(v_k)\).

The endpoints are nonadjacent, so Ore’s condition gives \(|A|+|B|=\deg(v_1)+\deg(v_k)\ge n\). Also \(k\le n\), so \(|A|+|B|\ge k\). Both sets lie in a universe of \(k-1\) indices. If they were disjoint, their total size would be at most \(k-1\), a contradiction. Choose \(j\in A\cap B\). Since \(1\notin B\) and \(k-1\notin A\), we have \(2\le j\le k-2\). By the definitions of \(A\) and \(B\), both \(v_1v_{j+1}\) and \(v_jv_k\) are edges.

Now use the path edges from \(v_1\) to \(v_j\), the edge \(v_jv_k\), the path edges backwards from \(v_k\) to \(v_{j+1}\), and finally the edge \(v_{j+1}v_1\). They form the cycle \[ v_1,v_2,\ldots,v_j,v_k,v_{k-1},\ldots,v_{j+1},v_1. \] Every vertex \(v_1,\ldots,v_k\) occurs exactly once before the return to \(v_1\). This is a cycle containing all vertices of \(P\). If \(k<n\), connectedness again gives an edge from a vertex outside this cycle to a vertex on it. Starting with the outside vertex and then following the cycle through all \(k\) vertices gives a path with \(k+1\) distinct vertices, contradicting that \(P\) was longest. Therefore \(k=n\), and the cycle is Hamiltonian. This proves Ore’s theorem. \(\square\)

Worked Examples: Tracing the Index-Set Argument

Worked Example: A Hamiltonian Cycle in \(K_5\) Minus Two Edges

Let \(G\) have vertex set \(V=\{1,2,3,4,5\}\) and edge set consisting of all pairs of distinct vertices except \(12\) and \(34\). Verify Ore’s condition, then trace the key step of the proof.

Vertices \(1,2,3,4\) each have degree \(3\), since each is missing exactly one of its four possible incident edges. Vertex \(5\) has degree \(4\). The only nonadjacent pairs are \(1,2\) and \(3,4\). Their degree sums are \(3+3=6\) and \(3+3=6\), respectively, and both are at least \(n=5\). Thus the hypotheses hold.

Consider the path \(P=1,3,5,4,2\). Its edges \(13,35,54,42\) are all present, and its endpoints \(1,2\) are nonadjacent. With the path notation \(v_1=1,v_2=3,v_3=5,v_4=4,v_5=2\), the neighbors of \(v_1\) on the path are \(v_2,v_3,v_4\), so \(A=\{1,2,3\}\). The neighbors of \(v_5\) on the path are \(v_2,v_3,v_4\), so \(B=\{2,3,4\}\). Their intersection is \(\{2,3\}\). Taking \(j=2\) gives the cycle \(1,3,2,4,5,1\).

Check: its edges are \(13,32,24,45,51\), all present by the definition of \(E\). The sequence contains \(1,2,3,4,5\) exactly once before returning to \(1\), so it is Hamiltonian.

Worked Example: Applying the Hypothesis in \(K_{3,3}\)

Let \(G=K_{3,3}\) have vertex set \(V=\{a_1,a_2,a_3,b_1,b_2,b_3\}\), with an edge \(a_ib_j\) for every \(i,j\in\{1,2,3\}\), and no other edges. Each vertex has degree \(3\). The nonadjacent pairs are precisely the pairs within the \(a\)-part or within the \(b\)-part. For every such pair, the degree sum is \(3+3=6=n\), so Ore’s condition holds.

The sequence \(a_1,b_1,a_2,b_2,a_3,b_3\) is a path: each consecutive pair has one \(a\)-vertex and one \(b\)-vertex, so it is an edge. Its endpoints \(a_1,b_3\) are adjacent, so closing the path gives the cycle \(a_1,b_1,a_2,b_2,a_3,b_3,a_1\).

Check: the closing edge \(b_3a_1\) is among the defined edges. All six vertices appear once before the return to \(a_1\), so this is a Hamiltonian cycle. Also, the graph has \(3\cdot3=9\) edges by choosing one endpoint from each part; the displayed cycle uses six distinct edges, as expected for a cycle through six vertices.

Worked Example: A Four-Cycle

Let \(G\) have vertex set \(V=\{1,2,3,4\}\) and edge set \(E=\{12,23,34,41\}\). Each vertex has degree \(2\). The only nonadjacent pairs are \(1,3\) and \(2,4\); for each pair the degree sum is \(2+2=4=n\). Thus Ore’s condition holds.

Take the longest path \(1,2,3,4\). Its endpoints \(1\) and \(4\) are adjacent, so adding the edge \(41\) closes the path into the cycle \(1,2,3,4,1\).

Check: the four edges used are \(12,23,34,41\), exactly the edges in \(E\). Each of the four vertices appears once before returning to \(1\), confirming that the cycle is Hamiltonian.

Common Pitfall: Testing Adjacent Pairs

A tempting but incorrect check is to test the degree sum of every pair, including adjacent pairs. For example, in the four-cycle above, vertices \(1\) and \(2\) are adjacent and have degree sum \(2+2=4\). That happens to meet the threshold, but this calculation is not part of the hypothesis. In other graphs an adjacent pair may have a smaller degree sum without affecting Ore’s condition. The correct test is to identify the nonadjacent pairs and check only those.

There is a second important distinction: the conclusion is sufficient, not a claim that every Hamiltonian graph must satisfy the degree-sum condition. If the condition fails, this proof gives no conclusion. For instance, let \(G\) be the star with vertex set \(\{c,1,2,3\}\) and edge set \(\{c1,c2,c3\}\). Its leaves have degree \(1\), so a nonadjacent pair of leaves has degree sum \(1+1=2<4\). This graph has no Hamiltonian cycle: each leaf has only one incident edge, whereas a cycle through that leaf would require two distinct incident edges. The failed condition explains why Ore’s theorem cannot be applied; it is not an exception to the theorem.

Check Your Understanding

Use the longest-path proof to justify your answers, and distinguish carefully between adjacent and nonadjacent pairs.

  1. Why can neither endpoint of a longest path have a neighbor outside the path?
  2. In the nonadjacent-endpoint case, why do the sets \(A\) and \(B\) have sizes \(\deg(v_1)\) and \(\deg(v_k)\)?
  3. Explain why \(|A|+|B|\ge k\) forces \(A\cap B\ne\varnothing\) when both sets lie in \(\{1,\ldots,k-1\}\).
  4. Why does connectedness rule out a cycle containing all vertices of a longest path when that path has fewer than \(n\) vertices?
  5. For the graph with \(V=\{1,2,3,4,5\}\) and \(E=\{12,23,34,45,51\}\), check whether Ore’s condition holds and state whether the graph has a Hamiltonian cycle.