Eulerian and Hamiltonian Graphs
Eulerian graphs admit a closed walk traversing every edge exactly once; Hamiltonian graphs admit a cycle visiting every vertex exactly once. Euler's condition (connectedness + all-even degrees) is clean and efficiently checkable; Hamiltonicity has no such simple characterization and is NP-complete. Foundational results from Euler (1736) and Hamilton (1857), central to graph theory, combinatorial optimization, and routing.
Eulerian = local condition (degrees) ⟹ global structure. Whether you can trace every edge without lifting your pen depends only on counting edges at each vertex: every time a walk enters a vertex it must leave, pairing up edges, so all interior degrees must be even. This local-to-global bridge makes Euler problems tractable.
Hamiltonian = irreducibly global. Visiting each vertex once cannot be certified by any purely local count; degree conditions only give sufficient (never necessary) guarantees, and the property resists decomposition. This is the conceptual root of its computational hardness.
Formal Statement
Let be a graph.
- A walk is an alternating sequence of vertices and edges with .
- A trail is a walk with no repeated edge.
- A path is a walk with no repeated vertex.
- A circuit (closed trail) is a trail with .
- A cycle is a closed path (no repeated vertex except ), with in simple graphs.
An Eulerian circuit is a circuit containing every edge of ; an Eulerian trail is an (open) trail containing every edge. A Hamiltonian cycle is a cycle containing every vertex of ; a Hamiltonian path contains every vertex without necessarily closing.
The degree is the number of edge-ends incident to (loops count twice). The handshake lemma gives:
Derivation hint: each edge contributes exactly two endpoints to the total degree sum, so the sum is even and equals twice the edge count.
A connected graph (with at least one edge) has an Eulerian circuit if and only if every vertex has even degree. It has an Eulerian trail (open) if and only if exactly two vertices have odd degree; the trail begins at one and ends at the other.
Derivation hint: necessity from the entering/leaving pairing argument; sufficiency by the constructive Hierholzer cycle-splicing procedure.
A connected digraph has a directed Eulerian circuit iff it is balanced — for every vertex, in-degree equals out-degree:
Derivation hint: each pass through a vertex consumes one incoming and one outgoing arc, so they must match; connectivity ensures a single circuit covers all arcs.
If is a simple graph on vertices and every vertex satisfies , then is Hamiltonian.
Derivation hint: assume a longest path; high minimum degree forces its endpoints to have a common rotation creating a cycle through all path vertices, then connectivity forces the cycle to be spanning.
If is simple on vertices and for every pair of non-adjacent vertices ,
Derivation hint: same longest-path rotation argument as Dirac, but the degree budget is shared between the two path endpoints, generalizing .
The closure is obtained by repeatedly adding an edge between any non-adjacent pair with . Then is Hamiltonian iff is Hamiltonian; in particular if , is Hamiltonian.
Derivation hint: adding an edge whose endpoints satisfy the degree sum condition cannot change Hamiltonicity, by an exchange/rotation argument; iterate until stable.
Why It Holds / Derivation
Claim: If is Eulerian, every degree is even. 1. Let be an Eulerian circuit traversing all edges exactly once. 2. Fix a vertex . Each occurrence of as an interior vertex pairs the incoming edge with the outgoing edge — two distinct incident edges consumed together. 3. Because is closed, the start/end vertex is also balanced: the very first edge pairs with the very last edge . 4. Since every edge incident to appears exactly once in and they group into entering/leaving pairs, is even.
∎Claim: Connected + all-even-degree ⟹ Eulerian circuit, constructively. 1. Start at any vertex . Greedily walk along unused edges; because every degree is even, whenever you enter a vertex you can always leave (an odd number of used edges would be needed to get stuck). So the walk can only terminate by returning to , producing a closed circuit . 2. If uses all edges, done. 3. Otherwise, by connectivity some vertex on has unused incident edges. Restricting to unused edges, still has even degree, so repeat step 1 from to obtain another closed circuit . 4. Splice into at (traverse up to , detour around , continue ). The result is a longer closed circuit. 5. Iterate. Each splice adds edges; the edge set is finite, so eventually all edges are absorbed into a single Eulerian circuit. Runtime is .
∎1. Suppose, for contradiction, that satisfies the Ore condition for all non-adjacent but is not Hamiltonian. Add edges (keeping the condition true — adding edges only raises degrees) until is maximally non-Hamiltonian: one more edge creates a Hamiltonian cycle. 2. Then has a Hamiltonian path (adding the missing edge would complete a cycle, so the path spans all vertices). 3. Consider the index sets and , both subsets of . Then and . 4. Since are non-adjacent, , so . By pigeonhole, : there is an index with and . 5. This yields the cycle through all vertices — a Hamiltonian cycle. Contradiction.
∎The most prolific mathematician in history, Euler launched graph theory with his 1736 paper Solutio problematis ad geometriam situs pertinentis ("The solution of a problem relating to the geometry of position"). Asked whether one could cross all seven bridges of Königsberg exactly once and return, Euler abstracted the river-and-land map into what we now call a multigraph and proved it impossible by the parity-of-degrees argument. He thereby invented geometry of position (topology/combinatorics) — geometry where distances and angles are irrelevant and only connectivity matters. The very idea that a counting argument on incidences could settle a path-existence question is the seed of all modern graph theory.
Building Intuition
Think of an Eulerian circuit as a single closed loop of thread that covers every edge. At each vertex the thread passes through: in and out, in and out. If a vertex had an odd number of strands meeting it, the thread would have to start or stop there — impossible for a closed loop. So "all degrees even" is just "every vertex is a clean pass-through point." For the open trail version, exactly two vertices are allowed to be odd: those are precisely the loose ends of the thread — the start and the finish. Zero or two odd vertices: never an odd number, because [1] forces the count of odd-degree vertices to be even. Hamiltonicity feels deceptively similar but is fundamentally different: you are choosing a subset structure (one big cycle through points) where local pass-through logic gives no leverage — you cannot certify success by looking at any bounded neighborhood. This is why Euler hands you a yes/no answer in linear time while Hamilton hands you a needle in an exponential haystack.
Worked Examples
Given: Graph on vertices with edges (a 4-cycle) plus and .
Step 1 — Compute degrees:
Step 2 — Count odd-degree vertices: and are odd; exactly two. So no Eulerian circuit, but an Eulerian trail exists, starting at , ending at (or vice versa).
Step 3 — Construct the trail by Hierholzer/Fleury from :
Edges used in order: — all 7 edges, each once.
Given: Simple graph on vertices where every vertex has degree exactly .
Step 1 — Dirac test: Need . Here . ✓ Dirac satisfied ⟹ Hamiltonian. Concretely, the prism graph (two triangles and joined by edges ) is 3-regular on 6 vertices. A Hamiltonian cycle:
Step 2 — Contrast with Ore on a borderline graph: Take , two non-adjacent vertices with . Then , so Ore is not satisfied — the theorem gives no guarantee (the graph may or may not be Hamiltonian; the test is only sufficient).
Common Misconceptions
Dirac and Ore are SUFFICIENT, never NECESSARY. Failing the degree condition tells you nothing. The cycle (a simple -gon) is obviously Hamiltonian yet every vertex has degree only for large . Never conclude "not Hamiltonian" from a degree condition.
Eulerian ≠ Hamiltonian. They are independent properties. A graph can be Eulerian but not Hamiltonian, Hamiltonian but not Eulerian, both, or neither.
"Eulerian" sometimes means circuit, sometimes trail — authors differ. Many texts call a graph with an open Eulerian trail "semi-Eulerian." Always check the definition in use.
Connectivity is required. Even if all degrees are even, a disconnected graph (with edges in more than one component) has no Eulerian circuit. The criterion is "connected on its non-isolated vertices AND all even."
Eulerian but NOT Hamiltonian: Take two triangles sharing a single common vertex (a "bowtie"): vertices , edges . Every vertex has even degree (, others ), and it is connected, so it is Eulerian. But it has no Hamiltonian cycle: any cycle through all five vertices would have to pass through the cut-vertex twice (to enter and leave each triangle), which a cycle cannot do. Eulerian ✓, Hamiltonian ✗.
Hamiltonian but NOT Eulerian: The complete graph has a Hamiltonian cycle () but every vertex has degree (odd), so it has no Eulerian circuit. Hamiltonian ✓, Eulerian ✗.
Connections
Eulerian and Hamiltonian problems sit at a crossroads of several areas:
- <span class="wiki-link-missing">Königsberg Bridge Problem</span> — the historical and conceptual origin of the Eulerian criterion.
- <span class="wiki-link-missing">Graph Connectivity</span> — both notions presuppose connectivity; cut-vertices obstruct Hamiltonicity.
- <span class="wiki-link-missing">Traveling Salesman Problem</span> — the weighted optimization version of finding a Hamiltonian cycle of minimum total cost; Hamiltonicity is its feasibility core.
- <a class="wiki-link" href="/wiki/cs-theory-np-completeness">NP-Completeness</a> — HAMILTONIAN CYCLE is one of Karp's 21 NP-complete problems; Euler circuit is in P, dramatizing the P vs. NP boundary.
- <span class="wiki-link-missing">Chinese Postman Problem</span> — the optimization relative of Eulerian circuits: traverse every edge with least repetition, solved efficiently via Matching Theory.
- <span class="wiki-link-missing">Planar Graphs</span> — Tait's conjecture linked Hamiltonicity of cubic planar graphs to the Four Color Theorem (later disproved).
Real-World Applications
Historical Development
Subtleties & Limits
No good characterization of Hamiltonicity is known, and unless P = NP, none can be efficiently checkable. Major open and hard directions:
- Barnette's Conjecture (1969, open): Every 3-connected, cubic, bipartite, planar graph is Hamiltonian. Still unresolved.
- Lovász's path conjecture / vertex-transitive graphs: It is conjectured every connected vertex-transitive graph (with vertices) has a Hamiltonian path; verified in many cases but open in general. The five known exceptional non-Hamiltonian vertex-transitive graphs (e.g., the Petersen graph) all lack a Hamiltonian cycle but have a Hamiltonian path.
- Hamilton-connectedness and pancyclicity: Strengthenings (a Hamiltonian cycle of every length, or between every vertex pair) have their own delicate threshold conditions (Bondy's metaconjecture: nearly any condition forcing Hamiltonicity forces pancyclicity).
- Sharp thresholds in random graphs: In , Hamiltonicity appears abruptly precisely when the last vertex of degree disappears (Komlós–Szemerédi, Bollobás), a beautiful sharp-threshold phenomenon.
See Also
Königsberg Bridge Problem · Traveling Salesman Problem · Chinese Postman Problem · NP-Completeness · Petersen Graph · Four Color Theorem · de Bruijn Sequences · Graph Connectivity · Hierholzer's Algorithm