Selective depth-first search in a graph
Hello, boost users! Is there a simple way to perform a selective depth-first search in a graph, so that I could choose edges to traverse the graph? For example, let's assume I can walk through an edge, only if its weight is greater than 0. How could I reveal all reachable vertices? It worth pointing out that the real availability condition is a little bit more complicated, but easity can be revealed from edge's inner properties. Thank you in advance! -- Anatoli Sakhnik
On Apr 10, 2006, at 11:58 AM, Anatoli Sakhnik wrote:
Hello, boost users! Is there a simple way to perform a selective depth-first search in a graph, so that I could choose edges to traverse the graph?
Absolutely. You can use the filtered_graph adaptor: http://www.boost.org/libs/graph/doc/filtered_graph.html
For example, let's assume I can walk through an edge, only if its weight is greater than 0. How could I reveal all reachable vertices?
That's the first example in the filtered_graph documentation :) Doug
participants (2)
-
Anatoli Sakhnik
-
Doug Gregor