Graph/kosaraju_scc library
🔁 Kosaraju's Algorithm (Strongly Connected Components)
Computes SCCs in a directed graph using two DFS passes:
- DFS on original graph to compute finishing times (order)
- DFS on reversed graph in decreasing finish-time order to extract SCCs
- Time complexity: O(V + E)
- Space complexity: O(V)
Functions
-
kosarajuSCC<
T> (Map< T, List< graph) → List<T> >Set< T> >