Skip to main content
QUICK REVIEW

[Paper Review] Optimal Encodings for Range Top-k, Selection, and Min-Max

Paweł Gawrychowski, Patrick K. Nicholson|arXiv (Cornell University)|Nov 24, 2014
Algorithms and Data CompressionComputer Science16 references8 citations
TL;DR

This paper presents the first space-optimal encodings for range top-k, range selection, and range min-max queries on arrays, achieving information-theoretically optimal space usage to within lower-order terms. By leveraging compressed representations of Cartesian trees and windowed increment structures, it reduces the leading term in space complexity to $(k+1.5)nH(1.5/(k+1.5)) + o(n\lg k)$, resolving long-standing open questions on coefficient optimization for $k > 1$. The encoding supports efficient query reconstruction and can be augmented with $o(n)$ bits to enable $\mathcal{O}(1)$-time queries.

ABSTRACT

We consider encoding problems for range queries on arrays. In these problems the goal is to store a structure capable of recovering the answer to all queries that occupies the information theoretic minimum space possible, to within lower order terms. As input, we are given an array $A[1..n]$, and a fixed parameter $k \in [1,n]$. A range top-$k$ query on an arbitrary range $[i,j] \subseteq [1,n]$ asks us to return the ordered set of indices $\{\ell_1, ..., \ell_{k}\}$ such that $A[\ell_m]$ is the $m$-th largest element in $A[i..j]$, for $1 \le m \le k$. A range selection query for an arbitrary range $[i,j] \subseteq [1,n]$ and query parameter $k' \in [1,k]$ asks us to return the index of the $k'$-th largest element in $A[i..j]$. We completely resolve the space complexity of both of these heavily studied problems---to within lower order terms---for all $k = o(n)$. Previously, the constant factor in the space complexity was known only for $k=1$. We also resolve the space complexity of another problem, that we call range min-max, in which the goal is to return the indices of both the minimum and maximum elements in a range.

Motivation & Objective

  • To resolve the space complexity of range top-k and range selection queries to within lower-order terms for all $k = o(n)$, extending beyond the previously known optimal case only for $k=1$.
  • To introduce and solve the new problem of range min-max queries, which return indices of both minimum and maximum elements in a range.
  • To close the gap in the constant factor of the space bound for range top-k encodings, which was previously unknown for $k \geq 2$.
  • To provide a compressed, query-recoverable encoding that stores only the answers to all queries, minimizing space while enabling efficient reconstruction.

Proposed method

  • The approach uses a compressed representation of Cartesian trees to encode solutions to all range top-k queries, leveraging entropy-based compression to minimize space usage.
  • A novel windowed increment structure is introduced to efficiently simulate range queries over blocks, using bit vectors $E_{\text{WIN}}$ to track relative order changes across blocks.
  • The method distinguishes 'good' and 'bad' elements in even blocks—where only 'bad' elements contribute to window increments—reducing the number of 1-bits in $E_{\text{WIN}}$ and thus compressing the encoding.
  • By reversing the array and exploiting symmetry, the number of non-zero bits in the window encoding is reduced from $n$ to $n/2 - o(n)$, improving the leading coefficient in the entropy term.
  • The encoding supports merging of top-k lists from left, middle, and right segments using selective scanning and window increment reconstruction, enabling correct top-k selection across block boundaries.
  • A correction mechanism is added to track good/bad status per block, ensuring accurate select operations on the compressed bit vector with only $o(n)$ additional space.

Experimental results

Research questions

  • RQ1What is the optimal space complexity for encoding all range top-k queries on an array, to within lower-order terms, for $k = o(n)$?
  • RQ2Can the constant factor in the space bound for range top-k encodings be determined exactly for $k > 1$, beyond the known case of $k=1$?
  • RQ3Is there a way to compress the range top-k encoding further by eliminating redundant window increment bits?
  • RQ4Can a new problem—range min-max—be defined and optimally encoded, and does it admit efficient query support?
  • RQ5Can the resulting encoding be augmented with $o(n)$ bits to support $\mathcal{O}(1)$-time queries?

Key findings

  • The paper establishes that the optimal space complexity for range top-k encoding is $(k+1.5)nH(1.5/(k+1.5)) + o(n\lg k)$ bits, improving upon the previous best bound of $(k+2)nH(2/(k+2))$.
  • For the first time, the exact coefficient of $n$ in the space bound is determined for $k > 1$, resolving an open problem posed by Grossi et al. and Navarro et al.
  • The method reduces the number of 1-bits in the window encoding bit vector $E_{\text{WIN}}$ from $n$ to $n/2 - o(n)$ by exploiting symmetry between the array and its reverse.
  • The range min-max encoding is introduced and shown to be space-optimal, and can be augmented with $o(n)$ bits to support $\mathcal{O}(1)$-time queries.
  • The resulting data structure supports range top-k queries in $\mathcal{O}(k^6 \lg^2 n \cdot f(n))$ time for any strictly increasing function $f$, with space $o(n\lg k)$ beyond the entropy term.
  • The approach achieves optimal space usage by combining entropy compression of Cartesian trees with selective window increment tracking, reducing redundancy in the encoding.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.