Virtual laboratory/Mathematics/Graph theory/The Seven Bridges of Königsberg — the birth of graph theory

The Seven Bridges of Königsberg — the birth of graph theory

An extension of the graph-theory topic. A graph is a set of vertices joined by edges; the degree of a vertex is the number of edges leaving it. A walk that traverses every edge exactly once (an Eulerian path) exists only when the number of vertices of odd degree is 0 or 2. In 18th-century Königsberg all 4 landmasses had odd degree — in 1736 Leonhard Euler proved that crossing all 7 bridges exactly once is impossible, launching graph theory (a landmark discovery, 1736).

The Seven Bridges of Königsberg — the birth of graph theory
Mathematics · Graph theory · The Königsberg bridges — the birth of graph theory (1736)
Bridge layout variantOriginal (7)
You can walk every bridge exactly once (no repeats) precisely when the number of landmasses with an odd number of bridges is:
bridges
7
odd landmasses
4
sum of degrees
14 = 2·7
verdict
impossible
🎯 Challenge: is there an Eulerian route?
streak: 0

I’ll give you the landmass degrees (bridge counts) — decide whether you can walk every bridge exactly once. Rule: the number of odd-degree landmasses must be 0 or 2.

What just happened?

In 18th-century Königsberg (today Kaliningrad) the river Pregel split the city into 4 parts — two banks (A, B) and two islands (C, D — Kneiphof and the neighbouring island) — joined by 7 bridges. Residents wondered whether you could cross every bridge exactly once. In 1736 Leonhard Euler proved it was impossible — and in doing so founded a whole new branch of mathematics: graph theory.

The model: a graph instead of a map

Euler reduced the map to a graph: the landmasses become vertices and the bridges become edges. The number of bridges meeting a given landmass is called the degree of that vertex:

deg⁡(v)=number of bridges meeting landmass v\deg(v) = \text{number of bridges meeting landmass } v

Every bridge has two ends, so the sum of all degrees is always twice the number of bridges — this is the handshaking lemma:

∑vdeg⁡(v)=2E\sum_{v} \deg(v) = 2E

Euler’s theorem

A route that traverses every edge exactly once (an Eulerian path or circuit) exists if and only if the number of vertices of odd degree is:

#{v:deg⁡(v) odd}∈{0, 2}\#\{v : \deg(v) \text{ odd}\} \in \{0,\ 2\}

0 odd vertices → an Eulerian circuit exists (start = finish, at any vertex). 2 odd vertices → an Eulerian path exists (you must start and finish exactly at those two vertices). Any other number of odd vertices — impossible, no exceptions.

Why Königsberg failed

In the original layout all 4 landmasses have odd degree (3, 3, 5, 3) — four odd vertices, not 0 or 2. That is why no walk over all 7 bridges without repetition exists — not because the residents lacked ingenuity, but because of the structure of the graph itself. Adding a single bridge (e.g. A–B) flips two of the landmasses to even degree, leaving exactly 2 odd vertices — and an Eulerian path appears at once.

What does it mean in practice?

The same parity condition governs postal and refuse-collection routes today (the Chinese postman problem), printed-circuit-board design, DNA sequencing (assembling fragments in a de Bruijn graph) and route planning in networks — everywhere you have to traverse every connection exactly once.

Why this matters for your exams:

Graph theory is not formally a separate exam topic, but Euler’s reasoning is a textbook example of a proof by invariant — count something that does not change (here: the parity of the degrees) and show that the problem’s condition contradicts it. The same move (“show that it cannot be done…”) appears in advanced-level combinatorics problems and in olympiad problems.

Remember: an Eulerian path or circuit exists if and only if the number of odd-degree vertices is 0 (circuit) or 2 (path) — any other number means it is impossible. This is the first result in the history of graph theory.

Illustrative model · NexTutor Virtual Laboratory

Enjoyed the experiment? Share it.

It's free — send it to friends from school.

Theory & formulas

Graph and vertex degree

Landmasses are vertices, bridges are edges. The degree deg⁡(v)\deg(v) is the number of edges leaving vertex vv.

The Eulerian path condition

You can traverse every edge exactly once if and only if the number of vertices of odd degree is 00 (an Eulerian circuit) or 22 (an open path).

Königsberg

All 44 landmasses had odd degree (more than 22 of them), so a route over all 77 bridges exactly once is impossible (Euler, 1736).

Notation: vv a vertex, deg⁡(v)\deg(v) its degree.

Frequently asked questions

›

What is the degree of a vertex?

The number of edges (bridges) leaving a given vertex (landmass) in the graph.

›

When can you traverse every edge of a graph exactly once?

Only when the number of vertices of odd degree is 0 or 2.

›

Why were the Königsberg bridges impossible to cross?

Because all 4 landmasses in Königsberg had odd degree — more than 2 of them.

Teaching? Embed this experiment on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →