@not_implemented_for('directed')
def is_connected(G):
 if (len(G) == 0):
  raise nx.NetworkXPointlessConcept('Connectivity is undefined ', 'for the null graph.')
 return (len(set(_plain_bfs(G, arbitrary_element(G)))) == len(G))

@ not_implemented_for ( 'directed' ) def is_connected ( G ) : if ( len ( G ) == 0 ) : raise nx . NetworkXPointlessConcept ( 'Connectivity is undefined ' , 'for the null graph.' ) return ( len ( set ( _plain_bfs ( G , arbitrary_element ( G ) ) ) ) == len ( G ) )
return true if the graph is connected .