Traffic as a Complex System
Urban traffic is a classic example of a complex system where individual decisions create emergent collective behavior. Each driver independently chooses a route to minimize their own travel time, yet these selfish decisions interact to produce system-wide patterns — congestion waves, spontaneous gridlock, and the paradoxical result that adding roads can make traffic worse. Understanding these dynamics requires modeling traffic as a flow system governed by fluid-like equations.
The Fundamental Diagram
Traffic engineers describe road behavior using the fundamental diagram, which plots the relationship between density (vehicles per km), flow (vehicles per hour), and speed. At low density, cars travel at free-flow speed and flow increases linearly with density. At critical density, flow reaches maximum capacity. Beyond this point, the system enters the congested regime where adding more vehicles actually decreases both speed and throughput — the counterintuitive phenomenon every commuter experiences during rush hour.
Signal Timing and Network Coordination
Traffic signals are the primary control mechanism for urban road networks. The signal cycle length, green split ratios, and coordination between adjacent intersections dramatically affect network performance. This simulation models fixed-time signals where you can adjust the cycle length. Shorter cycles reduce waiting time at light traffic but may not clear queues during heavy traffic. The optimal cycle length depends on the volume-to-capacity ratio of the intersection approaches.
From Congestion to Gridlock
Congestion and gridlock are qualitatively different phenomena. Congestion is a gradual increase in travel time as density rises — annoying but functional. Gridlock is a phase transition: a catastrophic state where intersecting queues block each other in a deadlock. The transition is sudden and hysteretic — once gridlock sets in, traffic must drop well below the triggering level before flow recovers. Watch how increasing vehicle count past the critical threshold causes the gridlock percentage to spike nonlinearly.