Tarjan's strongly connected components algorithm: Difference between revisions

Content deleted Content added
Line 25:
S.push(v) // Push v on the stack
forall (v, v') in E do // Consider successors of v
if (v'.index is undefined) // Was successor v' visited?
tarjan(v') // Recurse
v.lowlink = min(v.lowlink, v'.lowlink)
else if (v' is in S) // Was successor v' in stack S?
v.lowlink = min(v.lowlink, v'.index)
if (v.lowlink == v.index) // Is v the root of an SCC?