Jikka-5.0.11.1: A transpiler from Python to C++ for competitive programming
decomposeToStronglyConnectedComponents does SCC in $$O(V + E)$$ using Kosaraju's algorithm. It takes a digraph $$G = (V, E)$$ as an adjacent list $$g : V \to V^{\lt \omega}$$, and returns an mapping $$f : V \to V'$$ for the SCC DAG $$G' = (V', E')$$. The indices of vertices of the SCC DAG are topologically sorted.
topologicalSort does topological sort in $$O(V + E)$$ using Tarjan's algorithm. The input is an adjacent list of a DAG.