@not_implemented_for('undirected')
def is_semiconnected(G):
 if (len(G) == 0):
  raise nx.NetworkXPointlessConcept('Connectivity is undefined for the null graph.')
 if (not nx.is_weakly_connected(G)):
  return False
 G = nx.condensation(G)
 path = nx.topological_sort(G)
 return all((G.has_edge(u, v) for (u, v) in pairwise(path)))

@ not_implemented_for ( 'undirected' ) def is_semiconnected ( G ) : if ( len ( G ) == 0 ) : raise nx . NetworkXPointlessConcept ( 'Connectivity is undefined for the null graph.' ) if ( not nx . is_weakly_connected ( G ) ) : return False G = nx . condensation ( G ) path = nx . topological_sort ( G ) return all ( ( G . has_edge ( u , v ) for ( u , v ) in pairwise ( path ) ) )
return true if the graph is semiconnected .