Boost logo

Boost Users :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2005-12-01 11:51:53


On Dec 1, 2005, at 5:27 AM, Luis Quesada wrote:
> 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).

Ah, that's a bit more tricky.

> 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.

Ah, then take Johan's advice :)
Invalidating descriptors can be very dangerous, and you will
definitely need to clear_vertex before remove_vertex, otherwise your
program will become unstable. If you're doing lots of removals, you
might want to use a graph type with stable descriptors (e.g.,
adjacency_list with listS/listS).

        Doug


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