10.1 Eulerian vs Hamiltonian Graphs: Existence Theorems & Characterizations
💡 Core Intuition: The 3-Second Mental Model
🍳 The Everyday Analogy: The Seven Bridges of Königsberg vs The Traveling Salesperson
Think of navigating a city network:
- The Eulerian Challenge (Street Sweeper / Mail Carrier): You are driving a snowplow or postal van. You must drive down every single street (edge) in the city to clear the snow, without driving down any street twice. Can you start and return to the depot without repeating any street?
- Euler solved this in 1736: every time you enter an intersection, you must leave it via another street ( edges). Therefore, an Euler tour is possible if and only if every single intersection has an EVEN number of connecting streets!
- The Hamiltonian Challenge (The Traveling Salesperson): You are a traveling salesperson. You don't care about driving down every street; you only care about visiting every client city (vertex) exactly once and returning home!
- The P vs NP Divide:
- Eulerian: Inspecting vertex degrees takes linear time in class .
- Hamiltonian: Checking whether a general graph contains a Hamiltonian cycle is NP-Complete!
💻 Bridging to Computer Science: Genome Sequencing & PCB Drill Path Optimization
In computer systems:
- De Bruijn Graphs & DNA Assembly: Next-generation genome sequencing breaks DNA reads into -mers, models them as edges in a De Bruijn graph, and reconstructs the chromosome by finding an Eulerian path!
- PCB Drilling & CNC Toolpaths: Industrial robotic drills minimize manufacturing time by computing a Hamiltonian Cycle (Traveling Salesperson Problem) across the coordinates of circuit board holes.
- Cryptographic Trapdoors: Hamiltonian cycle detection in hard graphs powers zero-knowledge proof protocols.
⚡ The Classical Duality: Eulerian vs Hamiltonian
Eulerian Graphs (Edge-Centric) vs Hamiltonian Graphs (Vertex-Centric)
The fundamental computational divide between linear-time edge traversals and NP-complete vertex paths
Eulerian Traversal
- •Euler Trail: Traverses EVERY edge in G exactly once.
- •Euler Circuit (Tour): Closed trail traversing every edge, returning to start.
- •Necessary & Sufficient: Checked instantaneously by degree parities!
- •Complexity: Solvable in O(V + E) linear time (Hierholzer's Algorithm).
Hamiltonian Traversal
- •Hamiltonian Path: Visits EVERY vertex in G exactly once.
- •Hamiltonian Cycle: Closed cycle visiting every vertex, returning to start.
- •No simple characterization: Only sufficient conditions (Dirac, Ore).
- •Complexity: NP-Complete! No known polynomial-time decision algorithm.
🏛️ Eulerian Characterization: Euler's Theorem (1736)
Let be a connected graph:
- An Euler Trail (or Eulerian Path) is a trail that visits every edge in exactly once.
- An Euler Circuit (or Eulerian Tour) is a closed trail that visits every edge in exactly once and ends at the starting vertex.
- A graph is called an Eulerian Graph if it possesses an Euler Circuit.
Let be a connected undirected graph:
- Euler Circuit Criterion: contains an Euler Circuit if and only if EVERY vertex in has an EVEN degree:
- Euler Trail Criterion: contains an Euler Trail (but not a circuit) if and only if EXACTLY TWO vertices in have ODD degree: (The Euler trail must start at one of the odd-degree vertices and terminate at the other odd-degree vertex).
If a connected graph has more than 2 odd-degree vertices (e.g. 4, 6, 8...), it can have neither an Euler trail nor an Euler circuit!
The 3-Step Decision Flow for Eulerian Graphs
Instant verification checklist to determine trail or circuit existence
Check Graph Connectivity
Pre-ConditionEnsure all vertices with non-zero degree belong to a single connected component. (Isolated vertices of degree 0 are ignored).
Count Odd-Degree Vertices
Parity CheckCount the number of vertices k with odd degree: k = |{ v | deg(v) is odd }|.
Classify Traversal Status
ClassificationIf k = 0 ⟹ Euler Circuit! If k = 2 ⟹ Euler Trail (starts at odd 1, ends at odd 2). If k > 2 ⟹ Zero Eulerian traversals possible!
🎯 Hamiltonian Graphs: Dirac's & Ore's Sufficiency Theorems
Let be a graph:
- A Hamiltonian Path is a simple path that visits every vertex in exactly once.
- A Hamiltonian Cycle is a closed simple cycle that visits every vertex in exactly once and returns to the starting vertex.
- A graph is called a Hamiltonian Graph if it contains a Hamiltonian Cycle.
Unlike Eulerian graphs, there is no known necessary and sufficient condition that characterizes all Hamiltonian graphs in polynomial time.
If is a simple graph with vertices such that the degree of every vertex is at least half the total number of vertices:
then is guaranteed to be Hamiltonian!
(Note: Dirac's condition is a sufficient condition, not a necessary one. A graph can be Hamiltonian even if some vertices have degree ; for example, cycle is Hamiltonian for all , yet every vertex has degree for ).
If is a simple graph with vertices such that for every pair of non-adjacent vertices and :
then is guaranteed to be Hamiltonian!
Relationship: Dirac's Theorem is a direct special case of Ore's Theorem: if and , then .
📝 Step-by-Step Worked Examples
Example 1: Solving the Seven Bridges of Königsberg
Problem Statement: The city of Königsberg had 4 landmasses () connected by 7 bridges across the Pregel River:
- Landmass connects to (2 bridges), (2 bridges), and (1 bridge).
- Landmass connects to (2 bridges) and (1 bridge).
- Landmass connects to (2 bridges) and (1 bridge).
- Landmass connects to (1 bridge), (1 bridge), and (1 bridge).
Can a citizen take a continuous walk that crosses every single bridge exactly once?
Step-by-Step Solution:
-
Step 1: Calculate the Degree of Each Landmass (Vertex)
- (Odd!)
- (Odd!)
- (Odd!)
- (Odd!)
-
Step 2: Apply Euler's Theorem
- The graph has vertices, and ALL 4 vertices have odd degrees!
- By Theorem 10.1:
- An Euler circuit requires 0 odd vertices.
- An Euler trail requires exactly 2 odd vertices.
- Since the graph has 4 odd vertices, NO Eulerian trail or circuit exists!
- Conclusion: It is mathematically impossible to cross all 7 bridges without crossing at least one bridge twice!
Key Takeaway: Euler's resolution of the Königsberg bridge problem birthed the entire field of Graph Theory by abstracting physical geometry into vertex degrees.
Example 2: Testing Dirac's and Ore's Theorems on a Network
Problem Statement: A network has servers. The degree sequence is .
- Does this graph satisfy Dirac's Theorem?
- If the two degree-4 vertices are connected to each other, and all non-adjacent pairs satisfy , does it satisfy Ore's Theorem? Is it Hamiltonian?
Step-by-Step Solution:
-
Part 1: Testing Dirac's Condition
- Number of vertices: .
- Dirac threshold: .
- The minimum degree in the graph is .
- Since every vertex has degree :
- Yes, it satisfies Dirac's Theorem!
- Therefore, the graph is guaranteed to be Hamiltonian.
-
Part 2: Testing Ore's Condition
- For every non-adjacent pair , the minimum possible degree sum is:
- Since the sum of degrees for every non-adjacent pair is , Ore's condition is fully satisfied.
- Both theorems confirm the existence of a Hamiltonian Cycle.
Key Takeaway: Checking provides a 1-second verification of Hamiltonicity in dense networks.
🎯 Exam & Interview Pitfall Check
Question 1: Can a bipartite graph with an odd number of vertices ever be Hamiltonian? Key Focus Points: Never! In a bipartite graph , any cycle must alternate between and at every step (). Therefore, any cycle in a bipartite graph must have an even length! A Hamiltonian cycle visits all vertices, so its length is . If is odd, no Hamiltonian cycle can exist! Furthermore, even if is even, a bipartite graph is Hamiltonian only if .
Question 2: Is a complete graph always Eulerian? Always Hamiltonian? Key Focus Points:
- Hamiltonian: is ALWAYS Hamiltonian for all (Dirac's condition holds).
- Eulerian: In , every vertex has degree . For to have an Euler circuit, must be even, which means must be an ODD number! (e.g. are Eulerian; are NOT Eulerian).
Trap 1: Assuming Dirac's condition is necessary Why it fails: Students often claim: ", so the graph is not Hamiltonian." This is completely false! Cycle graph has 100 vertices and is obviously Hamiltonian, yet every vertex has degree . Dirac is only a sufficient condition!
Trap 2: Forgetting to check connectivity for Euler's Theorem Why it fails: If a graph consists of two disjoint cycles and , every vertex has degree 2 (even), but the graph is disconnected! An Euler tour cannot jump between disjoint components. Euler's theorem strictly requires that all edges lie in a single connected component.