I try to use the transitive_reduction of boost, but I don't know how to use it.
I have a graph defined with :
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, IQsNode*> Graph;
typedef Graph::vertex_descriptor Vertex;
I would like to call the method :
Graph TC;
boost::transitive_reduction(_fullGraph, TC,g_to_tr_map_stor,g_to_tc_map_stor);
I don't know the type I must use for "g_to_tr_map_stor" and "g_to_tc_map_stor".
According with information i readed , it must be a map from vertices
to integers. I try many kind of map but without success.
Some ideas ?
Thx
As far as my documentation tells me this is not public API. This implies that you can find the place where it's being used internally and use that as an example of how to use it.
Interestingly, this is not the case. This might lead one to think that the documentation is lagging/forgotten
Here's the simplest thing I could think of to satisfy the interface:
So, it uses a
std::map
to pass as theg_to_tr
vertex association map. And we pass and vertex id-map that is just increasing ids for each vertex.If you print the results:
You may get an idea of what it does.
Live On Coliru
Here is the [Wikipedia sample] reproduced:
Here's an animation of 4 of the randomly generated graphs and their transitive reductions: