Engineering Compact Data Structures for Rank and Select Queries on Bit Vectors

Florian Kurpicz
6/2/2022
31 citations
cs.DS

Official code: pasta-toolbox/bit_vector (37 stars, C++, GPL-3.0, last commit 2025-04-07). 1 more implementation below.

Abstract

Bit vectors are fundamental building blocks of many succinct data structures. They can be used to represent graphs, are an important part of many text indices in the form of the wavelet tree, and can be used to encode ordered sequences of integers as Elias-Fano codes.

Show full abstract

To do so, two queries have to be answered: namely rank and select queries. Given a position in the bit vector, a rank query returns the number of 1-bits before that position. A select query, given a parameter $j$, returns the position of the $j$-th 1-bit. On a length-n bit vector, both queries can be answered in $O(1)$ time and require $o(n)$ bits of additional space. In practice, the smallest (uncompressed) rank and select data structure cs-poppy has a space overhead of $\approx$ 3.51% [Zhou et al., SEA 13]. In this paper, we present an improved rank and select data structure that has the same space overhead but can answer queries up to 8% (rank) and 16.5% (select) faster compared with cs-poppy.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
pasta-toolbox/bit_vectorOfficial37C++GPL-3.02025-04-07
pasta-toolbox/bit_vector_experimentsOfficial2TeXGPL-3.02023-07-04
GPL-3.0

Fast and highly tuned bit vector implementation including space efficient rank and select support having only 3.51% space overhead.

375C++, CMakeOct 20, 20211 years agoGPL-3.0
bitvectorcpprankselectspace-efficiency
GPL-3.0

Experimental setup for our pasta::bit_vector (+ rank and select support) implementation

20TeX, C++Jan 14, 20223 years agoGPL-3.0

Similar Papers

Cite this paper

@article{kurpicz2022engineering,
  title  = {Engineering Compact Data Structures for Rank and Select Queries on Bit Vectors},
  author = {Florian Kurpicz},
  year   = {2022},
  eprint = {2206.01149},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.01149}
}

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/2206.01149.svg)](https://codeofpaper.com/paper/2206.01149)

Discussion