Data Structures · Visualization

Graph: Articulation Points & Bridges

Graph

An articulation point (cut vertex) is a vertex whose removal disconnects the graph; a bridge is an edge whose removal does the same. Time: O(V + E). Space: O(V) for discovery/low-link arrays plus O(V) recursion stack.

Big-O: BFS/DFS visit each vertex and edge once: O(V + E).

Graph: Articulation Points & Bridges

Graph

An articulation point (cut vertex) is a vertex whose removal disconnects the graph; a bridge is an edge whose removal does the same. Both are found in one DFS pass by tracking each vertex's discovery time and the lowest discovery time reachable via back edges ('low-link value').

How Articulation Points & Bridges Works

  1. Run DFS, recording each vertex's discovery time and initializing its low-link value to the same.
  2. For each DFS tree edge (u→v), after recursing into v, update low[u] = min(low[u], low[v]).
  3. For each back edge (u→w, w already visited and not u's parent), update low[u] = min(low[u], disc[w]).
  4. An edge (u→v) is a bridge if low[v] > disc[u] (v's subtree has no back edge to u or above).
  5. A non-root vertex u is an articulation point if some child v has low[v] >= disc[u]; the root is an articulation point if it has more than one DFS child.

Articulation Points & Bridges Worked Example

Input: Graph: 0-1, 1-2, 2-0, 1-3, 3-4

  1. DFS from 0: disc/low = {0:0,1:1,2:2,3:3,4:4} initially
  2. 2's only path back is via the 0-1-2 cycle, so low[2]=0, low[1]=0 (via the back edge 2→0)
  3. Edge 1-3: low[3]=3, and 3 > disc[1]=1, so 1-3 is a bridge; vertex 1 is an articulation point
  4. Edge 3-4: low[4]=4 > disc[3]=3, so 3-4 is also a bridge; vertex 3 is an articulation point

Output: Bridges: (1,3) and (3,4); Articulation points: 1 and 3

Graph: Introduction
A set of nodes connected by edges — edges can be one-way or two-way, and optionally carry a weight (cost/distance).
A
B
C
D
E
Unvisited Visited / discovered Current Start
Graph: Introduction
Press â–¶ Run to watch it step by step.
Python · Graphs in Code
def find_bridges(adj):
    n = len(adj)
    tin = [0] * n
    low = [0] * n
    visited = [False] * n
    timer = 0
    bridges = []

    def dfs(u, parent):
        nonlocal timer
        timer += 1
        tin[u] = low[u] = timer
        visited[u] = True
        for v in adj[u]:
            if v == parent:
                continue
            if visited[v]:
                low[u] = min(low[u], tin[v])   # back edge
            else:
                dfs(v, u)
                low[u] = min(low[u], low[v])
                if low[v] > tin[u]:            # no detour above u
                    bridges.append((u, v))
    for u in range(n):
        if not visited[u]:
            dfs(u, -1)
    return bridges
# example: bridges
Input: Graph: 0-1, 1-2, 2-0, 1-3, 3-4

Behind the Scenes Execution

Press ▶ Run in the visualizer — the call stack, registers and memory will replay here in sync with the code, line by line.

Articulation Points & Bridges Time & Space Complexity

TimeO(V + E)
SpaceO(V) for discovery/low-link arrays plus O(V) recursion stack

When to Use Articulation Points & Bridges

  • Network reliability analysis (single points of failure)
  • Road network critical-junction identification
  • Circuit design fault-tolerance checks

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits

Ready for the next step?

See the same ideas in action — visualize the algorithms that operate on these structures, or take a guided course.