I have a graph which contains an unknown number of disconnected subgraphs. What\'s a good algorithm (or Java library) to find them all?
JGraphT is a nice open source graphing library licensed under the LGPL license. I have used it in the past to deal with graphs and detecting cycles within the graphs. It is also fairly easy to use, and you can use JGraph to visualize the graphs.