I have a graph which contains an unknown number of disconnected subgraphs. What\'s a good algorithm (or Java library) to find them all?
I'm assuming you want to find all the (strongly) connected components? For that you can use Tarjan's algorithm (a variant of DFS)