CMD Guide
HomeDSAAdvanced Patterns

Introduction to Articulation Points and Bridges Pattern

Mechanism

An articulation point (cut vertex) is a vertex whose removal increases the number of connected components; a bridge is an edge with the same property. Tarjan's algorithm finds both in a single DFS pass by comparing each vertex's discovery time (when DFS first visits it) against the lowest discovery time reachable from its DFS-subtree using at most one back edge (its low value). If a child's subtree can only reach back up to the current vertex or lower, that child's subtree has no other way out of the graph — the current vertex is load-bearing.

Recognize the pattern

Brute force → optimal

Brute force: for each vertex, delete it (and its edges), recount connected components via a fresh DFS/BFS, compare to baseline, restore. Repeating a full O(V+E) traversal for every vertex costs O(V·(V+E)) time, O(V+E) space per run.

Optimal (Tarjan, 1972): a single DFS computes disc[u] and low[u] for every vertex, deriving articulation points and bridges from tree-edge/back-edge comparisons — no repeated traversals. Cost drops to O(V+E) time, O(V) space.

Complexity, derived

DFS visits every vertex once and examines every edge exactly twice (undirected, once from each endpoint) — that is the definition of O(V+E) already; Tarjan's algorithm adds only O(1) work per edge examination (an array compare/update) and O(1) per vertex (initializing disc/low, a child counter for the root). No operation is repeated across vertices, so the total stays O(V+E) time. Space is the recursion stack plus three arrays of size V (disc, low, visited) → O(V), ignoring adjacency-list storage which is O(V+E) regardless of algorithm.

Compare to brute force's recurrence: T(V) = V × O(V+E) since each of the V removals re-runs a full traversal — that extra factor of V is exactly what the DFS-with-low-links trick eliminates by reusing the single traversal's back-edge information.

The two decision rules

RuleConditionMeaning
Bridgelow[child] > disc[u]child's subtree has no back edge at all reaching u or above → edge u–child is the only link, removing it disconnects the graph
Articulation point (non-root u)low[child] >= disc[u]child's subtree cannot reach above u (equal is enough) → u is still the sole connector for that subtree
Articulation point (root)root has ≥ 2 DFS-tree childrenroot only "connects" its children through itself; a lone child cannot make it critical

Worked example

Graph: two triangles joined by one edge — edges (1,2) (2,3) (1,3) (3,4) (4,5) (4,6) (5,6). DFS from 1, adjacency visited in numeric order.

Vertexdisclow (final)Why
1 (root)00only 1 DFS-tree child (2) → not articulation
210back edge 2→1 pulls low down to 0
320back edge 3→1 pulls low down to 0, but child 4 has low[4]=3 ≥ disc[3]=2 → articulation point; also low[4]=3 > disc[3]=2 → edge (3,4) is a bridge
433no back edge escapes above 3 (only reaches its own subtree) → child 5 has low[5]=3 ≥ disc[4]=3 → articulation point
543back edge 5→... none upward, but child 6's back edge to 4 pulls low[5] to 3
653back edge 6→4 gives low[6]=min(5, disc[4]=3)=3

Result: articulation points {3, 4}; bridge {(3,4)}. Removing 3 or 4 splits the graph into the two triangles; removing the bridge edge alone does the same.

Java implementation

class ArticulationPointsAndBridges {
    private int timer = 0;
    private int[] disc, low;
    private boolean[] visited, isArt;
    private List<int[]> bridges = new ArrayList<>();
    private List<List<Integer>> adj;

    void run(int n, List<List<Integer>> adjacency) {
        adj = adjacency;
        disc = new int[n]; low = new int[n];
        visited = new boolean[n]; isArt = new boolean[n];
        for (int u = 0; u < n; u++)
            if (!visited[u]) dfs(u, -1);
    }

    private void dfs(int u, int parent) {
        visited[u] = true;
        disc[u] = low[u] = timer++;
        int children = 0;
        for (int v : adj.get(u)) {
            if (v == parent) continue;
            if (visited[v]) {
                low[u] = Math.min(low[u], disc[v]); // back edge
            } else {
                children++;
                dfs(v, u);
                low[u] = Math.min(low[u], low[v]);
                if (low[v] > disc[u]) bridges.add(new int[]{u, v});
                if (parent != -1 && low[v] >= disc[u]) isArt[u] = true;
            }
        }
        if (parent == -1 && children >= 2) isArt[u] = true;
    }
}

Pitfalls

When to use / when not

Use Tarjan's low-link DFS whenever the question is about single points of failure, critical connections, or decomposing a graph into biconnected components — it is the only linear-time approach. Alternative — brute-force removal simulation: acceptable only for tiny graphs or as a correctness oracle in tests, since it costs an extra factor of V. Alternative — union-find rebuilt per removal: same O(V·(V+E)) ballpark, no better. Do NOT reach for this pattern for directed graphs (use Tarjan's strongly connected components algorithm instead, a different low-link application) or for weighted min-cut problems (use max-flow/min-cut, since articulation points only capture unweighted single-vertex/edge cuts, not general k-cuts).

Takeaways

Recall question

In a DFS tree, vertex u (non-root) has exactly one child c with low[c] == disc[u]. Is u an articulation point, and is edge (u,c) a bridge?

Answer: u is an articulation point (condition is low[c] >= disc[u], satisfied). Edge (u,c) is NOT a bridge (condition requires strict low[c] > disc[u], which fails at equality) — c can reach back exactly to u via some other path, so removing the edge alone doesn't disconnect it, but removing u itself still does.


Based on Tarjan, R. E. (1972), "Depth-first search and linear graph algorithms," SIAM Journal on Computing — the original low-link formulation underlying articulation point and bridge detection.

🤖 Don't fully get this? Learn it with Claude

Stuck on Introduction to Articulation Points and Bridges Pattern? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **Introduction to Articulation Points and Bridges Pattern** (DSA) and want to truly understand it. Explain Introduction to Articulation Points and Bridges Pattern from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **Introduction to Articulation Points and Bridges Pattern** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **Introduction to Articulation Points and Bridges Pattern** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **Introduction to Articulation Points and Bridges Pattern** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes