[BGL] Why does depth_first_search not accept a source vertex parameter?
Hi, I'm just learning about the BGL, and I've been sucessful in compiling and learning with examples on my VC6 Windows machine. I have a newbie question that someone with more knowledge of BGL might be able to answer : Q : Why does depth_first_search not accept a source vertex parameter, while breadth_first_search do? Is this just to be consistent with the historical definition of DFS? However, depth_first_visit and breadth_first_visit both accept a source vertex parameter. It would seem that DFS is more useful ( output is more deterministic ) if the source vertex can be specified, just like BFS. Reference : ( from the online BGL documentation ) template <class VertexListGraph, class P, class T, class R> void breadth_first_search(VertexListGraph& G, typename graph_traits<VertexListGraph>::vertex_descriptor s, const bgl_named_params<P, T, R>& params); template <class IncidenceGraph, class P, class T, class R> void breadth_first_visit(IncidenceGraph& G, typename graph_traits<IncidenceGraph>::vertex_descriptor s, const bgl_named_params<P, T, R>& params); template <class VertexListGraph, class class P, class T, class R> void depth_first_search(VertexListGraph& G, const bgl_named_params<P, T, R>& params); template <class IncidenceGraph, class DFSVisitor, class ColorMap> void depth_first_visit(IncidenceGraph& g, typename graph_traits<IncidenceGraph>::vertex_descriptor s, DFSVisitor& vis, ColorMap color);
participants (1)
-
kweeheong