Boost logo

Boost Users :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2007-07-06 15:53:43


On Fri, 2007-07-06 at 14:32 -0500, jiangfan shi wrote:
> Thanks, Doug,
>
> The reverse_graph class template in the BGL is a reversed
> *view* of the
> existing graph.
>
> So I have to build the "real" reversed graph by myself, or change the
> "original" graph to build up the reversed graph. The reason is that I
> want to use such reversed instance to get the dominator tree.

Most likely, you don't need to build the reversed graph. You can just
run algorithms on the reversed "view" of the original graph: that's
exactly what the reverse_graph adaptor is meant for. For example, you
can call:

  lengauer_tarjan_dominator_tree(make_reverse_graph(graph),
                                 exit_node, dominators)

  - Doug


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