Find dead-end rooms with graph bridges, not leaf pruning
@devsingh05▲ 13 net votes
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.