Graph Theory Basics - Main Theorem
Euler's Theorem characterizes which graphs admit Eulerian circuits, solving the original problem that founded graph theory.
Let be a connected graph. Then has an Eulerian circuit (a circuit using every edge exactly once) if and only if every vertex has even degree.
Proof:
Necessity (): If has an Eulerian circuit, then every vertex must have even degree.
Let be an Eulerian circuit. As we traverse , every time we visit a vertex , we enter via one edge and leave via another edge. These two edges contribute 2 to .
Since uses every edge exactly once, each edge contributes exactly 1 to the degree count at each of its endpoints. Since edges are paired (entering and leaving) at each vertex during the traversal, must be even for all .
Sufficiency (): If every vertex of connected has even degree, then has an Eulerian circuit.
We prove this by strong induction on the number of edges .
Base case: If , the graph is a single vertex with an empty circuit (trivially Eulerian).
Inductive step: Assume the statement holds for all graphs with fewer than edges. Let have edges with all vertices of even degree.
Step 1: Construct a cycle.
Start at any vertex and follow edges arbitrarily, never repeating an edge. Since every vertex has even degree, whenever we enter a vertex, there's always an unused edge to exit (except when we return to ).
Eventually, we must return to (since the graph is finite and we can't repeat edges). This forms a cycle .
Step 2: Remove and apply induction.
Remove all edges of from to get . Every vertex in still has even degree (we removed cycles, which contribute equally to entering/leaving).
The graph may be disconnected, but each connected component has all vertices of even degree and fewer than edges. By the inductive hypothesis, each component has an Eulerian circuit .
Step 3: Splice circuits together.
As we traverse , whenever we encounter a vertex that belongs to some component of , we can splice in the Eulerian circuit of at that point.
This produces an Eulerian circuit for , completing the proof.
The Seven Bridges of Königsberg problem asks whether one can walk through the city crossing each of its seven bridges exactly once.
Modeling this as a graph with landmasses as vertices and bridges as edges, we have 4 vertices with degrees: 3, 3, 3, 5 (all odd).
By Euler's theorem, no Eulerian path exists (we'd need at most 2 odd-degree vertices). Therefore, the desired walk is impossible.
For an Eulerian path (not necessarily a circuit), the condition is: the graph must have exactly 0 or 2 vertices of odd degree. If there are 0 odd-degree vertices, the path is actually a circuit. If there are exactly 2, the path must start at one odd-degree vertex and end at the other.
Eulerian circuits can be found in time using Hierholzer's algorithm (1873): build a cycle, then recursively splice in cycles from any remaining edges. The Chinese Postman Problem asks for the shortest tour visiting every edge at least once (solved by finding minimum-weight matching on odd-degree vertices and adding duplicate edges).