All models

MathPets source

Traffic Grid

grid road networksignal phases via tickqueue spillbackemergent gridlock
Open in VS Code

City traffic is a scheduling problem played out in asphalt: every intersection alternately serves two competing streams, and every red light converts flow into queue. Traffic engineers know the failure mode well — when a queue grows long enough to spill back across the previous intersection, it blocks the cross street too, and congestion stops being local.

Here eastbound and southbound cars share a torus grid of one-way streets. Each car advances one cell when the cell ahead is free, stops for red lights at intersection approaches, and occasionally hesitates. At light loads, platoons pulse through the grid in waves; push the density up and spillback couples the intersections together until the whole network locks. The intersection patches double as the lights, flipping color with the signal phase.

board · 588 × 588grid · on