MYSIMULATOR.UK
MATHEMATICAL GAMES / A-LEVEL / LAB NO. 027
THE CITY IS YOUR LABORATORY 01 / THE ROUTE-INSPECTION PROBLEM

NIGHT SHIFT

A street-sweeper’s puzzle about odd junctions, shortest paths and the surprising price of coming home.

FIELD NOTE / 001Every street.
As little retracing
as possible.
Move the city. The mathematics moves with you.
YOUR TOOL
LIVE SURVEY / LANTERN QUAYTRACE MODE
Click a junction to start, then click its neighbour to walk a street. Drag any junction to change surveyed distances.
Odd-degree junction Even-degree junction Surveyed street Walked street
ALL STREETS—unique street metres
ODD JUNCTIONS—need parity repair
UNAVOIDABLE RETRACE—minimum extra metres
SHORTEST SWEEP—closed patrol metres
01 / DEGREES & PARITY LIVE

The junction register

Each street contributes one to the degree of both endpoints. Odd junctions must come in pairs.

02 / ALGORITHM REPORT EXACT

Where distance is repeated

The best closed sweep pairs odd junctions through shortest available paths.

03 / DISTANCE INSTRUMENT

Distance ledger

0 m walked
No route traced yet.
THE SCIENCE / GRAPH THEORY

The mathematics behind
the night shift.

LEARNING OBJECTIVE 01

Spot an Eulerian network

Identify degree at every junction. A connected street graph has a closed walk using each street exactly once if and only if all junctions have even degree.

LEARNING OBJECTIVE 02

Calculate a shortest sweep

Add all unique street lengths, then find the cheapest set of repeat journeys that pairs every odd-degree junction. This is the undirected Chinese postman problem.

LEARNING OBJECTIVE 03

Redesign with evidence

Make a prediction about adding a road, drag junctions to change distances, and test whether the optimum total route becomes longer or shorter.

THE FUNDAMENTAL RESULT
Lmin = Σ Lstreets + min Σ d(oi, oj)

For a connected, undirected street network, pair every odd-degree junction exactly once so that the sum of the shortest-path distances between paired junctions is as small as possible. The extra routes are duplicated and an Eulerian circuit is constructed. The exhibit uses Floyd–Warshall shortest paths, exact bitmask dynamic programming and Hierholzer’s algorithm. Surveyed lengths are Euclidean map distances rounded to the nearest metre. Crossings without lettered junctions are not connected; roads are bidirectional, with no slopes, traffic rules or turning penalties. This is a mathematical model, not a navigation service.

BEYOND THE CLASSROOM

The same route-inspection idea underpins planning for street sweepers, snowploughs, postal rounds, road inspection, waste collection and infrastructure maintenance.

Made with 🤖 ChatGPT