Crowd Evacuation
Simulate a crowd leaving a room with Helbing's social force model, including the faster-is-slower effect.
- Wall
- Exit
Each person heads for an exit while keeping distance from others and from walls; raise Panic and the doorway jams (the faster-is-slower effect). Drag with Wall, Exit or Erase to change the room, or click with Pillar to place one; the route map updates when you release, and Rerun keeps the room. People adds six people where you click, an event in time that Rerun and share links leave out.
How is Crowd Evacuation working for you?
About Crowd Evacuation
Crowd Evacuation simulates people leaving a room with the social force model of Dirk Helbing and colleagues. Each person is a small disc that steers toward the nearest exit, following a route map that goes around walls and obstacles, while invisible 'social forces' keep a comfortable distance from other people and from walls. When the crowd gets dense, bodies press against each other: the model adds physical pushing and sliding friction, so you can see pressure build up in the colors.
The model reproduces observed crowd effects. Helbing, Illés Farkas and Tamás Vicsek showed in Nature in 2000 that when people try to move faster in a panic, they jam into arches across the doorway and the whole room empties more slowly — 'faster is slower'. They also found that a column placed slightly off-center in front of an exit can absorb pressure and break up those arches, letting people out sooner, which you can test with the pillar layout.
Pick a layout with one door, two doors, a corridor bottleneck, a pillar in front of the exit or a hall with obstacles, set the number of people, their calm walking speed and the panic level, and watch the evacuation curve and timer. Draw walls, pillars and exits, add people anywhere, compare recent runs, and export a PNG, video or GIF.
How to use Crowd Evacuation
- Pick a layout. Choose One door, Two doors, Corridor bottleneck, Pillar in front of the exit or Hall with obstacles, and set how many people start in the room.
- Set the behavior. Panic raises everyone's desired speed and makes their steering more erratic. Calm walking speed sets the normal pace. Detour when stuck lets a person who has gained no ground for 2 seconds try another way. Route choice sends everyone to the Nearest exit or to the Least crowded exit, the one with the shortest expected wait. Speed sets how many seconds of the evacuation pass in each second, 2× real time by default.
- Watch the evacuation. The timer and Still inside chart show how fast the room empties; Recent runs lists finished evacuations so you can compare layouts and panic levels.
- Look for jams. Color by Pressure turns people red where the crowd crushes together, usually in an arch around the door. Color by Speed shows who is moving.
- Redesign the room. Use Wall, Pillar, Exit and Erase to draw a floor plan (the route map updates when you release), or People to add six people where you click, an event in time that Rerun and share links leave out. Floor that no route reaches is shaded and named in the legend. Show route map shades every spot by its walking distance to the nearest exit. Rerun starts the same people again from t = 0 in the room as drawn; Restart clears your drawing and starts the layout again; Reset also returns every setting to its default.
- Export. Save a PNG or record a video or GIF of the evacuation. Record full run starts the same evacuation again from the beginning and records it until the room is empty, at most 600 GIF frames, so the file is the same on any computer.
Frequently asked questions
What is the social force model?
It treats each pedestrian as a particle driven by forces: a pull toward their desired velocity (heading for the exit at a preferred speed), repulsion from other people and walls that grows quickly at close range, and, when bodies actually touch, physical pushing and sliding friction. Dirk Helbing and Péter Molnár introduced it in 1995, and Helbing, Farkas and Vicsek extended it to panic in 2000.
Why is faster slower?
At a narrow door, people pushing harder squeeze together into an arch that spans the opening. Friction between bodies holds the arch in place until it collapses, then a few people burst through and a new arch forms. The more people push, the more often the door clogs, so the average flow drops. Try the same room at low and high panic and compare the times.
Does a pillar in front of an exit really help?
In social force simulations and in experiments with people and even with animals passing through gates, a well-placed obstacle a little in front of an exit can reduce pressure at the door and break up clogging arches. The effect depends on the size and position of the obstacle and on how hard the crowd pushes, so it is something to test — the pillar layout lets you compare it with the plain door.
How do people find the exit?
The room is divided into a fine grid, and the simulation computes the walking distance from every cell to the nearest exit around walls (a shortest-path search). Each person steers downhill on that distance map, so they route around obstacles and choose the closest door.
What does Detour when stuck do?
Each person's walking distance to the exit is checked every half second. Someone who has gained less than 25 cm in the last 2 seconds counts as stuck; a slow queue that keeps moving does not. For the next 2 seconds that person follows a route map in which crowded spots cost extra, so the quickest way rather than the shortest (as in the pedestrian models of Roger Hughes and Tobias Kretz), and leans to one side. That breaks arches that friction would otherwise hold for good, while the forces between bodies stay the same, so a door at high panic still clogs. Turn it off to see the plain social force model.
How does Least crowded exit choose a door?
Every second each person estimates the time through each exit: the walking time to it plus the number of people ahead of them heading for it, divided by how many people per second that exit has let out. They pick the quickest and only switch for a gain of more than 2 seconds. This is the best-response exit choice studied by Harri Ehtamo and colleagues. In the hall layout it moves people from the narrow door to the wide one, and the readout shows how many left by each exit.
Is this used for real building safety?
Models in this family are used by engineers to study evacuation routes, stadium gates and stairwells, alongside real-world data and fire-safety codes. This tool is an educational simulation, not a substitute for professional safety analysis.
References
- Helbing, D., & Molnár, P. (1995). Social force model for pedestrian dynamics. Physical Review E 51(5), 4282–4286.
- Helbing, D., Farkas, I., & Vicsek, T. (2000). Simulating dynamical features of escape panic. Nature 407, 487–490.
- Hughes, R. L. (2002). A continuum theory for the flow of pedestrians. Transportation Research Part B 36(6), 507–535.
- Ehtamo, H., Heliövaara, S., Korhonen, T., & Hostikka, S. (2010). Game theoretic best-response dynamics for evacuees' exit selection. Advances in Complex Systems 13(1), 113–134.
- Kretz, T. (2009). Pedestrian traffic: on the quickest path. Journal of Statistical Mechanics, P03012.




