In the early 18th century, the citizens of Konigsberg had a puzzle. Their city, a prosperous Prussian trading hub on the Pregel River, in what is now Kaliningrad, Russia. Was built across two islands connected to each other and to the river’s north and south banks by seven bridges. The question was simple: could you walk through the city crossing each bridge exactly once, without retracing your steps?
People tried. They drew routes on maps, wandered the streets on Sunday afternoons, argued in coffeehouses. Nobody could find a path that worked. But nobody could prove it was impossible, either. It seemed like a trivial amusement, the kind of thing you puzzle over for a few minutes and then forget.
Then, in 1736, Leonhard Euler got hold of the problem. What he did with it was anything but trivial. In solving the Bridges of Konigsberg, Euler did not just answer a local curiosity. He invented an entirely new branch of mathematics. Today we call it graph theory, and it runs through nearly every aspect of modern digital life.
The Problem, Precisely Stated
Let us be clear about what the puzzle involves. Konigsberg sat on both banks of the Pregel River, with two large islands in the middle. Seven bridges connected the landmasses:
- Five bridges connected the two islands to the north and south banks
- Two bridges connected the two islands to each other (one bridge linked the larger island directly to each bank, and the smaller island had its own connections)
The challenge: start anywhere in the city, walk a route that crosses every bridge exactly once, and end up wherever you like. You may cross land freely, but each bridge must be used once and only once.
On the surface, this looks like it should be solvable with enough patience. Seven bridges, four landmasses, surely one of the possible routes works? The number of possible routes is large but finite. You could, in theory, simply try them all.
But Euler was not interested in trying them all. He was interested in understanding why certain configurations allow such walks and others do not. And that shift, from “let me try every possibility” to “let me understand the underlying structure”, is what made his solution revolutionary.
Euler’s Insight: Forget the Map, See the Structure
Euler’s key move was radical in its simplicity. He stripped away everything that did not matter, the streets, the buildings, the distances, the shapes of the islands, and reduced the problem to its bare essentials. Each landmass became a point (what we now call a node or vertex). Each bridge became a line connecting two points (an edge). The result was an abstract diagram that captured the problem’s logical structure without any geographical clutter.
This was, in essence, the first graph in the mathematical sense. And once Euler had the graph, the solution became almost obvious.
He observed that each time you visit a node during your walk, you use one bridge to arrive and one bridge to leave. That means every intermediate node, every node that is not your starting or ending point, must have an even number of edges. If a node has an odd number of edges, you will eventually get stuck there: you will arrive via the last unused bridge with no way to leave.
Now look at the Konigsberg graph. Every single node has an odd number of edges:
- The north bank: 3 bridges
- The south bank: 3 bridges
- The larger island: 5 bridges
- The smaller island: 3 bridges
For a walk crossing every bridge exactly once to be possible, the graph can have at most two nodes with an odd number of edges (these would be the start and end of the path). Konigsberg has four odd nodes. Therefore, no such walk exists. Not because nobody has been clever enough to find one, but because the mathematical structure makes it impossible.
Euler published his proof in 1736 under the title Solutio problematis ad geometriam situs pertinentis, “The solution of a problem relating to the geometry of position.” He was almost apologetic about it, writing to a colleague that the problem “bore little relationship to mathematics” and that he was not sure it deserved serious attention. He was wrong about that. Spectacularly, historically wrong.
What Euler Actually Invented
The Konigsberg proof is the founding document of graph theory, but its significance goes deeper than one solved puzzle. Euler had demonstrated a new way of doing mathematics, one focused not on quantities, shapes, or equations but on connections and relationships.
Traditional geometry, from Euclid’s Elements onward, dealt with properties like length, area, angle, and proportion. Algebra dealt with numerical relationships. Euler’s graph theory dealt with something different entirely: the structure of how things are linked to each other, regardless of size, shape, or distance.
This is why Euler called it “the geometry of position.” It was not about measurement. It was about topology, the study of properties that remain unchanged when you stretch, bend, or deform a shape without tearing it. Two graphs are the same if they have the same nodes and the same connections, even if one is drawn as a neat diagram and the other as a tangled mess. What matters is the pattern of connectivity, nothing else.
This was genuinely new. And like many genuinely new mathematical ideas, it took a while for the world to catch up.
From Euler to the Modern World
For about a century after Euler’s paper, graph theory remained a mathematical curiosity, elegant but seemingly impractical. Then the modern world arrived, and it turned out that connections and networks were everywhere. Graph theory went from an obscure branch of mathematics to one of the most widely applied.
Consider where graphs appear today:
- The internet. The entire World Wide Web is a graph, pages are nodes, hyperlinks are edges. Google’s original PageRank algorithm was fundamentally a graph theory calculation, ranking pages by their position in the network of links.
- Social networks. Facebook, Instagram, LinkedIn, each one is a massive graph where people are nodes and relationships are edges. Recommendation algorithms, friend suggestions, and content distribution all rely on graph analysis.
- GPS and navigation. Your phone’s mapping app models the road network as a graph and uses algorithms descended from graph theory to find the shortest route between two points.
- Epidemiology. The spread of diseases through populations is modeled as a network. Contact tracing during the COVID-19 pandemic was, mathematically speaking, a graph theory problem.
- Circuit design. Electronic circuits are graphs. Optimizing chip layouts involves solving graph problems.
- Logistics and supply chains. Shipping routes, delivery networks, airline schedules, all graphs, all optimized using techniques that trace back to Euler.
Every time you ask your phone for directions, scroll a social media feed shaped by algorithms, or receive a package routed through an optimized distribution network, you are benefiting from mathematics that began with seven bridges in a Prussian city.
Euler: The Most Productive Mathematician in History
The Bridges of Konigsberg was a footnote in the career of a man whose output was staggering. Leonhard Euler (1707-1783) published more mathematics than any other individual in history, roughly 866 papers and books, covering virtually every branch of mathematics known in his time and several he invented. He continued working even after going completely blind in 1771, dictating papers to assistants from memory.
His contributions include foundational work in calculus, number theory, mechanics, optics, and astronomy. He introduced much of the mathematical notation we still use today: e for the base of the natural logarithm, i for the square root of negative one, the sigma notation for sums, and the convention of using f(x) to denote a function. If you have ever taken a mathematics course, you have used Euler’s notation.
The breadth of his influence is hard to overstate. He sits at a crossroads where pure mathematics meets applied science, where abstract reasoning meets practical problem-solving. His work on the Konigsberg bridges exemplifies this perfectly: a seemingly trivial puzzle yielded insights that now underpin billion-dollar industries.
Konigsberg Today
The city of Konigsberg no longer exists, at least not by that name. In 1945, after World War II, the city was annexed by the Soviet Union and renamed Kaliningrad. Much of the old Prussian architecture was destroyed during the war or demolished afterward. Of the original seven bridges, only five remain, two were bombed during the war and replaced by a single modern highway bridge.
Ironically, the current configuration of bridges in Kaliningrad does allow an Eulerian path, a route crossing each bridge exactly once. The destruction of two bridges and addition of one new one changed the graph’s properties just enough to make the walk possible. Euler would have appreciated the mathematical neatness of it.
The Deeper Lesson
There is something profoundly encouraging about the Konigsberg story. A puzzle that seemed like idle entertainment turned out to contain the seed of an entirely new mathematical discipline. Euler could not have predicted GPS navigation or social network algorithms. He was just curious about bridges.
This is a pattern that repeats throughout the history of mathematics and science. Seemingly useless curiosity leads to abstract insights, which eventually find concrete applications that transform the world. The history of science, as explored in works like Portraying Science, is full of these unexpected connections – ideas jumping from one context to another across centuries.
Euclid’s geometry, developed as pure knowledge in ancient Alexandria, became the foundation for engineering and architecture. Newton’s calculus, invented to describe planetary motion, now runs economic models and machine learning algorithms. And Euler’s graph theory, born from a Sunday afternoon puzzle about seven bridges, now powers the digital infrastructure of modern civilization.
The next time someone asks what mathematics is good for, you might tell them about a walk through Konigsberg that nobody could complete, and the Swiss mathematician who proved why – and, in doing so, gave us the mathematical language to describe a connected world that would not exist for another 250 years.