Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Having a cost function as weight map
From: potato_research (santini.alberto_at_[hidden])
Date: 2013-09-05 15:51:15

I'd like to add, as a future reference, that this approach works well when
the bundled property is a pointer. An example could be when you have many
graphs with the same underlying vertex set and different edges, so you might
want to use pointers to VertexProperty objects as bundled properties.

In particular, VertexProperty could contain a field to be used as the vertex
index. See, for example for such an object (in
the example we don't use pointers, though). In this case we can still use
algorithms such as r_c_shortest_paths that expect an index map by adding

value_type operator[](const Arg& arg) const { return f(arg); }

to function_property_map as posted by Jeremiah and edited by Maxime.

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at