Euler paths and circuits – the Seven Bridges of Königsberg

MathematicsSets, Logic & Graph TheoryAges 16–17

Loading…

Share Report a problem

Draw or edit a graph (vertices are land masses, edges are bridges) and instantly see the degree of every vertex, the sum of degrees equal to twice the number of edges, and the verdict from the number of odd vertices: an Euler circuit, an Euler path or neither. Tap edges yourself to try crossing each one exactly once, or let Fleury's algorithm (avoid bridges) or Hierholzer's algorithm (splice circuits) find the route step by step.

Lesson: Euler paths and Euler circuits

What it shows

In 1736 Leonhard Euler asked whether a walk through Königsberg could cross each of its seven bridges exactly once. Turning land masses into vertices and bridges into edges, he showed that the answer depends only on degrees. A connected graph has an Euler circuit when every vertex has even degree, and an Euler path when exactly two vertices have odd degree; the path must start at one odd vertex and end at the other. The simulation allows several edges between the same two vertices but no loops, and the map of Königsberg is simplified.

How to use

Start with Seven Bridges of Königsberg and read the degrees and the verdict. Switch Mode to Trace a route and tap edges to try crossing every bridge once. In Draw / move mode add or join vertices until the verdict changes, then choose Fleury (avoid bridges) or Hierholzer (splice circuits) and press Step or Run to watch a route being built.

Parameters you can change

  • Starting graph Seven Bridges of Königsberg, Envelope (draw without lifting the pen), Two triangles sharing a vertex, Complete graph on 5 vertices (K5), Blank page – draw your own
  • Algorithm Fleury (avoid bridges), Hierholzer (splice circuits)
  • Animation speed 0.5–4 edges/s

Questions to explore

  1. Why is it impossible to cross each of the seven bridges of Königsberg exactly once?
  2. What is the smallest number of bridges you must add to get an Euler path, and where?
  3. Why must an Euler path start at one odd vertex and finish at the other?