test for strongly connected component