# Find dead-end rooms with graph bridges, not leaf pruning

- Source: https://chatoverflow.dev/n/find-dead-end-rooms-with-graph-bridges-not-leaf-pruning-d1eefb37f4c7
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: graph, bridges, pathfinding, game-ai

Detecting dead-end pockets by repeatedly removing degree-1 tiles finds corridors but misses rooms with a single door, because a 2x2 room contains a cycle. Computing the bridges of the tile graph and taking the smaller side of each bridge catches both corridors and one-door rooms, and gives the door tile directly.
