Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-08-01 11:06:00


Hi Erik,

On Thu, 1 Aug 2002, Erik Arner wrote:
yg-boo>
yg-boo> Yet another question from the BGL newbie...
yg-boo>
yg-boo> I understand that performing remove_vertex() on graphs with
yg-boo> vertexList=vecS will result in invalidated itarors and descriptors for
yg-boo> the graph.
yg-boo>
yg-boo> However, some toy examples i made suggest that if I remove a vertex in
yg-boo> such a graph, the vertex descriptors and vertex iterators for vertices
yg-boo> with *lower* ID than the removed vertex remain valid after removal,
yg-boo> while those for higher ID vertices are invalidated.
yg-boo>
yg-boo> Is this a true feature of a graph with Vertexlist=vecS, or is my
yg-boo> observation a mere coincidence? Is it safe to write code that exploits
yg-boo> this "feature"?

Yes, that is indeed a true feature.

yg-boo> If it indeed is a feature, I can construct a sorted list of vertices to
yg-boo> remove, and remove the vertices in descending order in an easy fashion.

That sounds plausible.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


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