algorithm for computing strongly connected components