Compute strongly connected components in a directed graph