C++ :: Articulation Bridge Detection Algorithm
PSEUDOCODE ARTICULATION-BRIDGE-DFS-VISIT(G,u) time = time + 1 u.d = u.low = time u.color = GRAY for each v ∈ G.Adj[u] if v.color == WHITE v.π = u DFS-VISIT(G,v) if u.d == 1 if G.Adj[u].size >= 2 AND v.low > u.d bridgeCounter = bridgeCounter + 1 bridge.push(edge(u,v)) else if v.low > u.d bridgeCounter = bridgeCounter + 1 bridge.push(edge(u,v)) u.low = min(u.low, v.low) else if u.π != v u.low = min(u.low, v.d) u.color = BLACK time = time + 1 u.f = time