static void DFS_Helper2( Digraph& dg, Digraph::Node u, NDArray& nds ) { NodeArray ns; Dfs<Digraph> aDfs( dg ); aDfs.run( u ); for( Digraph::NodeIt n( dg ); n != INVALID; ++n ) { if( aDfs.reached( n ) ) { NodeDist nd; nd.u = n; nd.dist = aDfs.dist( n ); nds.push_back( nd ); } } }
static void DFS_Helper3( Digraph& dg, Digraph::Node u, NDArray& nds ) { typedef ReverseDigraph<Digraph> RDigraph; RDigraph rdg( dg ); Dfs<RDigraph> aDfs( rdg ); aDfs.run( u ); for( Digraph::NodeIt n( dg ); n != INVALID; ++n ) { if( aDfs.reached( n ) ) { NodeDist nd; nd.u = n; nd.dist = aDfs.dist( n ); nds.push_back( nd ); } } }