Tarjan's Algorithm #
This file implements Tarjan's algorithm for finding the strongly connected components (SCCs) of a graph.
State for Tarjan's algorithm.
- id : Std.HashMap ℕ ℕ
id[v]is the index of the vertexvin the DFS traversal. - lowlink : Std.HashMap ℕ ℕ
The stack of visited vertices used in Tarjan's algorithm.
- onStack : Std.HashSet ℕ
- time : ℕ
A time counter that increments each time the algorithm visits an unvisited vertex.
Instances For
The Tarjan's algorithm. See Wikipedia.
Implementation of findSCCs in the StateM TarjanState monad.
Equations
- One or more equations did not get rendered due to their size.