Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-01-25 07:51:00


Douglas Gregor wrote:
> On Friday 25 January 2002 07:10 am, you wrote:
> > Hi,
> > suppose I have a directed graph where vertices are labelled with a
> > string. Given a vertex, if would like to gather the set of vertices such
> > that 1. They have non-empty label
> > 2. There's a path from start vertex to each of them, which does not pass
> > through any vertex with non-empty label.

> It sounds like you want a filtered_graph where the vertex predicate weeds
> out all vertices that have empty labels. Then run your depth-first search
> on the filtered_graph.

I don't think it will work

        1--->2--->3(*)-->4-->5(*)
         |
         \--->6-->7(*)
        ("*" denote vertices with non-empty labels.)

Starting search from 1, I'd like to find 3 and 7, and I don't want to employ
overly complex logic to weed out 5.
If I filter out vertices with emply labels, I won't find anything at all.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk