networkx.algorithms.components.number_weakly_connected_components¶
-
number_weakly_connected_components
(G)[source]¶ Returns 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
- Raises
NetworkXNotImplemented – If G is undirected.
See also
weakly_connected_components()
,number_connected_components()
,number_strongly_connected_components()
Notes
For directed graphs only.