The route-inspection problem
A connected undirected graph has a closed route using every edge exactly once only when every vertex has even degree. Real street networks often have odd-degree junctions.
ROAD LENGTHwe = s · de · ae
MINIMUM ODD-VERTEX PAIRINGC* = minM Σ d(u,v)
OPTIMAL CLOSED TOURL* = Σ we + C*
ESTIMATED TIMET = L* / v + Nturn · τ
How the solver works
The model first finds shortest paths between every pair of junctions. It then finds a minimum-weight perfect matching of the odd-degree junctions. Each matched shortest path is added as a repeated traversal, making every degree even. Hierholzer's algorithm then constructs an Euler circuit.
All-pairs shortest paths use Floyd–Warshall. A bit-mask dynamic programme solves the matching problem, and a separate exhaustive pairing search checks its result. The route is built from an explicit multigraph, not from a visual approximation.
What is simplified
- Roads are undirected and have fixed positive lengths; traffic, one-way streets, parking, weather and changing service demand are omitted.
- The sweeper travels at one average speed. Turn delay is a simple illustrative allowance, not a vehicle dynamics model.
- Street geometry is schematic. Distances, speeds and turn delays are illustrative inputs, not surveyed data.
- The exact Chinese Postman solution applies to a connected undirected network. A disconnected network has no single closed route covering every component.
Evidence labels: “Textbook” marks mathematical identities and algorithmic checks. “Illustrative” marks the invented street map, dimensions and operating assumptions. The preview animation is time-scaled and is not a real travel-time playback.