Two example implementations of my algorithm for finding strongly connected components in a directed graph. This algorithm improves the space requirements of Tarjan's by compressing two arrays into one. See the following paper for details of how the algorithm works:
- "An Improved Algorithm for Finding the Strongly Connected Components of a Directed Graph", David J. Pearce, 2015.
Both a recursive and imperative version of this algorithm are given for completeness. These algorithms are not intended to be specifically efficient, just to provide sample implementations. In particular, I've tried to keep them as close to the presentation in the paper as possible.