A strongly connected component of a simple directed graph (i.e., a digraph without loops) is a maximal subdigraph such that for every pair of distinct vertices u, v in the subdigraph, there is a directed path from u to v. Tarjan has devised an O(n) algorithm for determining strongly connected components, which is implemented in the Wolfram Language as ConnectedGraphComponents[g].