|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Heavy-Light Decomposition for tree path queries on Aleph graphs. More...
#include <algorithm>#include <cstddef>#include <limits>#include <utility>#include <ah-errors.H>#include <tpl_array.H>#include <tpl_dynListStack.H>#include <tpl_dynMapOhash.H>#include <tpl_dynMapTree.H>#include <tpl_graph.H>#include <tpl_segment_tree.H>Go to the source code of this file.
Classes | |
| class | Aleph::hld_detail::HLD_Tree_Data< GT, SA > |
| class | Aleph::Gen_HLD< GT, T, Op, SA > |
| Heavy-Light Decomposition with segment tree for path/subtree queries. More... | |
| struct | Aleph::HLD_Sum< GT, T, SA > |
| HLD with path/subtree sum queries. More... | |
| struct | Aleph::HLD_Max< GT, T, SA > |
| HLD with path/subtree max queries. More... | |
| struct | Aleph::HLD_Min< GT, T, SA > |
| HLD with path/subtree min queries. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
| namespace | Aleph::hld_detail |
Heavy-Light Decomposition for tree path queries on Aleph graphs.
Heavy-Light Decomposition (HLD) partitions a rooted tree into heavy chains such that any root-to-node path crosses at most \(O(\log n)\) chains. Combined with a segment tree, this yields efficient path queries and point updates.
This header provides a generic HLD engine parameterised by the graph type, value type, and an associative binary operation:
Three convenience aliases are provided:
HLD_Sum<GT, T, SA> — path/subtree sum queries.HLD_Max<GT, T, SA> — path/subtree max queries.HLD_Min<GT, T, SA> — path/subtree min queries.Op must be associative and commutative for correct path queries. Non-commutative operations require directional accumulation (not currently supported).Definition in file HLD.H.