Added count_connected_components.