How many cars does it take to jam a ring road with no bottleneck? Cars are colored by speed, from red when stopped to yellow-green at 5. At the default 20 cars, clumps of red cars form and drift backward against the traffic.
Try this Lower number-of-cars from 20 to 10 and press Reset (it is read only at setup). Traffic flows almost freely, with average-speed about 4. At 12 cars, jams appear and average-speed falls to about 3.
About this model Where it ends up The run never stops. Jams keep forming, drifting backward and dissolving; at the defaults average-speed fluctuates around 1.6.
Kai Nagel and Michael Schreckenberg's 1992 cellular automaton for freeway traffic, on a one-lane ring of 61 cells. Accelerating toward a speed limit, never outrunning the gap ahead and braking at random now and then are enough for jams to form with no bottleneck or accident.
Setup spaces number-of-cars cars evenly with random speeds from 0 to max-speed. Each tick every car adds 1 to its speed up to max-speed, cuts it to the number of empty cells ahead (looking up to 8 cells, at where the cars stood at the start of the tick, as in the original parallel update), slows by 1 at slowdown-chance percent if moving, and advances that many cells. number-of-cars is read only at setup; max-speed and slowdown-chance take effect live.
NetLogo's Traffic Basic, credited below, uses continuous speeds with acceleration and deceleration rather than these rules.