is_semiconnected
number_connected_components
Enter search terms or a module, class or function name.
Return True if the graph is connected, false otherwise.
G : NetworkX Graph
An undirected graph.
connected : bool
True if the graph is connected, false otherwise.
See also
connected_components
Notes
For undirected graphs only.
Examples
>>> G = nx.path_graph(4) >>> print(nx.is_connected(G)) True