Table of Contents
Fetching ...

(Worst-Case) Optimal Adaptive Dynamic Bitvectors

Gonzalo Navarro

TL;DR

This work tackles the challenge of supporting dynamic updates on bitvectors while keeping space near the static optimum of $n+o(n)$ bits. It introduces adaptive dynamic bitvectors built on weight-balanced B-trees that convert subtrees into static leaves (flattening) when query load warrants, and that split static leaves on updates (splitting) to preserve balance. The main result is a near-optimal amortized time bound $O\bigl(\frac{\log(n/q)}{\log\log n}\bigr)$ for all operations when queries are $q$ times more frequent than updates, and a matching worst-case lower bound in the cell-probe model. The approach yields a versatile framework with broad applicability to dynamic compact data structures, including arrays, wavelet trees, grids, graphs, and text collections, improving efficiency in scenarios with bursty updates or sparse modifications.

Abstract

While operations {\em rank} and {\em select} on static bitvectors can be supported in constant time, lower bounds show that supporting updates raises the cost per operation to $Θ(\log n/ \log\log n)$ on bitvectors holding $n$ bits. This is a shame in scenarios where updates are possible but uncommon. We develop a representation of bitvectors that we call adaptive dynamic bitvector, which uses the asymptotically optimal $n+o(n)$ bits of space and, if there are $q$ queries per update, supports all the operations in $O(\log(n/q)/\log\log n)$ amortized time. Further, we prove that this time is \new{worst-case} optimal in the cell probe model. We describe a large number of applications of our representation to other compact dynamic data structures.

(Worst-Case) Optimal Adaptive Dynamic Bitvectors

TL;DR

This work tackles the challenge of supporting dynamic updates on bitvectors while keeping space near the static optimum of bits. It introduces adaptive dynamic bitvectors built on weight-balanced B-trees that convert subtrees into static leaves (flattening) when query load warrants, and that split static leaves on updates (splitting) to preserve balance. The main result is a near-optimal amortized time bound for all operations when queries are times more frequent than updates, and a matching worst-case lower bound in the cell-probe model. The approach yields a versatile framework with broad applicability to dynamic compact data structures, including arrays, wavelet trees, grids, graphs, and text collections, improving efficiency in scenarios with bursty updates or sparse modifications.

Abstract

While operations {\em rank} and {\em select} on static bitvectors can be supported in constant time, lower bounds show that supporting updates raises the cost per operation to on bitvectors holding bits. This is a shame in scenarios where updates are possible but uncommon. We develop a representation of bitvectors that we call adaptive dynamic bitvector, which uses the asymptotically optimal bits of space and, if there are queries per update, supports all the operations in amortized time. Further, we prove that this time is \new{worst-case} optimal in the cell probe model. We describe a large number of applications of our representation to other compact dynamic data structures.
Paper Structure (29 sections, 17 theorems, 7 equations, 1 figure)

This paper contains 29 sections, 17 theorems, 7 equations, 1 figure.

Key Result

Theorem 1

An adaptive dynamic bitvector starting empty can be maintained in $n+O(n\log\log n / \log n)$ bits of space, where $n$ is the current number of bits it represents, so that if the fraction of updates over total operations so far is $1/q$, then the bitvector operations take $O(\log(n/q)/\log\log n)$ a

Figures (1)

  • Figure 1: Flattening and posterior splitting of a node, the former after receiving over $v.\mathrm{size}$ consecutive queries, and the latter when receiving an update at a static leaf; the leaf is recursively split until the update falls in a dynamic leaf. Circles are internal nodes, round rectangles are dynamic leaves, and gray rectangles are static leaves.

Theorems & Definitions (17)

  • Theorem 1
  • Theorem 2
  • Corollary 1
  • Corollary 2
  • Corollary 3
  • Corollary 4
  • Corollary 5
  • Corollary 6
  • Corollary 7
  • Corollary 8
  • ...and 7 more