English

Tree Path Majority Data Structures

Data Structures and Algorithms 2018-09-10 v2

Abstract

We present the first solution to τ\tau-majorities on tree paths. Given a tree of nn nodes, each with a label from [1..σ][1..\sigma], and a fixed threshold 0<τ<10<\tau<1, such a query gives two nodes uu and vv and asks for all the labels that appear more than τPuv\tau \cdot |P_{uv}| times in the path PuvP_{uv} from uu to vv, where Puv|P_{uv}| denotes the number of nodes in PuvP_{uv}. Note that the answer to any query is of size up to 1/τ1/\tau. On a ww-bit RAM, we obtain a linear-space data structure with O((1/τ)lognloglogwσ)O((1/\tau)\log^* n \log\log_w \sigma) query time. For any κ>1\kappa > 1, we can also build a structure that uses O(nlog[κ]n)O(n\log^{[\kappa]} n) space, where log[κ]n\log^{[\kappa]} n denotes the function that applies logarithm κ\kappa times to nn, and answers queries in time O((1/τ)loglogwσ)O((1/\tau)\log\log_w \sigma). The construction time of both structures is O(nlogn)O(n\log n). We also describe two succinct-space solutions with the same query time of the linear-space structure. One uses 2nH+4n+o(n)(H+1)2nH + 4n + o(n)(H+1) bits, where HlgσH \le \lg\sigma is the entropy of the label distribution, and can be built in O(nlogn)O(n\log n) time. The other uses nH+O(n)+o(nH)nH + O(n) + o(nH) bits and is built in O(nlogn)O(n\log n) time w.h.p.

Keywords

Cite

@article{arxiv.1806.01804,
  title  = {Tree Path Majority Data Structures},
  author = {Travis Gagie and Meng He and Gonzalo Navarro},
  journal= {arXiv preprint arXiv:1806.01804},
  year   = {2018}
}