|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Dominator and post-dominator tree computation via the Lengauer-Tarjan algorithm. More...
#include <utility>#include <tpl_graph.H>#include <tpl_graph_utils.H>#include <tpl_array.H>#include <htlist.H>#include <tpl_dynListStack.H>#include <ah-errors.H>#include <tpl_dynSetTree.H>Go to the source code of this file.
Classes | |
| class | Aleph::Lengauer_Tarjan_Dominators< GT, SA > |
| Computes dominator tree and dominance frontiers of a digraph using the Lengauer-Tarjan algorithm. More... | |
| class | Aleph::Lengauer_Tarjan_Post_Dominators< GT, SA > |
| Computes post-dominator tree and post-dominance frontiers of a digraph using the Lengauer-Tarjan algorithm on the reversed graph. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Functions | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| DynList< std::pair< typename GT::Node *, typename GT::Node * > > | Aleph::compute_dominators (GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute immediate dominators of a digraph from a root node. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| void | Aleph::build_dominator_tree (GT &g, typename GT::Node *root, GT &tree, SA sa=SA()) |
| Build the dominator tree of a digraph. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| DynMapTree< typename GT::Node *, DynSetTree< typename GT::Node * > > | Aleph::compute_dominance_frontiers (GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute dominance frontiers of a digraph. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| DynList< std::pair< typename GT::Node *, typename GT::Node * > > | Aleph::compute_post_dominators (const GT &g, typename GT::Node *exit_node, SA sa=SA()) |
| Compute immediate post-dominators of a digraph from an exit node. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| void | Aleph::build_post_dominator_tree (const GT &g, typename GT::Node *exit_node, GT &tree, SA sa=SA()) |
| Build the post-dominator tree of a digraph. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| DynMapTree< typename GT::Node *, DynSetTree< typename GT::Node * > > | Aleph::compute_post_dominance_frontiers (const GT &g, typename GT::Node *exit_node, SA sa=SA()) |
| Compute post-dominance frontiers of a digraph. | |
Dominator and post-dominator tree computation via the Lengauer-Tarjan algorithm.
This file implements the Lengauer-Tarjan algorithm for computing immediate dominators and the dominator tree of a directed graph from a given root node, in O(E * alpha(V)) time. It also provides post-dominator computation by running the same algorithm on the reversed graph from a designated exit node.
d dominates v if every path from the root to v passes through d.v is the closest strict dominator of v.The Lengauer-Tarjan algorithm uses a single DFS traversal followed by semi-dominator computation with a Union-Find structure with path compression:
| Operation | Time | Space |
|---|---|---|
| Dominator tree | O(E * alpha(V)) | O(V) |
| Dominance frontiers | O(V + E) additional | O(V + |DF|) |
Definition in file Dominators.H.