I am looking for the most efficient algorithm in order to find both the number of connected components in a network, and the number of nodes for each connected component.