I/O-efficient data structures for colored range and prefix reporting

Kasper Green Larsen, Rasmus Pagh

TL;DR

This paper presents the first data structure for colored range and prefix reporting that achieves both linear space usage and optimal query time in the I/O model. By abandoning the traditional "indivisibility assumption," the authors use bit-manipulation techniques like Fusion Trees and tabulation to solve a fundamental problem in information retrieval and computational geometry.

What Problem Does This Paper Address?

Imagine you are building a search engine. A user types a prefix like data*. You want to find every unique document that contains a word starting with that prefix. In database terms, this is colored prefix reporting: each document is a "color," and even if a document contains the word "database" ten times, you only want to report that document once.

When datasets are too large to fit in RAM, we use the I/O model, where the goal is to minimize the number of disk blocks (of size $B$) read. The challenge is that existing solutions for this problem were either "space-hungry" (using more than linear space) or "slow" (taking more than the optimal $O(1 + k/B)$ I/Os, where $k$ is the number of unique colors found).

Most previous work operated under the indivisibility assumption, treating data elements as atomic units that can only be compared. This paper asks: what happens if we exploit the fact that computers can actually look at the individual bits of a word?

Methods

The authors achieve their results through a series of clever reductions and data structure augmentations:

  1. Reduction to 2D: They show that 1D colored range reporting can be reduced to a "three-sided" orthogonal range reporting problem in 2D rank space.
  2. External Memory Priority Search Tree (EM-PST): They use a modified version of this standard external memory structure but parameterize it differently to handle small sub-problems.
  3. Breaking Indivisibility: For small sets of points (roughly the size of a disk block), they use Fusion Trees and tabulation. Fusion Trees allow for faster-than-logarithmic searching by operating on bits. Tabulation involves pre-calculating answers for all possible small configurations of points and storing them in a table.
  4. Partial Persistence: They build an insertion-only 1D range reporting structure and make it "partially persistent." This allows them to query the state of the 1D structure at any point in its history, which effectively simulates a 2D query.

Datasets

As this is a theoretical computer science paper focused on algorithmic complexity, no empirical datasets were used. The results are proven mathematically for any set of $n$ points or strings.

Key Insights and Ideas

  • The Power of Bit-Manipulation: The "Aha!" moment is that the indivisibility assumption is a self-imposed shackle. By using Fusion Trees, the authors can perform predecessor searches in $O(\log_B n)$ I/Os even when the branching factor is very high, which is the key to reaching the $O(1 + k/B)$ query bound.
  • Persistence for "Free": The authors found a way to make a data structure partially persistent without the usual space or time overhead, provided the number of updates is relatively small (bounded by the number of bits in a block).
  • Rank Space Simplification: By mapping coordinates to the range $[1, n]$, they can use tabulation techniques that wouldn't be possible in a continuous coordinate system.

Key Results

The paper provides a data structure with the following properties for both colored range reporting and three-sided orthogonal range reporting:

  • Space Usage: $O(n)$ words (Linear space).
  • Query Complexity: $O(1 + k/B)$ I/Os (Optimal).
  • Comparison: This beats previous bests, such as $O(n \lg^2_B n)$ space for the same query time, or $O(n)$ space with a much slower $O(\lg^{(h)}_B n + k/B)$ query time.

Additionally, they provide an optimal solution for top-$k$ colored prefix reporting (reporting only the $k$ most relevant colors) in a "scatter I/O" model that allows for parallel word accesses.

Limitations and Future Work

  • Static Nature: The primary data structures described are static, meaning they are built once and not easily updated. Making these structures dynamic (supporting insertions and deletions) while maintaining optimal bounds remains an open challenge.
  • Model Specificity: The top-$k$ result relies on a "scatter I/O" model, which abstracts modern hardware's parallel capabilities but isn't a standard I/O model.
  • Cache-Obliviousness: The authors suggest investigating whether these results can be achieved in the cache-oblivious model, where the block size $B$ is unknown to the algorithm.
  • The Indivisibility Mystery: It remains unknown if these optimal bounds can be achieved without breaking the indivisibility assumption, though the authors' work suggests that bit-manipulation is likely necessary.

Summary updated

BibTeX
@inproceedings{larsen2012i,
  author = {Kasper Green Larsen and Rasmus Pagh},
  title = {{I/O-efficient data structures for colored range and prefix reporting}},
  booktitle = {SODA},
  year = {2012},
  doi = {10.1137/1.9781611973099.49},
}
Figure