an:06180272
Zbl 1268.68069
Patil, Manish; Shah, Rahul; Thankachan, Sharma V.
Succinct representations of weighted trees supporting path queries
EN
J. Discrete Algorithms 17, 103-108 (2012).
00315022
2012
j
68P05 68R10 05C05
succinct data structures
Summary: We consider the problem of succinctly representing a given vertex-weighted tree of n vertices, whose vertices are labeled by integer weights from \(\{1,2,\ldots ,\sigma\}\) and supporting the following path queries efficiently: (1) path median query: given two vertices \(i\), \(j\), return the median weight on the path from \(i\) to \(j\), (2) path selection query: given two vertices \(i\), \(j\) and a positive integer \(k\), return the \(k\)th smallest weight on the path from \(i\) to \(j\), (3) path counting/reporting query: given two vertices \(i\), \(j\) and a range \([a,b]\), count/report the vertices on the path from \(i\) to \(j\) whose weights are in this range.
The previous best data structure supporting these queries takes \(O(n\log n)\) bits space and can perform path median/selection/counting in \(O(\log\sigma )\) time and path reporting in \(O(\log \sigma +occ\log \sigma )\) time, where \(occ\) represents the number of outputs [\textit{M. He} et al., Lect. Notes Comput. Sci. 7074, 140--149 (2011; Zbl 1350.68073)].
We present a succinct data structure taking \(n\log \sigma +6n+o(n\log \sigma )\) bits space that can perform the above mentioned queries in \(O(\log \sigma \log n)\) and \(O(\log \sigma \log n+occ\log \sigma )\) time respectively.
Zbl 1350.68073