Path Query Data Structures in Practice

Meng He, Serikzhan Kazi
1/28/2020
cs.DS

Official code: serkazi/tree_path_queries (1 star, C++, last commit 2026-09-21).

Abstract

We perform experimental studies on data structures that answer path median, path counting, and path reporting queries in weighted trees. These query problems generalize the well-known range median query problem in arrays, as well as the $2d$ orthogonal range counting and reporting problems in planar point sets, to tree structured data.

Show full abstract

We propose practical realizations of the latest theoretical results on path queries. Our data structures, which use tree extraction, heavy-path decomposition and wavelet trees, are implemented in both succinct and pointer-based form. Our succinct data structures are further specialized to be plain or entropy-compressed. Through experiments on large sets, we show that succinct data structures for path queries may present a viable alternative to standard pointer-based realizations, in practical scenarios. Compared to na{ï}ve approaches that compute the answer by explicit traversal of the query path, our succinct data structures are several times faster in path median queries and perform comparably in path counting and path reporting queries, while being several times more space-efficient. Plain pointer-based realizations of our data structures, requiring a few times more space than the na{ï}ve ones, yield up to $100$-times speed-up over them.

View on arXivView PDF

Code Implementations(1)

10C++, PerlJan 28, 20202 months ago

Similar Papers

Cite this paper

@article{he2020path,
  title  = {Path Query Data Structures in Practice},
  author = {Meng He and Serikzhan Kazi},
  year   = {2020},
  eprint = {2001.10567},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2001.10567}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2001.10567.svg)](https://codeofpaper.com/paper/2001.10567)

Discussion