[bgl] undirected_dfs to find cut-vertices

Hello, I build a visitor for an undirected graph which finds the cut-vertices of a given undireted graph or subgraph. I haven't found an implementation of the algorithm in the bgl. Maybe it would have been possible to use the predecessor_recorder for that. But then all the information which can be found directly while doing the df-search we have to find after having performed that search first. The interface of the undirected_dfs function doesn't take visitors via reference, so it wasn't possible to use that function. I had to call the detail::undir_dfv_impl function instead because that function takes a visitor reference and I had to recreate a function with the behaviour of the undirected_dfs. What reasons lead to the decision to disable passing a visitor by reference directly to undirected_dfs? What reasons lead to the decision to pass a const graph to a visitor function? Some useful things are disabled by that (but maybe also some bad things). Cheers, Stephan

Hi Stephan, The answer to your question is in FAQ entry 2. http://www.boost.org/libs/graph/doc/faq.html On Fri, 17 Oct 2003, Stephan [iso-8859-1] H�fer wrote: stepha> Hello, stepha> stepha> I build a visitor for an undirected graph which finds the cut-vertices stepha> of a given undireted graph or subgraph. I haven't found an stepha> implementation of the algorithm in the bgl. stepha> Maybe it would have been possible to use the predecessor_recorder for stepha> that. But then all the information which can be found directly while stepha> doing the df-search we have to find after having performed that search stepha> first. stepha> stepha> The interface of the undirected_dfs function doesn't take visitors via stepha> reference, so it wasn't possible to use that function. I had to call the stepha> stepha> detail::undir_dfv_impl function instead because that function takes a stepha> visitor reference and I had to recreate a function with the behaviour of stepha> stepha> the undirected_dfs. stepha> What reasons lead to the decision to disable passing a visitor by stepha> reference directly to undirected_dfs? stepha> What reasons lead to the decision to pass a const graph to a visitor stepha> function? Some useful things are disabled by that (but maybe also some stepha> bad things). stepha> stepha> Cheers, stepha> Stephan stepha> stepha> stepha> stepha> _______________________________________________ stepha> Boost-users mailing list stepha> Boost-users@lists.boost.org stepha> http://lists.boost.org/mailman/listinfo.cgi/boost-users stepha> ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
participants (2)
-
Jeremy Siek
-
Stephan Höfer