@not_implemented_for('undirected')
def is_attracting_component(G):
 ac = list(attracting_components(G))
 if (len(ac[0]) == len(G)):
  attracting = True
 else:
  attracting = False
 return attracting

@ not_implemented_for ( 'undirected' ) def is_attracting_component ( G ) : ac = list ( attracting_components ( G ) ) if ( len ( ac [ 0 ] ) == len ( G ) ) : attracting = True else : attracting = False return attracting
returns true if g consists of a single attracting component .