Compressed Prefix Sums

  • Authors:
  • O'Neil Delpratt;Naila Rahman;Rajeev Raman

  • Affiliations:
  • Department of Computer Science, University of Leicester, Leicester LE1 7RH, UK;Department of Computer Science, University of Leicester, Leicester LE1 7RH, UK;Department of Computer Science, University of Leicester, Leicester LE1 7RH, UK

  • Venue:
  • SOFSEM '07 Proceedings of the 33rd conference on Current Trends in Theory and Practice of Computer Science
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

We consider the prefix sumsproblem: given a (static) sequence of positive integers $\vec{x} = (x_1, \ldots, x_n)$, such that $\sum_{i=1}^n x_i = m$, we wish to support the operation ${\sf sum}(\vec{x},j)$, which returns $\sum_{i=1}^{j} x_i$. Our interest is in minimising the space required for storing $\vec{x}$, where `minimal space' is defined according to some compressibility criteria, while supporting sumas rapidly as possible.There are two main compressibility criteria: (a) the succinctspace bound, $B(m, n) = \lceil \log_2 {{m-1}\choose{n-1}} \rceil$ bits, applies to any sequence $\vec{x}$ whose elements add up to m; (b) data-awaremeasures, which depend on the values in $\vec{x}$, and can be lower than the succinct bound for some sequences. Appropriate data-aware measures have been studied extensively in the information retrieval (IR) community [17].We demonstrate a close connection between the data-aware measure that is the best in practice for an important IR application and the succinct bound. We give theoretical solutions that use space close to other data-aware compressibility measures (often within o(n) bits), and support sumin doubly-logarithmic (or better) time, and experimental evaluations of practical variants thereof.A bit-vectoris a data structure that supports `rank/select' on a bit-string, and is fundamental to succinct and compressed data structures. We describe a new bit-vector that is robust and efficient.