{
  "slug": "rrr-bitvector",
  "term": "RRR bitvector",
  "aliases": [
    "RRR bitmap",
    "Raman-Raman-Rao bitvector"
  ],
  "definition": "An RRR bitvector represents static bits by each block's number of ones and its pattern within that class, with auxiliary support for rank/select.",
  "note": "Encoding: A b-bit block with k ones has choose(b,k) possible patterns. A fixed-width class uses ceil(log2(b + 1)) bits, and its pattern index uses ceil(log2(choose(b,k))) bits. Query support adds samples and pointers. [practical]\n\nBound: For length n and k ones, the fully indexable dictionary in Lemma 4.1 uses ceil(log2(choose(n,k))) + O(n log2(log2(n)) / log2(n)) bits. Constant-time rank/select assumes the paper's word-RAM model with Theta(log n)-bit words. This is an asymptotic bound, not a file-size formula. [rrr]\n\nExample: At b = 15 and k = 7, there are 6435 patterns: 13 pattern bits plus 4 class bits give 17 bits before query support, versus 15 raw bits. At k = 0 or 15, no pattern bits are needed, but the class still costs 4 bits in this layout. Equal density need not give equal block budgets: two 30-bit examples total 8 versus 34 field bits. These are constructed counts, not library sizes. [example] [layout]\n\nUse: RRR can supply compressed routing bitmaps for sequence indexes. SDSL's rrr_vector is immutable after construction; block size and sampling affect space and access costs. Non-lexicographic offsets offer other decoding trade-offs. [recent] Rank/select conventions remain explicit. [sdsl]",
  "related": [
    "succinct-data-structure",
    "rank-select",
    "wavelet-tree",
    "wavelet-matrix"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-17",
  "citations": [
    {
      "id": "practical",
      "title": "Navarro and Providel: Fast, Small, Simple Rank/Select on Bitmaps, SEA 2012, sections 1 and 3",
      "url": "https://www.dcc.uchile.cl/~gnavarro/ps/sea12.1.pdf",
      "accessed": "2026-11-17"
    },
    {
      "id": "rrr",
      "title": "Raman, Raman and Rao: Succinct Indexable Dictionaries, arXiv:0705.0552v1 (2007), sections 1.1.3 and 4.1",
      "url": "https://arxiv.org/pdf/0705.0552",
      "accessed": "2026-11-17"
    },
    {
      "id": "example",
      "title": "Hesela: exact fixed-width RRR block accounting, illustrative arithmetic only (CC0)",
      "url": "https://hesela.dev/research/rrr-block-budget.mjs",
      "accessed": "2026-11-17"
    },
    {
      "id": "sdsl",
      "title": "SDSL tutorial: compressed immutable bitvectors and rrr_vector parameters",
      "url": "https://simongog.github.io/assets/data/sdsl-slides/tutorial",
      "accessed": "2026-11-17"
    },
    {
      "id": "recent",
      "title": "Donges and Puglisi: Succinct Rank Dictionaries Revisited, SEA 2025, sections 2-4; DOI 10.4230/LIPIcs.SEA.2025.15",
      "url": "https://drops.dagstuhl.de/storage/00lipics/lipics-vol338-sea2025/html/LIPIcs.SEA.2025.15/LIPIcs.SEA.2025.15.html",
      "accessed": "2026-11-17"
    },
    {
      "id": "layout",
      "title": "Hesela: identical density, different RRR field budgets; generated synthetic examples and reproduction (CC0)",
      "url": "https://hesela.dev/research/rrr-layout/README.md",
      "accessed": "2026-11-17"
    }
  ],
  "provenance": [
    "RRR refers to the Raman-Raman-Rao construction; this record uses the full bitvector query contract, not the weaker indexable-dictionary rank operation that returns -1 for an absent key.",
    "The paper's o(k) indexable-dictionary redundancy must not be substituted for the full bitvector O(n log log n / log n) term when k is sparse.",
    "The downloadable calculation counts class and pattern fields only. It does not implement RRR queries, serialization, sampling or updates.",
    "The two 30-bit examples each contain 15 ones. At block size 15, clustered runs give classes 0 and 15; alternating bits give classes 7 and 8. Only class and pattern fields are counted. Headers, padding, sampling and lookup tables are excluded.",
    "A short code for one clustered input does not beat the worst-case bound for all 30-bit strings with 15 ones. The field code has variable total length across that class.",
    "SEA 2025 explores sparse lookup tables, weighted de Bruijn sequences and different offset orders. Its machine-specific access/rank experiments are not Hesela benchmarks or a general select-time guarantee."
  ]
}
