The Nagel-Schreckenberg cellular automaton for highway traffic. Watch phantom jams emerge spontaneously from random braking, even with no bottleneck. The space-time diagram reveals backward-moving jam waves.
Four simple rules per time step — acceleration, speed limiting, random braking (with probability p), and motion — are sufficient to produce realistic traffic phenomena including phantom jams, stop-and-go waves, and a fundamental diagram matching real highway data.
Adjust vehicle density (0–100%) and braking probability (0–1). At a critical density (~30%), phantom jams appear as backward-moving waves. The space-time diagram shows jam trajectories — diagonal lines moving upstream.
Phantom traffic jams — where everyone brakes for no apparent reason — are caused by exactly the mechanism in this model: small random perturbations amplify in dense traffic. Japanese researchers reproduced this on a circular test track in 2008.
This simulation implements the Nagel-Schreckenberg cellular automaton, a foundational model of single-lane highway traffic. The road is a closed ring of 200 discrete cells; each cell holds at most one car whose integer speed runs from 0 to v_max. Every time step applies four rules — accelerate, brake to avoid collision, randomly decelerate with probability p, then advance — to every vehicle in parallel. From these minimal rules, phantom jams and stop-and-go waves emerge spontaneously, with no accident or bottleneck required.
A discrete cellular automaton on a 200-cell loop. Each step: a car accelerates by one (capped at v_max), brakes to the gap ahead so it never overtakes, decelerates by one with probability p_brake, then moves forward by its new speed. The live metrics show density ρ, flow q = ρ·v̄, and mean speed v̄, while the space-time diagram traces each car's position over the last 80 steps.
The Density slider (5–75%) sets how many of the 200 cells start occupied; v_max (1–5) caps the top speed; p_brake (0–0.5) is the random deceleration probability that seeds jams. Use Pause to freeze the animation and Reset to re-seed cars with the current settings. Watch the lower panel for diagonal red bands.
In 2008 Japanese researchers had drivers circle a closed track at constant spacing; a jam still formed and drifted backwards, confirming that congestion can arise from random braking alone — exactly the mechanism this 1992 model captures.
It is a cellular automaton for traffic flow introduced by Kai Nagel and Michael Schreckenberg in 1992. The road is divided into discrete cells, time advances in steps, and every car updates its speed by the same four rules. Despite its simplicity it reproduces realistic features such as the fundamental diagram and spontaneous jams.
The third update rule makes each car decelerate at random with probability p_brake. In dense traffic, one car braking forces the car behind to brake, which forces the next, and so on. This perturbation amplifies into a cluster of slow cars even though the road is clear ahead, which is exactly a phantom jam.
Density sets the fraction of the 200 cells that begin occupied, so it controls how crowded the ring is. v_max caps the maximum integer speed any car may reach. p_brake is the probability that a moving car spontaneously slows by one cell each step; raising it makes jams form at lower densities.
The diagram plots position horizontally and recent time vertically. A jam is a region where cars are stopped, but the cars themselves keep inching forward and out of the back of it while new cars pile in at the front. The jam structure therefore travels upstream, opposite to traffic, producing the backward-leaning diagonal red bands.
It is a deliberately minimal model, so it omits lanes, vehicle types and driver variation. Even so, its fundamental diagram of flow versus density, and its spontaneous stop-and-go waves, match measurements from real motorways and from controlled track experiments. It is widely used in transport research as a realistic yet tractable baseline.