Run Compressed Rank/Select for Large Alphabets

José Fuentes‐Sepúlveda, Juha Kärkkäinen, Dmitry Kosolobov, Simon J. Puglisi · 2018

Given a string of length n that is composed of r runs of letters from the alphabet {0,1,...,σ-1} such that 2 ≤ σ ≤ r, we describe a data structure that, provided r ≤ n/logω(1)n, stores the string in r\log nσ/r + o(r log nσ/r) bits and supports select and access queries in O(log log(n/r)/loglogn) time and rank queries in O(log log(nσ/r)/log\logn) time. We show that r log n(σ-1)/r - O(log n/r) bits are necessary for any such data structure and, thus, our solution is succinct. We also describe a data structure that uses (1 + ε)r log nσ/r + O(r) bits, where ε > 0 is an arbitrary constant, with the same query times but without the restriction r ≤ n / logω(1)n. By simple reductions to the colored predecessor problem, we show that the query times are optimal in the important case r ≥ 2logδ n, for an arbitrary constant δ > 0. We implement our solution and compare it with the state of the art, showing that the closest competitors consume 31-46% more space.

Read the paper · More papers on PaperTik