English

Path and Ancestor Queries on Trees with Multidimensional Weight Vectors

Data Structures and Algorithms 2019-10-04 v1

Abstract

We consider an ordinal tree TT on nn nodes, with each node assigned a dd-dimensional weight vector \pntw{1,2,,n}d,\pnt{w} \in \{1,2,\ldots,n\}^d, where dNd \in \mathbb{N} is a constant. We study path queries as generalizations of well-known {\textit{orthogonal range queries}}, with one of the dimensions being tree topology rather than a linear order. Since in our definitions dd only represents the number of dimensions of the weight vector without taking the tree topology into account, a path query in a tree with dd-dimensional weight vectors generalize the corresponding (d+1)(d+1)-dimensional orthogonal range query. We solve {\textit{ancestor dominance reporting}} problem as a direct generalization of dominance reporting problem, %in time \O((lgd1n)/(lglgn)d2+k)\O((\lg^{d-1} n)/(\lg\lg n)^{d-2}+k) in time \O(lgd1n+k)\O(\lg^{d-1}{n}+k) %and space of \O(n(lgn)d1/(lglgn)d2)\O(n(\lg n)^{d-1}/(\lg \lg n)^{d-2}) words, and space of \O(nlgd2n)\O(n\lg^{d-2}n) words, where kk is the size of the output, for d2.d \geq 2. We also achieve a tradeoff of \O(nlgd2+\epsn)\O(n\lg^{d-2+\eps}{n}) words of space, with query time of \O((lgd1n)/(lglgn)d2+k),\O((\lg^{d-1} n)/(\lg\lg n)^{d-2}+k), for the same problem, when d3.d \geq 3. We solve {\textit{path successor problem}} in \O(nlgd1n)\O(n\lg^{d-1}{n}) words of space and time \O(lgd1+\epsn)\O(\lg^{d-1+\eps}{n}) for d1d \geq 1 and an arbitrary constant \eps>0.\eps > 0. We propose a solution to {\textit{path counting problem}}, with \O(n(lgn/lglgn)d1)\O(n(\lg{n}/\lg\lg{n})^{d-1}) words of space and \O((lgn/lglgn)d)\O((\lg{n}/\lg\lg{n})^{d}) query time, for d1.d \geq 1. Finally, we solve {\textit{path reporting problem}} in \O(nlgd1+\epsn)\O(n\lg^{d-1+\eps}{n}) words of space and \O((lgd1n)/(lglgn)d2+k)\O((\lg^{d-1}{n})/(\lg\lg{n})^{d-2}+k) query time, for d2.d \geq 2. These results match or nearly match the best tradeoffs of the respective range queries. We are also the first to solve path successor even for d=1d = 1.

Cite

@article{arxiv.1910.01147,
  title  = {Path and Ancestor Queries on Trees with Multidimensional Weight Vectors},
  author = {Meng He and Serikzhan Kazi},
  journal= {arXiv preprint arXiv:1910.01147},
  year   = {2019}
}
R2 v1 2026-06-23T11:33:06.117Z