Control Systems · stability

Traffic Jam Simulator

Put cars on a circular road with no junctions, no lights and nothing in the way. Pack them tightly enough — or make them slow enough to react — and a jam appears anyway, with nothing causing it.
IDM car-following
22 cars · 230 m ring

Scenario

stopped
Nothing needs to go wrong for a jam to form. Press Run and wait — or use Tap the brakes to have one driver dab the pedal once, and watch what that one dab does two minutes later.

Road & traffic

Cars22
Ring length230 m
Target speed30 km/h

Drivers

Reaction time 0.60 s
Preferred gap, in seconds1.20 s
Driver-to-driver variation10%
Reaction time and preferred gap are different things, and the difference is the whole story — see the notes below.

Vehicle performance

Acceleration1.0 m/s²
Comfortable braking1.5 m/s²
Vehicle length4.5 m

The road

as fast as the road allows slowed crawling or stopped

Every car, every second

moving freely slowed jammed

Speed over time

fastest average slowest

The numbers

The rule

A stop-and-go wave crawls backwards at about 15 to 20 km/h

Whatever the traffic is doing, the jam itself moves backwards along the road at a remarkably consistent speed. The cars go forwards; the jam goes the other way, and it does so at roughly walking-pace-times-ten no matter how fast the free-flowing traffic is.

It falls straight out of two numbers. Cars sitting in a queue are packed about one vehicle length plus a small gap apart — call it 7 m. When the queue starts moving, each driver pulls away roughly one headway after the car in front — call it 1.5 s. The back of the jam therefore eats into the queue at 7 m every 1.5 s:

wave speed = (vehicle length + jam gap) ÷ start-up headway = 7 ÷ 1.5 ≈ 4.7 m/s ≈ 17 km/h, backwards.

Nothing in that depends on the speed limit, the weather or how many cars are queued. It is a property of how tightly cars pack and how quickly people react, which is why the number turns up again and again on real motorways.

Where it goes wrong

It scales with what is in the queue. A jam full of lorries has a much longer packing distance, so its wave runs faster backwards. Tailgating drivers with a short start-up headway also speed the wave up, which is the opposite of the intuition that impatient driving clears a jam.

And it only describes the back of a jam that is already there. It says nothing about whether a jam will form in the first place — that is a stability question, and it is what the simulator above is actually for.

The thing everyone conflates

Reaction time and following distance are not the same control

Both are measured in seconds and both are about following the car in front, so they get muddled constantly. They do opposite things.

Preferred gap is where you choose to sit: the steady-state distance you leave, expressed as the time it would take to cover it. It sets how much road the traffic uses, and therefore how many cars fit before the road is full.

Reaction time is delay in the feedback loop: how long after the car in front changes speed before you do anything about it. It does not change where you sit in steady traffic at all. What it changes is whether steady traffic is stable.

This is the same phenomenon as dead time in a control loop, and it behaves the same way: add enough delay to a feedback loop and a disturbance that used to die away starts to grow instead. A line of cars is a chain of such loops, each one feeding the next.

Density does it too, and independently. Worth being straight about, because it is easy to credit the wrong cause: the 22-car default here is packed tightly enough to collapse even with instantaneous drivers. Reaction time then makes it markedly worse — average speed falls by roughly half again as the delay goes from nothing to 1.4 s — but it is not what tipped it over. For the clean experiment use the Delay alone preset: 16 cars on the same road, stable for as long as you care to run it at a 0.8 s reaction, and jamming when you raise the reaction past about 1.2 s with every other setting untouched.

Which is the uncomfortable finding: the jam is not caused by a bad driver. It is caused by ordinary drivers with ordinary reflexes, and the only thing anyone can do about it is leave a bigger gap.

Field notes

Reading the simulation

Version history · unchanged

No change to this page at all since the earliest archived release (v4.23). The full history for the site is in the changelog.

One lane, no overtaking, no junctions. A single-file ring is the cleanest way to show that jams need no cause — real roads add lane changes, gradients, merges and trucks, all of which make things worse rather than better. See Sources.