Find the giant strongly connected component of the graph using the Tarjan algorithm.
For more details see: Wikipedia