Egress Route Simulator
A graph-based simulation of escape paths through randomly generated architectural floor plans. Click any room to see the shortest route to the nearest exit, computed in real time with Dijkstra's algorithm on a grid representation of the plan.
Shape
How it works
- Generate a plan: corridor rectangles are laid out for the chosen shape, then rooms are lined along each corridor side, each with a door.
- Rasterize to an 80×60 grid where every cell is either walkable (rooms, corridors, doors, exits) or wall.
- Solve once: multi-source Dijkstra is run from every exit simultaneously, recording for every walkable cell its distance to the nearest exit and the next step along the shortest path.
- Click a room: the path is read out by following those next-step pointers from the clicked cell back to an exit. No recomputation is needed per click.
Diagonal moves cost √2 and cannot cut through wall corners. Press H to view the full egress field as a heatmap.