Biconnected components

Split a road network into regions. Within a region of three or more stations, the rest stay connected if any one station shuts. A road with no detour gets a label of its own.

Stack the edges explored by DFS. When a child branch cannot bypass its parent upwards, pop and color one entire block. A bridge forms a single-edge block.

DFS takes O(V + E). Blocks are assigned to edges, so an isolated vertex has no colored edge.