By Lson Lee · Indie developer & puzzle game enthusiast

The Seven Bridges of Königsberg

How a simple question about a Sunday walk invented an entire branch of mathematics

The Puzzle

In the 18th century, the city of Königsberg (now Kaliningrad, Russia) was built on both banks of the Pregel River, with two large islands in the middle. Seven bridges connected these four landmasses.

The citizens had a simple question: Is it possible to walk through the city, crossing each of the seven bridges exactly once, without crossing any bridge twice?

    North Bank (A)
   /    |    \
  b1    b2    b3
 /      |      \
Island  |  Island
 (B)----b4----(C)
 \      |      /
  b5    b6    b7
   \    |    /
    South Bank (D)

7 bridges connecting 4 landmasses
Can you cross each bridge exactly once?

People tried and failed for years. Nobody could find a route. But nobody could prove it was impossible, either — until a mathematician named Leonhard Euler took on the challenge in 1736.

Euler's Insight

Euler's genius was realizing that the exact layout of the city didn't matter. What mattered was the structure of connections — which landmasses were connected to which, and by how many bridges.

He stripped away all the geographic detail and reduced the problem to its essence:

  A (3 bridges) --- B (5 bridges)
  |                 |
  C (3 bridges) --- D (3 bridges)

Each letter = a landmass (vertex)
Each connection = a bridge (edge)
Number = how many bridges touch that landmass

This was the birth of what we now call a graph — a set of vertices (nodes) connected by edges. Euler had just invented graph theory.

The Key Discovery

Euler noticed something crucial about the number of bridges touching each landmass (what we now call the degree of each vertex):

All four landmasses have an odd number of bridges. Euler proved this makes the problem impossible.

His reasoning: if you walk through a landmass (entering on one bridge and leaving on another), you use bridges two at a time. So any landmass that isn't your starting or ending point must have an even number of bridges. A path that crosses every bridge once can have at most two odd-degree vertices (the start and the end).

Königsberg has four odd-degree vertices. Therefore, no solution exists.

From Bridges to One-Stroke Puzzles

Euler's theorem gave us the exact rules for when a "one-stroke" traversal is possible:

Euler's Rules for One-Stroke Traversal

  • 0 odd-degree vertices: You can trace it in one stroke, starting and ending at the same point (an Euler circuit)
  • 2 odd-degree vertices: You can trace it in one stroke, starting at one odd vertex and ending at the other (an Euler path)
  • More than 2 odd-degree vertices: Impossible. No one-stroke solution exists.

Every one-stroke puzzle game — including One Stroke — is built on these rules. When One Stroke's procedural generation algorithm creates a new puzzle, it uses Euler's theorem to mathematically guarantee that every puzzle has at least one solution.

When you play a one-stroke puzzle, you're solving the same type of problem that Euler solved in 1736. You're doing graph theory — you just might not know it.

Why This Matters Today

Euler's seemingly simple insight about bridges launched an entire field of mathematics. Graph theory is now essential to:

It all started with a question about seven bridges in a Prussian city — and a mathematician who saw the elegant structure hiding underneath.

Frequently Asked Questions

What is the Seven Bridges of Königsberg problem?

It's a famous mathematical puzzle from 1736. The city of Königsberg had seven bridges connecting two islands and two mainland areas. The question: can you walk through the city crossing each bridge exactly once? Euler proved it was impossible because all four landmasses had an odd number of bridges.

Why is this problem important?

Euler's solution is considered the first theorem of graph theory — a branch of mathematics now fundamental to computer science, network analysis, GPS routing, and puzzle game design. Every one-stroke puzzle game is a direct descendant of this 1736 proof.

What's the connection to one-stroke puzzles?

One-stroke puzzles ask the same fundamental question as the Seven Bridges: can you traverse every path exactly once without retracing? Euler's theorem provides the mathematical rules for determining when this is possible. Games like One Stroke use these rules to generate puzzles that are guaranteed solvable.

Does Königsberg still have seven bridges?

No. Königsberg is now Kaliningrad, Russia. Two of the original bridges were destroyed in World War II, and others have been rebuilt. The modern city has a different bridge layout — but the mathematical insight Euler derived from the original seven remains timeless.

Continue Learning

Try One Stroke Free on iPhone

Infinite puzzles. Adaptive difficulty. No forced ads.

Download on the App Store
Download on the App Store