def dfs_postorder_nodes(G, source=None):
 post = (v for (u, v, d) in nx.dfs_labeled_edges(G, source=source) if (d == 'reverse'))
 return post

def dfs_postorder_nodes ( G , source = None ) : post = ( v for ( u , v , d ) in nx . dfs_labeled_edges ( G , source = source ) if ( d == 'reverse' ) ) return post
produce nodes in a depth-first-search post-ordering starting from source .