uses tarjan's algorithm to find the size of SCCs