
Hi Vladimir, On Apr 6, 2004, at 1:07 AM, Vladimir Prus wrote:
But really, we've got only two variants: 1. Use pointers and bear this overhead 2. Store cached value of index inside vertex_descriptor, as you suggest in the other post. In this case we have space overhead.
True, though vertex_descriptor's are not stored in memory very often... usually appear as local variables, so the space is just consuming more registers.
So, it seems we can't have nice-for-users 'v->value' or *v syntax without overhead. It's the question which kind of overhead is better.
BTW, what about vertex_descriptor stability. If we use vector for storage, it means the addresses can change when we *add* vertex, which would invalidate already stored vertex descriptors. Does this mean we need to use list/deque for the 'easy-to-use' graph type?
That's a good question. Invalidation is certainly not user friendly. BTW, there's another issue with the idea of automatically assigning indices when VertexList!=vecS. If we want to make sure the indices stay in the range [0,num_vertices(g)) in the face of adding and removing vertices, then there will be a price to pay in terms of renumbering vertices or recycling indices. Cheers, Jeremy _______________________________________________ Jeremy Siek <jsiek@osl.iu.edu> http://www.osl.iu.edu/~jsiek Ph.D. Student, Indiana University Bloomington Graduating in August 2004 and looking for work C++ Booster (http://www.boost.org) _______________________________________________