Boost logo

Boost :

From: Carlos Rafael Giani (e0325834_at_[hidden])
Date: 2008-05-12 11:17:47


> It depends on the serialization method. Are you using the Boost
> Serialization library or one of the Boost.Graph I/O functions like
> write_graphviz()?


> It's been a while since I looked closely at the graph code, so take
> this with a grain of salt. Some versions of the adjacency list
> actually have implicit ids. If you declare the adjacency list with
> vector storage for vertices, then you can simply create an id
> property map over the vertices. The reason for this is that vecS
> causes the vertex descriptor to be the index into the vector, rather
> than a pointer. For any other vertex storage option, you're on your own.

Interesting, unfortunately I cannot use vecS, since I add/remove a lot,
which would render iterators and descriptors invalid with vecS.

So it is as I expected - I have to do it manually.

> You should probably also steer clear of the older properties
> (boost::property<>) for graphs. I would recommend defining vertex and
> edge structures that contain all the features you need for your graph
> application and then attaching property maps to them. You may end up
> having to assign your own unique id's (which could actually be
> strings) , but at least you'll know how it's going to work.

Since the structure and the data types can change at run-time, I defined
a map < string, any > as property, so the problem you described doesn't
occur. Thanks for the warning, though.

Carlos Rafael Giani

Boost list run by bdawes at, gregod at, cpdaniel at, john at