AlgoFrames

Low-link values

Warm-up · Trace the algorithm · about 6 min

Follow Tarjan's algorithm from A. Each node shows disc/low: its entry time and the earliest entry time it can reach back to. Type each low value before the step plays.

Example 1

Input:

{"edges":[["A","B"],["B","C"],["C","A"],["C","D"],["D","E"],["E","D"],["B","E"]]}

Output:

{"A":"1/1","B":"2/1","C":"3/1","D":"4/4","E":"5/4"}

Two components: A B C with low 1, and D E with low 4.

Constraints

  • Edges leave a node in the order they are listed.
  • DFS starts at A.

Learn the idea first: Strongly connected components: Kosaraju and Tarjan, a visual lesson.

More Strongly connected components: Kosaraju and Tarjan problems