Boost logo

Boost Users :

From: Chris Russell (cdr_at_[hidden])
Date: 2002-10-02 03:23:10


Still up hacking... Without cluttering the question with a ton of detail,
basically I need to perform a DFS on a forest stored in a bidirectionalS
adjacency_list and then perform a subgraph traversal in response to each
finish_vertex invocation in the visitor. (The idea is to push information
down the branches towards the root of a tree in the forest). Calling
in_edges(v,g) from within the finish_vertex method in a dfs_visitor will not
compile however. This is because the graph is passed by const reference into
the visitor method and in_edges requires a non-const graph reference? (this
seems similar in spirit to a question I posted a week or two ago about
boost::get(some_property, Graph) from within a visitor).

Generally, I would like to be able to daisy chain graph algorithms - that is
invoke a sub-algorithm from within a visitor method called by a controlling
algorithm. This would require that the sub-algorithm not change the graph
topology, trample on properties used by its controller (e.g. coloring), or
otherwise invalidate vertex descriptors or iterators so some care would need
to be taken in designing the sub-algorithm. But it seems like a useful
mechanism for extension.

Am I missing something about getting at the in_edges given that I'm working
with a const graph_t& in the context of the "controlling" DFS' visitor
method? Why is this so restrictive? I'm guessing it might have something to
do with having multiple copies of vertex and edge iterators floating around
but I'm not sure. Will you comment on this please Jeremy? Thank you.

- Chris Russell


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net