|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-11 11:08:23
Asger,
It depends on the concept modeled by the graph. If it is an AdjacencyMatrix
you can just call edge(source, target, graph). If it is a bidirectional
graph you can enumerate the incoming edges with in_edges, then ask for the
source vertex. Otherwise, you'll need to do some kind of graph search
(expensive!)
-Dave
----- Original Message -----
From: "Asger Alstrup Nielsen" <alstrup_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, January 11, 2002 10:32 AM
Subject: [boost] BGL: How do I find ancestors to a node?
> Hi,
>
> What is the best way to get the full set of ancestors to a vertex in a
> directed graph?
>
> Alternatively, how can I answer the question:
>
> Is vertex A an ancestor to vertex B?
>
> Thanks,
>
> Asger Alstrup
>
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk