Euler is decided by the degrees
One pass over the vertices. Even degrees and connectivity are necessary and sufficient, which is unusually clean.
An Euler circuit uses every edge once and exists exactly when the graph is connected with all degrees even. A Hamilton circuit visits every vertex once and has no such criterion — deciding it is NP-complete.
Core ideas
Two similar-sounding questions with completely different answers, and the contrast is the point of the lesson.
One pass over the vertices. Even degrees and connectivity are necessary and sufficient, which is unusually clean.
Every visit to a vertex uses two edge-ends, one in and one out. So a circuit requires every degree even.
Only sufficient conditions (Dirac, Ore) and no characterisation. Deciding it is NP-complete, which Algorithms and Complexity defines.
The material
Both definitions, Euler's theorem with its proof, and the contrast.
An Euler path uses every edge of the graph exactly once. An Euler circuit is an Euler path that returns to its starting vertex.
A connected graph has an Euler circuit if and only if every vertex has even degree. It has an Euler path but no circuit if and only if exactly two vertices have odd degree, and any such path starts at one and ends at the other.
Necessity. Every time the circuit enters a vertex it leaves again, using two edges at that vertex; the start and end are the same vertex, so its first and last edges pair up too. Every edge is used exactly once, so every degree is even.
Sufficiency. Suppose the graph is connected with all degrees even. Start anywhere and walk, never repeating an edge. Even degrees mean that whenever you enter a vertex other than the start there is an unused edge to leave by, so the walk can only get stuck at the start — producing a circuit.
If that circuit misses some edges, connectivity gives a vertex v on it with unused edges. The unused edges still form a graph of even degrees, so the same argument gives a second circuit through v, which can be spliced into the first. Repeating exhausts the edges.
□
That is a complete criterion and an algorithm: check the degrees, and the splicing argument (Hierholzer's algorithm) constructs the circuit in linear time.
Four land masses joined by seven bridges. The question — can one walk crossing every bridge exactly once? — is whether an Euler path exists. The four vertices have degrees 5, 3, 3 and 3: four vertices of odd degree, and a path allows at most two. No such walk exists, and Euler proved it in 1736.
Notice how little the argument needs. The geometry, the distances and the layout were all discarded; only the degrees mattered. That abstraction is the founding move of graph theory.
A Hamilton path visits every vertex exactly once. A Hamilton circuit is a Hamilton path returning to its start.
There is no known criterion. Some sufficient conditions exist:
If n ≥ 3 and every vertex has degree at least n/2, the graph has a Hamilton circuit.
If n ≥ 3 and deg(u) + deg(v) ≥ n for every pair of non-adjacent u, v, the graph has a Hamilton circuit.
Both are sufficient and neither is necessary: Cₙ has a Hamilton circuit and every degree 2, far below n/2. There is no known condition that is both.
Deciding whether a graph has a Hamilton circuit is NP-complete. No polynomial-time algorithm is known, and one would imply P = NP.
This table is the lesson. Two questions that a reader would expect to be of similar difficulty are on opposite sides of the sharpest boundary in computer science, and nothing in the statements reveals which is which.
Interactive
Your graph, the course's algorithms
Method
Euler is a degree count. Hamilton is a search.
Zero odd degrees gives a circuit; exactly two give a path; anything else gives neither.
Walk until stuck, then find a vertex with unused edges and splice in a second circuit. That is Hierholzer's algorithm.
Dirac and Ore. If either holds, a circuit exists. If neither holds, nothing follows.
Backtracking over orderings. For n beyond about 20 this is impractical, and no better general method is known.
Four land masses A, B, C, D with seven bridges.
The bridges added were chosen to fix parity, and any bridge joining two odd-degree vertices would have done. That is the practical form of the theorem: the obstruction is parity, and parity is what you repair.
For a graph of your own, decide the Euler question by counting degrees, then attempt Hamilton by hand and notice what changes: one is a check, the other is a search.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.