def descendants(G, source):
 if (not G.has_node(source)):
  raise nx.NetworkXError(('The node %s is not in the graph.' % source))
 des = (set((n for (n, d) in nx.shortest_path_length(G, source=source))) - set([source]))
 return des

def descendants ( G , source ) : if ( not G . has_node ( source ) ) : raise nx . NetworkXError ( ( 'The node %s is not in the graph.' % source ) ) des = ( set ( ( n for ( n , d ) in nx . shortest_path_length ( G , source = source ) ) ) - set ( [ source ] ) ) return des
descendants -> dict arguments: pid : pid of the process .