I need to create a dominator tree for a given graph. The code I have compiles and runs without errors, but the output looks exactly the same as the input.
I have defined the following type for my graph (to be analyzed)
typedef boost::adjacency_list<boost::listS, boost::vecS,
boost::bidirectionalS, vertex_info, edge_info> Graph;
and I would like to have another object containing the corresponding dominator tree. I tried the following:
// dominator tree is an empty Graph object
dominator_tree = trace;
typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
typedef typename boost::property_map<Graph, boost::vertex_index_t>::type IndexMap;
typedef typename boost::iterator_property_map<typename std::vector<Vertex>::iterator, IndexMap> PredMap;
IndexMap indexMap(get(boost::vertex_index, dominator_tree));
std::vector<Vertex> domTreePredVector = std::vector<Vertex>(
num_vertices(dominator_tree),
boost::graph_traits<Graph>::null_vertex());
PredMap domTreePredMap = make_iterator_property_map(
domTreePredVector.begin(), indexMap);
lengauer_tarjan_dominator_tree(dominator_tree, vertex(0, dominator_tree),
domTreePredMap);
When I output the content of dominator_tree to a .dot file, it is exactly the same as in trace. I.e. it looks like the call of the last line above did not change anything. The input graph looks like this: http://s24.postimg.org/y17l17v5x/image.png
The INIT node is the node 0. If I choose any other node as the second argument of the function, it still returns an identical result.
What am I doing wrong?? Apreciate any help.