Boost logo

Boost Users :

From: Luis Quesada (luque_at_[hidden])
Date: 2005-12-01 05:27:04


Douglas Gregor wrote:

>On Nov 30, 2005, at 2:06 PM, Luis Quesada wrote:
>
>
>>Given the index of a vertex, how can I get its descriptor? I guess
>>function vertex (page 225 of The Boost Graph Library) does that
>>but the
>>function is not defined.
>>
>>
>
>For adjacency_list, there is a vertex function:
>
> vertex(i, g)
>
>returns the ith vertex in the graph g. It's documented in the "Non-
>Member Functions" section of
>
> http://www.boost.org/libs/graph/doc/adjacency_list.html
>
>

Indeed. However vertex returns the descriptor of the ith vertex in the
*current* graph. What I actually need is the descriptor of the ith
vertex in the original graph (before any removal has taken place).

If descriptors are not invalidated, the simple solution is to have a
vector mapping original indexes to descriptors. However, I want to know
what is the most appropriate way of checking whether edge <i,j> (where i
and j are original indexes) is in the graph in a context where
descriptors are invalidated.

Luis


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