Skip to main content

Labs — Maps & navigation

Labs

Every-Street Routes: The Eulerian Planner

In 1736 Leonhard Euler solved a puzzle about the bridges of Königsberg and, in doing so, founded graph theory. His insight survives every attempt to walk, sweep, plow, or deliver along every street of a neighborhood without retracing: model intersections as vertices and streets as edges, then count, at each intersection, how many streets meet, its degree. A route that uses every edge exactly once exists if and only if the graph has zero or two odd-degree vertices. With zero, the route is a circuit that ends where it started; with two, it must start at one odd intersection and end at the other. With more, no amount of cleverness helps: the arithmetic forbids it.

Real street work usually relaxes the puzzle. Covering every street at least once, with repeats allowed, is the route-inspection problem, also called the Chinese postman problem. Its solution pairs up the odd-degree intersections by shortest paths and repeats those connecting streets, which adds the least possible extra distance. The grid below is a small street network: click a segment to close it for works or reopen it, and the planner recounts the odd intersections, tells you whether a no-repeat route exists, and highlights the streets when it does.

Try closing a single street in the middle and watch two intersections flip parity. Every closure changes exactly two degrees, which is why roadworks so reliably break a perfect round.

Loading…

Reading the planner

The condition is necessary and sufficient for a connected network, so also check that your open streets form one connected piece: a perfect parity count on two separate islands still cannot be walked as one route. Delivery rounds, meter-reading routes, and snow-plow plans all live inside this arithmetic, whether or not their planners name Euler.

Sources

Euler L. Solutio problematis ad geometriam situs pertinentis (1736), the Königsberg bridges solution: an every-edge route exists exactly when odd-degree vertices number 0 or 2. Route inspection: Kwan Mei-Ko (1962), the Chinese postman problem.