HomeArticlesTraffic Flow

Traffic Flow: The Nagel-Schreckenberg Model and Phantom Jams

Four rules per car on a cellular automaton reproduce real highway traffic — including jams that form and travel backward for no reason at all.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

A highway as a row of cells

The Nagel-Schreckenberg model (1992) is a cellular automaton: the road is a line of discrete cells, each either empty or holding one car with an integer speed from 0 up to a maximum vmax. Every simulated second, every car updates its speed and position using four simple rules applied in order, all in parallel across the whole road:

1. Acceleration:   if v < vmax, then v = v + 1
2. Braking:        if the gap ahead is g cells, then v = min(v, g)
3. Randomization:  with probability p, v = max(v - 1, 0)
4. Movement:       move each car forward v cells

Rule 2 is the only rule that looks at another car — it is a hard collision-avoidance clamp, not a smooth following model. Rule 3, the randomization, is the whole point of the model: without it traffic flows in perfectly stable, evenly-spaced lines forever. A single random slow-down is what breaks that symmetry.

live demo · a Nagel-Schreckenberg cellular automaton on a ring road● LIVE

Phantom jams: a wave with no cause

Run the automaton at moderate density and, without any accident, lane closure or intersection, a dense cluster of slow-moving cars spontaneously forms and propagates backward through the traffic even though every car is moving forward. This is the phantom traffic jam, and it is not a simulation artefact — it has been reproduced on a real closed test track with human drivers (the 2008 Sugiyama experiment), where a ring of cars asked to maintain even spacing spontaneously collapsed into a backward-travelling stop-and-go wave. One random slow-down (rule 3) forces the car behind to brake, which forces the next car back to brake harder to keep the safety gap, and the disturbance amplifies as it propagates upstream — a wave that outlives its original cause.

The fundamental diagram

Plot flow (cars passing a point per second) against density (cars per cell) and you get the fundamental diagram of traffic: flow rises roughly linearly at low density, peaks at a critical density, then falls as density keeps increasing and cars spend more time braking than moving. The Nagel-Schreckenberg model reproduces this curve closely, including the fact that the falling branch is noisy and jam-prone while the rising branch is smooth — exactly the asymmetry seen in real freeway loop-detector data.

Slow-start and the second bottleneck

A refinement called slow-to-start adds a rule: a car that is currently stopped needs an extra tick of hesitation before it accelerates again, mimicking real driver reaction time pulling away from a queue. This single addition reproduces a second real effect — the discharge rate out of a jam is measurably lower than the maximum flow the road could otherwise sustain, so once a jam forms it clears more slowly than it formed. It is why sitting in stop-and-go traffic feels asymmetric: the jam grows fast and drains slow.

Why a single slow driver matters more than you'd think

Because rule 2 only lets a car go as fast as the gap in front allows, a single car with a permanently lower vmax (or one that brakes needlessly often) does not just slow itself down — it seeds a jam that other, faster-capable cars pile up behind, throttling the effective throughput of the whole lane to that one car's pace. In multi-lane extensions of the model, lane-changing rules exist precisely to let faster traffic route around such a bottleneck, which is also why real-world "keep right except to pass" rules measurably improve highway throughput.

Frequently asked questions

What causes a traffic jam with no accident or obstruction?

A single random brake tap by one driver forces the car behind to slow down more to keep a safe gap, and that overcorrection propagates backward through the line of cars, amplifying into a slow-moving cluster — a phantom jam. It has been reproduced both in the Nagel-Schreckenberg cellular automaton and on a real closed test track with human drivers.

Why does the jam travel backward even though all the cars move forward?

The cars themselves move forward, but the pattern of congestion — the location where cars are currently braking — propagates upstream, because each new car reaching the back of the cluster is the one that has to brake next. The wave is a pattern in the traffic, not a group of specific cars.

What is the one parameter that turns free flow into a traffic jam?

Density. Below a critical density cars have enough headway that a random slow-down gets absorbed; above it, the same random slow-down cascades into a growing jam. This threshold is exactly the peak of the fundamental flow-versus-density diagram that the model reproduces.

Try it live

Everything above runs in your browser — open Traffic and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Traffic simulation

What did you find?

Add reproduction steps (optional)