Euler’s Walk: How a City’s Puzzle Sparked a New Branch of Mathematics
A Journey into the Beauty of Abstraction
Euler’s Walk: How a City’s Puzzle Sparked a New Branch of Mathematics
A Journey into the Beauty of Abstraction

1. Introduction: The Enigma of a City
Königsberg, an 18th-century Prussian city, was bisected by the Pregel River, creating two large islands. Seven bridges connected these islands and the riverbanks, leading to a popular urban puzzle:
Is it possible to take a walk that crosses every bridge exactly once and returns to the starting point?
No one could find such a route. The problem reached Leonhard Euler, who proved it was impossible. To do so, he ignored geography and reformulated the problem using a new, abstract language, giving birth to graph theory in 1736.
2. Euler’s Brilliant Abstraction
Euler realized the city’s layout was irrelevant. The only crucial information was how many landmasses existed and how they were connected. He created an abstract model:
- Vertices (nodes) for the landmasses (4).
- Edges for the bridges (7).
The question was translated to: Does an Eulerian path exist in this graph? That is, a path that traverses every edge exactly once. If it starts and ends at the same vertex, it is an Eulerian circuit.
3. Key Theoretical Foundations
Euler’s key concept was the degree of a vertex: the number of edges connected to it. If an island has 3 bridges, its vertex has a degree of 3.
This lemma states that the sum of the degrees of all vertices is equal to twice the number of edges:

A key consequence is that the number of vertices with an odd degree in any graph must always be even.
4. Euler’s Theorem
For a connected graph:
- It has an Eulerian circuit if and only if all its vertices have an even degree.
- It has an Eulerian path (different start/end) if and only if it has exactly two vertices of odd degree.
- If there are more than two vertices of odd degree, no Eulerian path exists.
Odd-degree vertices are “unbalanced.” A path requires a starting point and an ending point (2 odd vertices) or a perfectly balanced circuit (0 odd vertices). More than two unbalanced points make the journey impossible.
5. Application to the Königsberg Problem
In the Königsberg graph, the degrees of the four vertices are: 3, 5, 3, and 3.
The graph has four odd-degree vertices. According to the theorem, having more than two means no Eulerian path is possible.
Euler’s solution is considered the birth of graph theory and topology, studying properties of shapes based on structure and connection, not measurements.
Today, graph theory is fundamental for GPS, internet routing, logistics, and social network analysis.
- Impact and Legacy
6.1. The Birth of Graph Theory
Euler’s solution is considered the birth of graph theory and topology, studying properties of shapes based on structure and connection, not measurements.
6.2. Modern Relevance
Today, graph theory is fundamental for GPS, internet routing, logistics, and social network analysis.
7. Eulerian Circuit: The Freedom to Start Anywhere
When a graph has an Eulerian Circuit, all its vertices have an even degree. This “perfect balance” condition has a wonderful consequence:
You can start your tour at ANY vertex you choose. No exceptions.
The intuition is simple: if every vertex has an even number of “doors” (edges), for every door you use to enter, there will always be an unused door to exit. You never get stuck, and you will always return to your starting point.
8. Eulerian Path: A Mandatory Start and End
An Eulerian Path exists when there are exactly two vertices of odd degree. These two vertices set the rules:
The path MUST start at one of the two odd-degree vertices and will ALWAYS end at the other.
The two odd vertices are the graph’s natural “imbalance” points: one is the natural starting point (with an extra “exit”), and the other is the inevitable destination (with an extra “entry”).
9. Comparison Table: The Key Difference

10. Route Examples (Solutions)
Although multiple correct sequences exist for each case, here is one example of a complete solution for each scenario.

11.Scenario Gallery
The key to solving the Königsberg problem is modifying the graph to meet the conditions of Euler’s Theorem. Here you can visually see the three main states:


12. Interactive Simulation: Explore the Problem
The best way to understand graph theory is by experimenting. The following simulator allows you to:
- Try to solve the original problem and see why it’s impossible.
- Modify the graph to create Eulerian paths and circuits.
- Visualize how an algorithm (DFS) systematically searches for all possible solutions.
In Summary: The Golden Rule of Traversal
The graph’s structure, specifically the number of odd-degree vertices, completely dictates the nature of the traversal. The rule is simple and powerful:
- Zero (0) odd vertices → It’s an Eulerian Circuit → You have total freedom; you can start at any vertex and you will always return to it.
- Two (2) odd vertices → It’s an Eulerian Path → The route is fixed; you must start at one odd vertex and you will inevitably end at the other.
Beyond the Bridges: The Beauty of Abstraction
The true magic of the Königsberg problem lies not in the solution itself, but in the mental leap Euler taught us to make: ignore the irrelevant (distances, shapes) and focus on the pure structure (connections).
This power of abstraction is the essence of mathematics and computer science. By transforming a chaotic physical map into a clean diagram of dots and lines, we not only solved a local riddle but also uncovered a universal law applicable to any network imaginable.
The essence of mathematics is not to make simple things complicated, but to make complicated things simple.
Finally, there is a profound aesthetic in graph theory. The fact that a seemingly complex problem can be reduced to a rule as elegant as “count the odd vertices” reveals a structural beauty in the universe of logical reasoning. It is proof that, often, the most powerful solutions are also the most simple and beautiful.
메타데이터
- post_id
- 77ecf33bdf1a
- slug
- eulers-walk-how-a-city-s-puzzle-sparked-a-new-branch-of-mathematics-77ecf33bdf1a
- url
- https://medium.com/@sergiosear/eulers-walk-how-a-city-s-puzzle-sparked-a-new-branch-of-mathematics-77ecf33bdf1a
- canonical_url
- https://medium.com/@sergiosear/eulers-walk-how-a-city-s-puzzle-sparked-a-new-branch-of-mathematics-77ecf33bdf1a
- author_url
- https://medium.com/@sergiosear
- status
- ok
- fetched_at
- 2026-06-29 22:44:20