Graph theory · History · Euler
The Seven Bridges ofKönigsberg
A city on four pieces of land, a Sunday walk that nobody could finish, and the young mathematician who proved it never would be. Euler did it without measuring a single street, and a new branch of mathematics fell out of the answer.
- City
- Königsberg, Prussia
- Land
- 4 pieces
- Bridges
- 7
- Solved
- 1736, Euler
- Answer
- Impossible

Part I · The city
A city built in a river
Most cities sit beside their river. Königsberg sat in it. The Pregel came down from the east in two arms, the New Pregel and the Old Pregel, closed around a long marshy island called the Lomse, came together for a moment, then split again around a smaller island, the Kneiphof, before running out west to the Baltic lagoon. That gave the city four pieces of ground: a north bank, a south bank, and two islands in between.
The Teutonic Knights put a castle on the hill above the river in 1255 and named it after their ally King Ottokar II of Bohemia: Königsberg, the King’s Mountain. Three towns grew up around it, the Altstadt and the Löbenicht on the north bank and the Kneiphof on its island, each with its own council, its own market and its own walls. They were only merged into a single city in 1724. By then the Kneiphof was the richest of them, packed with merchants’ houses and crowned by the brick cathedral, and to reach it from anywhere else you had to cross water.
So the city was stitched together with bridges. Two ran from the Kneiphof to the north bank, the Merchants’ Bridge and the Blacksmiths’ Bridge. Two ran to the south bank, the Green Bridge and the Gut Bridge. One crossed the short channel from the Kneiphof to the Lomse, and was called the Honey Bridge. The last two reached the Lomse from the north and the south banks, the Wooden Bridge and the High Bridge. Seven in all.
Somewhere in the city’s life a game attached itself to them. On a Sunday afternoon, the story goes, the citizens of Königsberg would set out to walk through town and cross every one of the seven bridges, once each, no bridge twice. You may start wherever you like and finish wherever you like. You may not swim, and you may not cross a bridge halfway and turn back. Nobody could do it. And, which is the interesting part, nobody could explain why not.
The seven bridges, as Euler lettered them
Lands in capitals · bridges in small letters| Bridge | Name | Joins | Fate |
|---|---|---|---|
| a | Green BridgeGrüne Brücke | A – B | Lost after 1944 |
| b | Gut BridgeKöttelbrücke | A – B | Lost after 1944 |
| c | Merchants’ BridgeKrämerbrücke | A – C | Lost after 1944 |
| d | Blacksmiths’ BridgeSchmiedebrücke | A – C | Lost after 1944 |
| e | Honey BridgeHonigbrücke | A – D | Still standing |
| f | High BridgeHohe Brücke | B – D | Rebuilt in the 1930s, stands |
| g | Wooden BridgeHolzbrücke | C – D | Still standing |
A the Kneiphof · B the south bank · C the north bank · D the Lomse. Which bridge Euler meant by which letter on each bank is a modern reading of his Figure 1; the pairs of land they join are his.
Part II · The letters
A puzzle sent from Danzig

The puzzle travelled the way most scientific news travelled in the 1730s: by letter, and slowly. In Danzig, some eighty miles along the Baltic coast, a mathematics teacher called Heinrich Kühn had been thinking about the Königsberg walk. He passed it to Carl Leonhard Gottlieb Ehler, the mayor of Danzig and a keen amateur of science, and Ehler did what ambitious amateurs of the age did with a good question. He wrote to St Petersburg, to the brightest young man in European mathematics.
Leonhard Euler was twenty-eight. He had come to Russia from Basel nine years earlier, held the chair of mathematics at the Imperial Academy of Sciences, and was already producing papers at a rate the Academy’s printers could barely keep up with. We have told the whole of his life elsewhere; what matters here is that in 1736 he was famous for calculation. A problem about a walk through a town, with nothing to calculate, was not obviously his kind of thing.
He said as much. In the reply he sent Ehler in April 1736 he was politely puzzled: the solution, he wrote, owed little to mathematics and rested on reason alone, and he could not see why anyone would expect it from a mathematician rather than from anybody else. Ehler’s own letter of 9 March, which survives with a sketch of the bridges, shows the two men had already been going back and forth about it. The correspondence sat in the St Petersburg archives until Horst Sachs, Michael Stiebitz and Robin Wilson published it in 1988.
Yet the shrug was not the whole story. A few weeks before that reply, on 13 March, Euler had written to the Italian astronomer Giovanni Marinoni in Vienna, and there something in the question had plainly caught.
This question is so banal, but seemed to me worthy of attention.
Euler to Giovanni Marinoni, 13 March 1736
Worthy of attention, he went on, because neither geometry nor algebra nor even the art of counting was enough to settle it. That was the whole discovery in one sentence. The bridges were a problem about space, but not about any of the things geometry had measured for two thousand years. The lengths of the bridges did not matter. The width of the river did not matter. The shape of the Kneiphof, the angle of the streets, the distance from the cathedral to the Green Bridge: all irrelevant. What mattered was only which piece of land was joined to which, and how many times.
Euler knew there was a name waiting for that kind of question. Sixty years earlier Gottfried Wilhelm Leibniz had written to Christiaan Huygens about a geometry that would deal with position rather than size, a geometria situs, and then never quite built it. Euler took the phrase for his title: Solutio problematis ad geometriam situs pertinentis, the solution of a problem belonging to the geometry of position. It went into the Academy’s journal for 1736, which, the presses of St Petersburg being what they were, came out in 1741.


One small puzzle about the paper itself. The Academy’s records say Euler presented his solution on 26 August 1735, months before the letters of March 1736 in which he still seems to be working it out. Historians have argued about this for decades. The likeliest reading is that the date in the minutes is wrong, and the solution belongs to the spring of 1736.
Part III · The argument
Nine letters, eight places
Before you read how Euler did it, try it yourself. The map below is Königsberg drawn the way Euler lettered it. Pick a piece of land to start on, then tap bridges to cross them. The route is written underneath in his notation, and the tally counts how many times each land appears in it.
Walk the seven bridges
Tap a land, then tap bridgesLand in capitals, bridges in small letters.
Best so far: 0 of 7 bridges. Six is as far as anyone gets.
If you tried for long enough you found that six bridges is easy and seven never happens. The townspeople knew that much. Euler’s first observation was that you cannot settle the matter by trying. Seven bridges can be crossed in thousands of orders, and a proof by listing them all would be tedious, would only work for this one city, and would teach nothing. He wanted a reason.
So he started with notation, which is where a great deal of good mathematics starts. Call the four lands A, B, C, D. A walk can be written down as the list of lands you stand on, in order. Crossing from the Kneiphof to the Lomse is AD; going on to the north bank makes it ADC. He even stopped writing the bridges, because once you know two lands in a row the walk has crossed one of the bridges between them.
The first count
Now count. Each bridge crossed adds one letter, and the walk begins with one letter before any bridge at all. So a route that crosses all seven bridges is written with exactly eight letters. Not seven, not nine. Eight places to fill.
The second count is the clever one. Take a piece of land and ask: how often must its letter appear? Euler looked first at a land with a single bridge. If A had only bridge a, then the walk crosses a once and A appears once, either before the crossing or after it. With three bridges, A must appear twice. With five, three times. In general, a land with an odd number of bridges must appear in the route half of one more than that number: (n + 1) ÷ 2 times. Think of three bridges. Either the walk arrives twice and leaves once, or it starts there, leaves twice and arrives once. Both ways, the letter is written twice.
Then he filled in Königsberg.
Euler’s ledger
From the 1736 paper, set as a table| Land | Bridges | Must appear |
|---|---|---|
| A Kneiphof | 5 | 3 |
| B South bank | 3 | 2 |
| C North bank | 3 | 2 |
| D Lomse | 3 | 2 |
| Letters needed | 9 |
A route over seven bridges has room for eight letters. Königsberg needs nine. That is the entire proof.
The Kneiphof, with five bridges, needs three appearances. The two banks and the Lomse, with three bridges each, need two apiece. Three plus two plus two plus two is nine, and the route only has eight places. A walk that crosses each bridge once would have to be written with more letters than it has. It cannot exist.
Read it again, because it is one of the most beautiful pieces of reasoning in mathematics, and the beauty is in what it leaves out. There is no searching. There is no map of the streets. There is no case where you start on the north bank and the walk goes one way and another case where it goes the other. One count of places, one count of letters, and they disagree. The same argument would kill a walk in any city that had the same pattern of connections, whatever the river looked like.
Not a single distance, not a single angle. Only what touches what.
The idea Euler borrowed from Leibniz: geometria situsPart IV · The rule
Every city, at once
Euler did not stop at Königsberg, and this is what turned a puzzle into a theory. Having found the reason, he asked what it said about any arrangement of islands and bridges, anywhere.
He noticed first that the counts have to add up. Every bridge has two ends, each on a piece of land, so if you go round every land and count its bridges, you count each bridge exactly twice. The total is always even: in Königsberg, 5 + 3 + 3 + 3 = 14, twice the seven bridges. A sum of whole numbers can only be even if the odd ones among them come in pairs. So in any city, however it is built, the number of lands with an odd number of bridges is even: none, two, four, six. Today this is called the handshake lemma, because the same reasoning says that at any party the number of people who have shaken an odd number of hands is even.
Then the rule itself. A land in the middle of a walk is entered and left, entered and left, so it uses its bridges in pairs and needs an even number of them. Only the first land and the last can be odd. Which gives three cases, and Euler stated all three in the closing paragraphs of his paper.
A round trip
Start anywhere. Every bridge can be crossed once and you will end up back where you began.
A walk, with fixed ends
It can be done, but only by starting on one odd land and finishing on the other.
Impossible
No walk crosses every bridge once. Königsberg, with four odd lands, lives here.
The rule reduces the puzzle to a glance. You do not walk anywhere; you count bridges at each piece of land and look for odd numbers. Below is a city you can rebuild. Add bridges, take them away, try the presets, and see what the count says. When a walk exists, the button finds one and draws it in order.
Rebuild the city
Add and remove bridges · Euler’s rule decidesGreen badge: an even number of bridges. Red: odd. Count the red ones and you know the answer before anyone sets out.
To show the rule doing real work, Euler invented a second city with two islands, a branching river and fifteen bridges, the kind of map no one would want to search by hand. He counted the bridges at each land, found exactly two odd ones, and wrote out a route that crosses all fifteen once each, starting at one odd land and ending at the other.
The half he left open
There is a gap in the paper, and it is honest to point it out. Euler proved that more than two odd lands make the walk impossible. For the other direction, that zero or two odd lands are enough to guarantee a walk, he gave only a sketch: remove the doubled bridges, he suggested, and a route can easily be found for the rest. Plausible, and true, but not proved.
The proof came from a young German mathematician named Carl Hierholzer, who worked out an elegant method: start walking, and whenever you get back to a place with unused bridges, splice in a detour that uses them. Hierholzer died in 1871 at the age of thirty, before he could publish it. His colleague Christian Wiener wrote it up, and it appeared in 1873. The Walk it button in the city above runs his method.
Part V · The picture
The drawing Euler never made
Every textbook that tells this story shows the same picture: four dots and seven curved lines, the Kneiphof with five lines coming out of it. It is the most famous graph in the world. Euler did not draw it.
Look again at his Figure 1. It is a map, with a river and lettered banks. His whole argument runs on letters written in a row. The step that seems so obvious now, shrinking each piece of land to a point and each bridge to a line, came much later, and that is worth noticing, because the picture makes the idea look simpler than it was. Euler threw away the geometry in his head. The diagram that does it on paper needed another century and a half.
01The city
Four pieces of land, seven bridges. Streets, distances and the shape of the island are all here.
02Shrink the land
None of that detail changes the answer, so each land becomes a single point and each bridge a line.
03A graph
Four dots and seven lines. The yellow number is how many lines meet at each dot. All four are odd.
The pieces arrived slowly. In 1847 Johann Benedict Listing, a student of Gauss, published the first book with the word topology in its title, and spent part of it on figures that can be drawn without lifting the pen. In 1878 the English mathematician James Joseph Sylvester, writing about chemistry in Nature, used the word graph for a diagram of points and connections. The dot-and-line drawing of Königsberg seems to appear first in the 1892 edition of W. W. Rouse Ball’s Mathematical Recreations, a book of puzzles.
And in 1936, exactly two hundred years after Euler’s letters, the Hungarian mathematician Dénes Kőnig published Theorie der endlichen und unendlichen Graphen, the first textbook of graph theory. Its opening pages go back to Königsberg. By then the subject had found its own famous problems, among them the question of whether four colours are enough for any map, which would not be settled until 1976.
Without lifting the pencil
You have almost certainly met Euler’s rule without knowing it. Children everywhere are given drawings and told to trace them in one line, without going over any line twice. Every one of those puzzles is a Königsberg in disguise: the corners are the lands, the lines are the bridges, and the answer is in the odd corners. Count them before you start, and you know not only whether it can be done, but where you have to put your pencil down.
Three drawings, one rule
The number at each corner is how many lines meet there · red is oddThe house
German children know it as das Haus vom Nikolaus. Two corners are odd, the bottom two, so it can be drawn in one stroke if you start at one of them.
2 odd · start at the bottomThe closed envelope
Take the roof away and it looks simpler, yet it is now impossible. All four corners meet three lines. It is Königsberg in disguise.
4 odd · cannot be doneThe star in a circle
Every point meets four lines. No odd points at all, so you can start anywhere and finish exactly where you began.
0 odd · a round tripHere is a strange thing about the first two. The closed envelope looks like the easier drawing, with fewer lines and no roof. It is the impossible one. Adding lines can help, as long as they turn odd corners even, and this is exactly the trick in the Add an eighth bridge preset above: one new bridge between the two banks of Königsberg would have made the walk possible.
Part VI · The city after
What the war left standing
The Königsberg that Euler reasoned about lasted another two centuries. It was the city where Christian Goldbach, Euler’s most faithful correspondent, was born; where Immanuel Kant lived his whole life and took his famously punctual walks; where David Hilbert grew up, and where in 1930 he ended a radio address with the line that sums up his entire programme: we must know, we will know.

Then the city was destroyed. Two British air raids at the end of August 1944 burned out the medieval centre, the Kneiphof most of all. In April 1945 the Red Army took the city after a long siege. At Potsdam it was given to the Soviet Union, and in 1946 it was renamed Kaliningrad, after the Soviet official Mikhail Kalinin. The German population was expelled by 1948.
The Kneiphof was never rebuilt. The island that had been the richest quarter of the city became a park, empty except for the shell of the cathedral, which stood as a ruin for decades and was restored in the 1990s. Kant’s tomb is on its north side. Today the island is called Kant Island.


Of Euler’s seven bridges, two did not survive the bombing. Two more were later cleared away for a broad Soviet road bridge that now crosses the island from bank to bank. The High Bridge between the south bank and the Lomse had already been replaced by a new one in the 1930s. Only two remain as they were: the Wooden Bridge from the north bank to the Lomse, and the Honey Bridge from the Kneiphof to the Lomse, the one bridge on the island that came through the war.


Here is the twist that every visiting mathematician eventually works out. Count the bridges again. The two islands now have three each, and the two banks have two each. Two odd lands: the walk the citizens of Königsberg wanted for two hundred years is now possible. It has to start on one island and end on the other, which is the sort of detail Euler would have enjoyed. Try the Kaliningrad today preset in the city above and the button will walk it for you.
Part VII · Everywhere
Every bridge, everywhere
Once the land has become dots and the bridges lines, the river is no longer needed. A dot can be a street corner, a city, an atom, a web page, a person. A line can be a road, a cable, a chemical bond, a friendship. The question Euler asked, can you use every connection exactly once, turns out to be one that people who plan routes ask every day.
In 1962 the Chinese mathematician Mei-Ko Kwan asked it for a postman. A postman must walk every street on his round, at least once; if his streets form a network with odd corners, some streets have to be walked twice. Which ones, so that the extra walking is as short as possible? This is the Chinese postman problem, and it is solved by pairing up the odd corners as cheaply as possible, which is Euler’s count used as a tool. The same calculation plans the routes of snowploughs, street sweepers, rubbish lorries and road-inspection vans.
The strangest descendant is in biology. Machines that read DNA cannot read a whole genome in one go; they produce millions of short overlapping fragments. Putting them back together looks like a hopeless search. In 2001 Pavel Pevzner and his colleagues showed that if you build the right graph from the fragments, so that each fragment is a line rather than a dot, reassembling the genome becomes finding a walk that uses every line once. An Euler path. Much of modern genome assembly runs on a version of the Königsberg argument.
The neighbour that stayed hard
Change the question by a single word and everything breaks. Euler asked for a walk that crosses every bridge once. Ask instead for a walk that visits every land once, and no simple count will tell you whether it exists. That second question was made famous by the Irish mathematician William Rowan Hamilton, who invented a puzzle game built on it in 1857, and it grew into the travelling salesman problem. For Euler’s question a computer answers instantly, however large the network. For Hamilton’s, no fast method is known, and finding one, or proving there is none, is one of the great open problems in mathematics.
Euler was a devout man who led his household in prayer every evening and wrote a whole pamphlet defending divine revelation, and it is tempting to read something of that into his paper. He looked at a muddle of water, stone and streets and saw underneath it a structure as simple as a row of letters, a structure that had been there all along, waiting to be noticed. The citizens of Königsberg had walked over it every Sunday. It took someone who had never set foot in their city to see what they were walking on.
For more on the man, read our long portrait of Leonhard Euler. For where the bridges sit in the wider story, from clay tablets to computers, see the history of mathematics. And for another shape that only cares about what is connected to what, try the Möbius strip.
Part ✦ · Chronology
From a castle to a theory
Questions people ask about the bridges
What is the Seven Bridges of Königsberg problem?
Königsberg, a Prussian city on the river Pregel, was built on four pieces of land joined by seven bridges. The puzzle asked whether someone could take a walk that crosses every bridge exactly once. Leonhard Euler answered it in 1736: no such walk exists.
Why is the Königsberg bridge problem impossible?
Every time a walker passes through a piece of land they use two bridges, one in and one out, so every land except the start and the finish must touch an even number of bridges. In Königsberg all four lands touch an odd number (5, 3, 3 and 3). A walk can tolerate at most two odd lands, so it cannot be done.
Who solved the Seven Bridges of Königsberg and when?
Leonhard Euler, then a young professor at the St Petersburg Academy of Sciences. His paper, Solutio problematis ad geometriam situs pertinentis, is dated 1736 and was printed in the Academy's Commentarii in 1741. The Academy's minutes record a presentation on 26 August 1735, a date some historians think is a misprint.
Did Euler invent graph theory with the Königsberg bridges?
His paper is counted as the first in graph theory, but Euler never drew a graph. He reasoned with letters and a map. The word graph came from James Joseph Sylvester in 1878, the familiar dot-and-line drawing of Königsberg appeared in the 1890s, and the first textbook, by Dénes Kőnig, was published in 1936.
Do the seven bridges of Königsberg still exist?
Not all of them. Königsberg was heavily damaged in 1944 and 1945 and became Kaliningrad, Russia. Two bridges were lost in the war, two were replaced by a modern road bridge, and the Honey Bridge and the Wooden Bridge still stand. With today's five bridges a walk over every bridge is possible, starting on one island and ending on the other.
What is an Euler path?
An Euler path is a route through a network that uses every connection exactly once. It exists when the network is connected and has zero or two points where an odd number of connections meet. With zero odd points the route can end where it started, which is called an Euler circuit.
Sources
- Leonhard Euler, “Solutio problematis ad geometriam situs pertinentis,” Commentarii academiae scientiarum Petropolitanae 8 (1736, printed 1741), 128–140. Eneström index E53, at the Euler Archive.
- Horst Sachs, Michael Stiebitz and Robin J. Wilson, “An Historical Note: Euler’s Königsberg Letters,” Journal of Graph Theory 12 (1988), 133–139.
- Brian Hopkins and Robin J. Wilson, “The Truth about Königsberg,” The College Mathematics Journal 35 (2004), 198–207.
- Norman L. Biggs, E. Keith Lloyd and Robin J. Wilson, Graph Theory 1736–1936, Oxford University Press, 1976.
- Carl Hierholzer, “Ueber die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren,” Mathematische Annalen 6 (1873), 30–32.
- Seven Bridges of Königsberg, Wikipedia, for the fate of the individual bridges.
- Images: Braun and Hogenberg, Civitates Orbis Terrarum III (1581), Bibliothèque nationale de France; Krämerbrücke, public domain; modern photographs from Wikimedia Commons under the licences named in their captions.






