Study materials · photonresources.comClasses with our teachers · Photon AcademyFor IB Diploma students worldwide

Maths IA · Modelling · topic 81 of 97

Walk every bridge once: from Königsberg to your city · IB Maths IA idea: guide, sample graph and step-by-step plan

count the degrees first!

In 1736 the people of Königsberg wondered whether anyone could cross all seven of the city's bridges exactly once. Euler showed why not with one idea: count how many roads meet at each place.

Difficulty●●○ Medium
KitA map of your chosen place, pencil and paper, a spreadsheet or Python
TimeAbout 12 to 15 hours
FitsAA SL0 of 3AA HL1 of 3AI SL1 of 3AI HL3 of 3
  • ✓ you like a puzzle that turns out to have a rule
  • ✓ you would rather prove a result than only quote it
  • ✓ you want to apply it to a real place you know

The big idea

Draw each land mass as a dot and each bridge as a line between dots. The question becomes: can you trace the whole drawing without lifting your pen or repeating a line? The answer depends only on the number of lines at each dot, its degree. If every degree is even, a closed walk exists; if exactly two are odd, an open one does. Anything else is impossible. Graph theory is AI HL content, so on AI this fits the course; on AA you would be learning a new topic, though the proofs are the kind AA HL students enjoy. The routine part is the rule. The marks come from proving it, showing that the handshaking lemma forces an even number of odd vertices, building a walk with an algorithm, and testing both on a real map.

Make it yours: pick one twist

Copying a classic won't show your choices. Pick one of these (or invent your own) and your IA becomes yours.

Swipe for more twists →

Prove the degree rule

Show why a trail passing through a vertex uses edges in pairs, and why the start and end are the only places that can be odd.

→ A real proof, not a recipe. Add the converse: if the degrees are right and the graph is connected, a walk exists.
Prove the handshaking lemma

Show that the sum of all degrees is twice the number of edges, so the number of odd vertices is always even.

→ A short counting proof that explains why you never see exactly one or three odd vertices on a map.
Build the walk by algorithm

Write out Fleury's or Hierholzer's method on your graph and say why it never gets stuck.

→ An algorithm you can run by hand, then in code. Compare how many steps each needs as the graph grows.
Model a real place

Turn bridges over a river, park connectors or the paths of a campus into a graph, and decide what counts as a vertex.

→ Modelling choices become part of the maths: two bridges between the same banks give a multigraph, not a simple one.
Repair a map that fails

If your place has more than two odd vertices, find the fewest repeated or new edges that make a walk possible.

→ Pairing up odd vertices links this to the Chinese postman problem and to shortest paths.
Count the walks

On a small graph, count the different Euler circuits, or find how the count changes when one edge is added.

→ Counting rather than existing. Choose a graph small enough to check every walk by hand.

Your Maths IA research question: run the check

what is a vertex here?

Write your own question first. Then make sure it ticks every box:

  • Names the place or map and says what counts as a vertex and what counts as an edge.
  • Says what you will prove or compute: a rule, an algorithm, or the fewest changes to make a walk possible.
  • Is about a graph with a stated number of vertices and edges that you can draw in full.
  • Says how you will check the result, for example by trying every walk on a small case.
  • States what the model leaves out: one-way streets, distances, bridges that no longer exist.
Stuck on your question?Get an RQ Check: each question is scored on 5 points, with what to fix. Your first one is free.
Get an RQ Check

The model

Land masses become dots, bridges become lines, and the degrees decide everything. Draw the graph of your own place and write each degree beside its dot.

NKSEdegree 3degree 5degree 3degree 3every vertex here has an odd degreeCount the odd vertices0 odda closed walk exists:start anywhere (circuit)2 oddan open walk exists:from one odd vertex to the other4 or moreno walk crosses everyedge exactly onceKonigsberg: 4 odd verticessum of degrees = 2 × (number of edges)

How your Maths IA could be laid out

The usual order for a topic like this, what each part needs to show, and roughly how much of your 12 to 20 pages it takes. The words are all yours.

Aim and context~1 page
Why this place or puzzle, what you expect before any theory, and what a walk means here.
From map to graph~1.5 pages
Vertices, edges and degrees defined and drawn, with every modelling choice explained.
The degree rule~3 pages
The handshaking lemma and Euler's condition, each with a proof you can follow line by line.
Building a walk~2 pages
Your chosen algorithm worked through on a small graph, then on your real one.
When the map fails~2 pages
The odd vertices, the fewest edges to repeat or add, and how you know it is the fewest.
Check against the real place~1 page
Your walk traced on an actual map, or an attempt to find a counterexample by brute force.
Conclusion~1 page
Back to your aim: what the degrees say about your place, with the numbers.
Evaluation~2 pages, the biggest part!
What the graph ignored (distance, direction, closures), and whether a walker would care.
Bibliographynot counted
Where the map, the theorem and the algorithm came from.

What your Maths IA graph could look like

whole numbers: plot dots

Made-up values to show the form of a strong graph: the number of different bridges and the number of odd vertices as a place gains one extra bridge at a time. Yours will look different. example only

02468101201234567Odd vertices in the place (count)Fewest extra bridges for a circuit (count)odd vertices / 2your places (made-up)pairing the odd vertices:state when this is exactILLUSTRATIVE · MADE-UP DATA
  • A count against a count, so the points are whole numbers and the axes say what is counted.
  • A line is a claim: say whether the fewest extra bridges is exactly half the odd vertices, and prove or test it.
  • Extra edges between nearby odd vertices can need more than one new bridge each. Say which case your graph is.
  • Plot each place you tested as a point so the reader can see the pattern is not one lucky example.

The maths in action

worked through, not sketched!

The graph above was a sketch with made-up numbers. This figure works the idea through from the model itself, so you can see what a finished figure looks like. The source line under it says where every number comes from.

Left: a river map with a north bank, a south bank, an island and an east land joined by seven bridges. Right: a graph with four vertices and seven edges whose degrees are labelled 3, 3, 5 and 3.
(a) A schematic of the seven bridges of Königsberg. (b) The same map as a graph: the four land masses have degrees 3, 3, 3 and 5, all odd, so no walk crosses every bridge exactly once.Source: Redrawn schematically from Euler's 1736 problem; degrees computed from the edge list.

Your game plan

Tick steps off as you go. We'll remember on this device.

0 of 10 done

  1. Read and predictRead how Euler argued about Königsberg. Before any theory, guess which simple graphs you can trace without lifting the pen.
  2. Choose the placePick bridges, park paths or a campus map that you can draw in full with 5 to 12 vertices, and say why that place.
  3. Draw the graphMark vertices and edges, count every degree and write the degrees on the drawing. Decide how to treat double edges.
  4. Trial run (1 lesson)Try to trace three small graphs by hand and note the degrees of each. Write what you see before you look up the theorem.
  5. Prove the ruleProve the handshaking lemma, then why a trail needs at most two odd vertices. HL: give the converse as well.
  6. Build a walkRun Fleury's or Hierholzer's method on your graph and show each step. Say what goes wrong if you ignore the rule.
  7. Fix a failing mapIf your place has too many odd vertices, find the fewest edges to repeat or add, and justify that it is the fewest.
  8. Go further, with a reasonCount the walks, or compare two places, or add distances. Choose the one that helps answer your aim.
  9. Reflect as you goAfter every result write one line on what it means for a real walker and what it ignores. These lines become your evaluation.
  10. Cut, check, then sendCheck every graph is drawn and labelled, every symbol is defined once and the conclusion answers your aim. Then send your teacher one draft.

The maths you'll use

  • Degrees and the handshaking lemma – Show that , so the number of odd-degree vertices is even.
  • Euler's condition – Prove that a connected graph has an Euler circuit if and only if every degree is even, and an Euler trail if exactly two are odd.
  • Algorithm – Run Fleury's or Hierholzer's method by hand on a small graph and in code on a larger one.
  • Pairing odd vertices – Add the cheapest set of edges so that all degrees become even, a first step towards the Chinese postman problem.
  • Proof by induction or contradiction – Prove that a trail leaves a vertex as often as it enters, or that a longest trail must be closed.

Key equations

Syllabus links

  • 1.15Proof by induction, contradiction and counterexampleHL
  • 1.6Simple deductive proof

Read up first

Data and sources to start from

Take a map of a real place (bridges, park paths or a campus) from an online map service, build the graph by hand and count the degrees.

References to cite

  1. Euler, L. (1741). Solutio problematis ad geometriam situs pertinentis. Commentarii Academiae Scientiarum Imperialis Petropolitanae, 8.
  2. Biggs, N. L., Lloyd, E. K., & Wilson, R. J. (1986). Graph theory 1736 to 1936 (2nd ed.). Clarendon Press.
  3. Wilson, R. J. (2010). Introduction to graph theory (5th ed.). Pearson.

Cite what you actually use, in your own format, and say where each number came from.

Traps to avoid in this Maths IA

double bridges count twice
  • Treating a double bridge as one edge. Two bridges between the same two banks add 2 to each degree, not 1.
  • Forgetting that the graph must also be connected. Even degrees alone are not enough if part of the map is cut off.
  • Counting the degree of a loop as 1. A loop adds 2 to the degree of its vertex.
  • Quoting Euler's rule without proving it, or proving only one direction of it.
  • Calling a circuit and a trail the same thing. A circuit must return to the start; a trail need not.
  • Choosing a place with so many vertices that you cannot check the result by hand.

More Maths IA ideas like this

Make sure it's yours

This guide shows how a topic like this is usually approached. It is not an IA. Your question, choices, data, analysis and words must be your own: change something, tell your teacher where the idea came from, and follow your school's rules on outside help.

Get your RQ checked · first one free