Selective depth-first search in a graph

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Selective depth-first search in a graph

Anatoli Sakhnik-2
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
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Selective depth-first search in a graph

Doug Gregor-2

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

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users