Graph Theory37 sections · 1633 units
Open in Course

Articulation Points - Algorithm

(DFS-based detection)

1.1. Build adjacency list.

2.2. Initialize disc[v] = -1, low[v] = 0, timer=0timer = 0, result=set()result = set().

3.3. For each unvisited vertex, run DFS with isRoot=trueisRoot = true:

  • Set disc[v] = low[v] = timer, timer++timer{+}{+}, children=0children = 0
  • For each neighbor ww: if unvisited, recurse, children++children{+}{+}, update low[v], check low[w] >= disc[v]; if visited (not parent), update low[v]
  • If isRootisRoot and children2children \geq 2, add vv to result

4.4. Return result.

This runs in O(V+E)O(V + E) time and uses O(V)O(V) space.