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 http://pastebin.com/6zpwCb4X 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: http://boost.2283326.n4.nabble.com/BGL-Having-a-cost-function-as-weight-map-tp2558960p4651312.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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