Index: dag_shortest_paths.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/graph/dag_shortest_paths.hpp,v retrieving revision 1.13 diff -u -r1.13 dag_shortest_paths.hpp --- dag_shortest_paths.hpp 26 Feb 2004 18:26:47 -0000 1.13 +++ dag_shortest_paths.hpp 7 Oct 2004 14:05:38 -0000 @@ -49,7 +49,16 @@ typedef typename graph_traits::vertex_descriptor Vertex; std::vector rev_topo_order; rev_topo_order.reserve(num_vertices(g)); - topological_sort(g, std::back_inserter(rev_topo_order)); + + // Call 'depth_first_visit', not 'topological_sort', because we don't + // want to traverse the entire graph, only vertices reachable from 's', + // and 'topological_sort' will traverse everything. The logic below + // is the same as for 'topological_sort', only we call 'depth_first_visit' + // and 'topological_sort' calls 'depth_first_search'. + topo_sort_visitor > > + topo_visitor(std::back_inserter(rev_topo_order)); + depth_first_visit(g, s, topo_visitor); + typename graph_traits::vertex_iterator ui, ui_end; for (tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) { Index: depth_first_search.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/graph/depth_first_search.hpp,v retrieving revision 1.41 diff -u -r1.41 depth_first_search.hpp --- depth_first_search.hpp 26 Mar 2004 16:25:08 -0000 1.41 +++ depth_first_search.hpp 7 Oct 2004 14:05:38 -0000 @@ -379,6 +379,19 @@ detail::depth_first_visit_impl(g, u, vis, color, func); } + template + void depth_first_visit( + const IncidenceGraph& g, + typename graph_traits::vertex_descriptor u, + DFSVisitor vis) + { + std::vector color_map(num_vertices(g)); + + depth_first_visit(g, u, vis, + make_iterator_property_map(&color_map[0], + get(vertex_index, g))); + } + } // namespace boost