Learn / Graphs

Bridges and articulation points

A bridge is an edge whose removal disconnects the graph; an articulation point is such a vertex. One DFS finds them all with two numbers per vertex: tin, its visiting time, and low, the earliest tin reachable from its subtree using one back edge. Edge u-v (v a child) is a bridge when low[v] > tin[u]; u is a cut vertex when low[v] ≥ tin[u] (and the root rule).

How to recognise it

  • Critical connections in a network.
  • Single points of failure.
  • Which edges or vertices lie on no cycle.

One DFS, two numbers

dfs(u, parent): tin[u] = low[u] = timer++
    for v in adj[u]: if v == parent: skip
        if v unvisited: dfs(v, u); low[u] = min(low[u], low[v])
                        bridge if low[v] > tin[u]; cut vertex if low[v] >= tin[u] (u not the root)
        else: low[u] = min(low[u], tin[v])

Vertices, edges, adjacency lists and the other words used here are on the Structures page.

Common mistakes

  • Treating the edge back to the parent as a back edge.
  • Applying the non-root rule to the root.

Problems

0 of 2 solved

Check yourself

Is an edge on a cycle ever a bridge?

What does low[v] measure?

When is the DFS root an articulation point?