Traffic flow lab

Traffic Jam Simulator

Why do jams appear when there is no accident and no roadwork? Cars on a ring road follow a realistic driver model. When traffic is dense, one small slowdown grows into a stop-and-go wave that travels backward. Tap a car to brake it, change how people drive, and see self-driving cars smooth the flow.

TIME0 s
AVG SPEED0 km/h
FLOW0
STOPPED0

Space-time diagram

position → · time ↓ · red = slow

Click a car on the road to make it brake. Jam waves show as red stripes in the space-time diagram that slant against the traffic. B brake · Space pause · F full screen

How the simulation works
  1. Each car follows the Intelligent Driver Model: it accelerates toward its desired speed and brakes to keep a safe time gap to the car in front, without braking harder than comfortable unless it must.
  2. Human drivers add small random hesitations. Autonomous cars drive without them and keep longer gaps.
  3. When cars are close together, a small slowdown makes the driver behind brake a little more, and the next a little more again. The disturbance grows into a jam that drifts backward while every car keeps moving forward.
  4. Flow = density × average speed: the number of cars passing a point per hour.

Based on the IDM by Treiber, Hennecke and Helbing (2000) and the 2008 ring-road experiment by Sugiyama et al. Everything runs in your browser.

Using Traffic Jam Simulator

Why do traffic jams appear with no accident or bottleneck? Cars on a ring road follow a realistic driver model; one small brake can grow into a stop-and-go wave that travels backward. Change density and driver behaviour, add self-driving cars and measure the flow.

  1. Press Play: cars drive around a ring road. Colours show speed — green fast, red stopped.
  2. Tap a car (or press Brake) to make it slow down for a moment and watch a jam wave form behind it.
  3. Read the space-time diagram: each line is a car; red bands moving backward are jam waves.
  4. Change the number of cars, desired speed, safe time gap, acceleration and how much drivers hesitate in Settings.
  5. Try the examples, including the famous Japanese ring-road experiment and a mix with autonomous cars that damp the waves.

Example

Phantom jam: with 22 cars on a 230 m ring, small random slowdowns grow into a stop-and-go wave — just like the 2008 experiment in Japan.
Autonomous cars: replacing a few drivers with smooth, patient cars can make the waves die out.

Questions & answers

What is a phantom traffic jam?

A jam that appears without an accident or road narrowing. When traffic is dense, one driver braking a little makes the next brake a little harder, and the disturbance grows into a stop-and-go wave.

Why does the jam move backward?

Cars leave the front of the jam while new cars join at the back, so the jam itself moves against the traffic, at about 15–20 km/h in real roads.

Which driver model is used?

The Intelligent Driver Model (IDM): each car accelerates toward its desired speed and brakes to keep a safe time gap to the car ahead, with comfortable limits. Optional randomness models human hesitation.

What is the space-time diagram?

Time runs down, position along the road runs across. Each car leaves a coloured trace; jams appear as red stripes slanting backward.

What is the fundamental diagram?

Flow (cars per minute) against density (cars per km). Flow rises with density until traffic becomes unstable, then falls as jams appear.

Can self-driving cars help?

Experiments show that a few cars driving smoothly with larger gaps can absorb waves. Try the Autonomous cars example.

Does it run on my device only?

Yes. Everything runs in your browser.

Help improve this tool

Report a problem or suggest an improvement

Describe the issue without pasting private tool input. Feedback goes to our admin inbox.

Find another tool · Read practical guides