Seven bridges of Königsberg: the impossible walk Euler solved by counting letters
A walk, seven bridges and a nagging doubt: can you cross every bridge once and only once? Put like that, it sounds like an after-dinner puzzle. The seven bridges of Königsberg turned into something else: the paper that, according to the archive devoted to Euler’s work, is often cited as the birth of both topology and graph theory. And the solution fits on a napkin, if you can count letters.
A geometry without measurements
Euler published his solution in Latin, in volume 8 of the Commentarii of the St Petersburg Academy of Sciences. According to the Euler Archive, which catalogues his works, the paper was written in 1735 and published in 1741, on pages 128 to 140. Its title is Solutio problematis ad geometriam situs pertinentis, the solution of a problem relating to the geometry of position.
The first paragraph explains that title. Besides the part of geometry that deals with quantities, Euler writes, there is another, still almost unknown, first mentioned by Leibniz, who called it the geometry of position. It deals only with position and its properties, without measuring quantities or calculating with them.
Euler says someone had mentioned a problem to him that looked like geometry but didn’t ask for anything to be measured and couldn’t be solved by calculation. So he had no hesitation in assigning it to this geometry of position, and decided to set out his method as an example of it.
The question
The problem, which he says was fairly well known, went like this. In Königsberg, in Prussia, there is an island called the Kneiphof, and the river around it splits into two branches. The branches are crossed by seven bridges, which Euler labels a, b, c, d, e, f and g. The question was whether anyone could plan a walk that crossed each bridge once and no more than once.
And he adds a lovely line: he was told that some people denied it was possible, others doubted it, and nobody claimed it could be done. Euler wasn’t content with the town’s case. He posed a general problem: whatever the shape of the river and the way it splits into branches, and whatever the number of bridges, find out whether every bridge can be crossed exactly once.
No trying every route
The obvious way to solve it, Euler admits, would be to list every possible route and check whether any works. But because of the sheer number of combinations, that method would be too difficult and laborious, and with many more bridges it couldn’t even be used. Besides, carried through to the end, it would turn up a great many routes that had nothing to do with the question. So he dropped it and looked for another that would only say whether the walk was possible or not. He suspected it would be much simpler.
Seven bridges of Königsberg: the letter trick
His whole method, he writes, rests on a suitable way of noting each bridge crossing. He calls the land areas separated by the river A, B, C and D. If a traveller goes from area A to area B over a bridge, that’s written AB: the first letter is where they left from, the second where they arrived. If they then go from B to D, the whole route is written ABD, with three letters, because the middle B serves both as arrival and departure.
The consequence is simple. A route over three bridges is written with four letters. Over four bridges, with five. In general, you need one more letter than bridges. So crossing all seven bridges takes exactly eight letters.
There’s an important detail: with this notation it doesn’t matter which particular bridge you use, only which area you go from and to. So, since A and B are joined by two bridges, the pair AB or BA has to appear twice in the string; the same goes for A and C. The pairs A and D, B and D, and C and D appear once each.
Counting how often each letter appears
Before arranging any letters, Euler asks whether they can be arranged like that at all. If it can be shown to be impossible, he writes, all the work of searching for the string would be wasted. So he looks for a rule.
He focuses on a single area, A, reached by several bridges. If one bridge leads to A, the letter A appears once, whether the traveller starts there or arrives. If three bridges lead there, A appears twice. If five, three times. In general, when the number of bridges is odd, add one and divide by two: that tells you how many times the letter has to appear.
Nine letters where eight fit
In Königsberg, five bridges lead to the island A: a, b, c, d and e. So A must appear three times. Three bridges lead to area B, so B appears twice, and the same for D and C. A string of eight letters would have to hold three A’s and two of each of the other three. That’s nine letters. Euler dispatches it in a line: it is utterly impossible in a series of eight letters. And he concludes that no such walk can be made over the seven bridges of Königsberg.
An invented river with fifteen bridges
To show the method works on complicated cases, Euler invents another. Two islands, A and B, surrounded by water connected to four rivers, and fifteen bridges. Six areas of land in all, from A to F. He draws up a table: 8 bridges lead to A, 4 to B, 4 to C, 3 to D, 5 to E and 6 to F.
He marks the even ones with an asterisk and writes down half; for the odd ones he adds one and writes down half. The total is 16, exactly the number of bridges plus one. Conclusion: the walk is possible, as long as you start in D or E, the two areas without an asterisk. And he writes it out in full, letter by letter, starting in E and ending in D, with the bridge letters slotted between the area letters.
Even and odd
Then Euler generalises. When the number of bridges reaching an area is even, you also have to check whether the walk starts there. And he notes something useful for checking the sums: if you add up the bridges leading to every area, the result is even, because each bridge is counted twice, once for each bank. From this he deduces that there can’t be just one area with an odd number of bridges, nor three, nor five. Areas with an odd number always come in pairs. In Königsberg there were four.
He adds a curiosity too: in Königsberg you could cross every bridge exactly twice, because it’s as if each bridge were split in two and every area had an even number.
The final rule
Euler closes with a rule that tells you at once whether the walk is possible. If more than two areas are reached by an odd number of bridges, you can say for certain that the walk doesn’t exist. If there are only two, the walk is possible as long as you start in one of them. And if there are none, you can start anywhere. That rule, he writes, settles the problem completely.
To trace the route when one exists, he gives a practical tip: mentally remove, as often as you can, pairs of bridges joining the same two areas, find the walk over the bridges that remain, then put back the ones you removed. No further instructions are needed, he says.
What came after
The Euler Archive sums up the paper in modern terms: Euler reduced the problem to an analysis of the degrees of the vertices of a graph, that is, how many lines leave each point, and determined that the Königsberg problem has no solution. The archive describes it as one of his most famous papers and says it is often cited as the earliest in both topology and graph theory.
My own reading, which is my reasoning: the genius lay in what Euler chose to ignore. The shape of the banks, the length of the bridges and the actual path didn’t matter. All that counted was which area connects to which, and how many times. Strip away everything else, and a question about a walk becomes a sum of evens and odds.