Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

number_weakly_connected_components

number_weakly_connected_components(G)[source]

Return the number of weakly connected components in G.

Parameters:G (NetworkX graph) – A directed graph.
Returns:n – Number of weakly connected components
Return type:integer

See also

connected_components()

Notes

For directed graphs only.