This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
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.
For undirected graphs only.
>>> G = nx.path_graph(4) >>> print(nx.is_connected(G)) True