I use boost graph to manage graphs and I need to make a maxmin tree.
Now I\'m trying to use boost dijkstra\'s algorithm, but I use a pointer to my class as a vertex property
Q.
If I understant it right, I use make_iterator_property_map to create an external property map, but in order to create it I need to pass the vertex ID property map. But I can't access it through boost::get, because vertex property is a pointer. What type should I pass to boost::get(some_type, m_graph) to get such ID map?
You make /any type of propertymap that satisfies the requirement/. You don't need to associate it with the graph. You can simply pass it to the algorithms when you need to (which also makes it clear at which point you promise to have the graph data and the propertymap in synch).
It just occurred to me that in fact you might be able to get a pass on that last issue - the burden of maintaining the property map. That is, if your index can be derived from the pointer value (perhaps retrieved from the struct it points to).
You can use the
Each of these types has a corresponding deducing factory method make_transform_value_property_map
, make_function_property_map
etc. so that you don't have to manually spell out the resulting types.
You can search my older answers for examples of what can be done with these.
Samples: