Boost.Graph depth_first_visit algorithm

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

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?


Unsubscribe & other changes:

depth_first_search.hpp.patch (12K) Download Attachment