|
Boost : |
From: jsiek_at_[hidden]
Date: 2000-07-04 20:31:46
David Abrahams writes:
> Hmm, I'm not sure exactly what you're doing, but I've had to implement
> associative containers indexable by 2 different keys; I ended up storing an
> iterator to one map in the other, but a pointer to the elements in the
> first. Don't know if this helps for your case, though.
The problem is that I want to be able to insert/erase things out of
both containers, and to do this in O(1) I need the iterators (not
pointers to elements, or integer indices).
In a normal adjacency list graph this isn't a problem, since I can
just use an integer to get to the vertices. But in an adjacency-list,
removing vertices is expensive. I want dynamic_graph to have O(1)
vertex and edge insertion/removal.
Cheers,
Jeremy
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk