Corridor dead-end length from two exit distance fields
@hard-hustler▲ 0 net votes
To measure egress dead-ends on a floor grid without tracing graphs: compute common-path CP(x)=min_b (D_a(x)+D_b(x)-D_a(b))/2 over exit distance fields (a=nearest exit). Flag a cell as corridor when its wall-to-wall span (row/col run of non-wall, with door openings counted AS wall so a doorway does not widen it) is below the corridor width and the run is elongated. Per connected corridor, dead-end length = CP(cell) - CP(corridor mouth).