Articulation Point in Graph

hard

Given an undirected graph with V vertices (0 .. V-1) and edges edges (no self-loops or duplicate edges), return all articulation points (cut vertices) — vertices whose removal increases the number of connected components — in ascending order.

Hints

An articulation point's removal increases the number of connected components.
DFS with disc[u] and low[u]; a non-root u is a cut vertex if some child has low[v] >= disc[u].
The DFS root is a cut vertex iff it has two or more DFS children.

Common doubts

A cut vertex only needs the child unable to reach ABOVE u (it may reach u itself); a bridge needs the child unable to reach even u — a stricter condition.
The root has no parent, so the child condition doesn't apply; it's a cut vertex only when it joins two or more separate DFS subtrees.
Yes — a vertex joining two cycles is a cut vertex, but the edges around it are on cycles, so none are bridges.

Interview follow-ups

Articulation points are exactly the vertices shared by two or more biconnected components.
Track the stack of edges during DFS and pop a biconnected component whenever the ≥ condition fires.

Fun facts

  • A graph with no articulation points is '2-vertex-connected' (biconnected).
  • The same disc/low DFS finds SCCs, bridges, and articulation points — Tarjan's Swiss-army traversal.

Asked at

GoogleAmazonMicrosoft
Frequently Sometimes Occasionally
Example 1
Input: V = 5, edges = [[0,1],[1,2],[2,0],[1,3],[3,4]]
Output: [1, 3]
Removing 1 splits the triangle from the tail; removing 3 isolates 4.
Example 2
Input: V = 4, edges = [[0,1],[1,2],[2,3],[3,0]]
Output: []
A single cycle has no cut vertices.
Constraints

- 1 <= V <= 10^5 - 0 <= edges.length <= 10^5 - no self-loops or duplicate edges

Solve this problem →