Boost.Graph depth_first_visit algorithm

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Boost.Graph depth_first_visit algorithm

Boost - Dev mailing list
The documentation on the Boost.Graph depth_first_visit algorithm indicates that the first argument is a non-const reference to an Incidence Graph.  See https://www.boost.org/doc/libs/1_67_0/libs/graph/doc/depth_first_visit.html.

However, in contrast the code in boost/graph/depth_first_search.hpp only implements the function for a _const_ reference to an Incidence Graph.

I can see that changing the graph structure mid-traversal is a problem, but I have use cases in which graph properties (not graph structure) must be changed along the traversal.  Thus, it seems that a valid use case is for this algorithm to work as documented, i.e., on a non-const graph.

The attached patch implements overloads for the non-const versions of depth_first_{visit|search}, including overloads for the dfs_visitor member functions.

Is there some reason not to extend the implemented interface in this way to better agree with the documentation?

Cheers,
Brook



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

depth_first_search.hpp.patch (12K) Download Attachment