|
Boost Users : |
From: Johan Oudinet (johan.oudinet_at_[hidden])
Date: 2005-12-01 13:15:32
On 12/1/05, Luis Quesada <luque_at_[hidden]> wrote:
> Johan Oudinet wrote:
>
> >On 11/30/05, Luis Quesada <luque_at_[hidden]> wrote:
> >
> >
> >>In fact, what I want to do is to check whether an edge belongs to a
> >>graph in a context where descriptors get invalidated after vertex removals?
> >>
> >>
> >
> >You must avoid invalidated descriptors !
> >Before removing a vertex u, you have to remove all out_edges from u
> >and in_edges to u.
> >use: clear_vertex(u, g) before remove_vertex(u, g).
> >
> >
> >
> I may be using the term "invalid" in the wrong way... What I mean, in
> the example attached, is that descriptor 3 is no longer associated to
> node D but to E after C's removal. In that sense 3 becomes an "invalid"
> descriptor of node D. I think this cannot be avoided even though
> clear_vertex is used.
>
No, this behavior is specific to vecS container whom vertex descriptors are int.
But, if you use listS, setS, multisetS, etc.. vertex descriptors are
void* and you can't describe them with an enum.
Your example doesn't support remove_vertex.
-- Johan
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