Random Access in Grammar-Compressed Strings
Abstract
A Random Access query to a string asks for the character at a given position . This fundamental task admits a straightforward solution with constant-time queries and bits of space when . While this is the best one can achieve in the worst case, much research has focused on the compressed setting: if is compressible, one can hope for a much smaller data structure that still answers Random Access queries efficiently.
In this work, we investigate the grammar-compressed setting, where is represented by a context-free grammar that produces only . Our main result is a general trade-off that optimizes Random Access time as a function of the string length , the grammar size (the total length of productions) , the alphabet size , the data structure size , and the word size of the word RAM model. For any data structure size satisfying , we show an -size data structure that answers Random Access queries in time
We also prove a matching unconditional lower bound that holds for all parameter regimes except very small grammars () and relatively small data structures (). The lower bound applies to word-RAM query time and, more strongly, to the worst-case cell-probe complexity of nondeterministic or bounded-error randomized query algorithms.
Previous work focused on optimizing the query time as a function of only, achieving time using space [Bille, Landau, Raman, Sadakane, Satti, Weimann; SIAM J. Comput. 2015] and time using space for any constant [Belazzougui, Cording, Puglisi, Tabei; ESA 2015], [Ganardi, Jeż, Lohrey; J. ACM 2021]. Our result improves upon these bounds (strictly for ) and generalizes them beyond , yielding a smooth interpolation with the uncompressed setting of bits.
Thus far, the only tight lower bound [Verbin and Yu; CPM 2013] was for , , and . In contrast, our result yields a tight bound that accounts for all relevant parameters and is valid for almost all parameter regimes.
Our bounds remain valid for run-length grammars, where production sizes use run-length encoding. This lets us recover (and, for strings with small run-length grammars, improve) the trade-offs achieved by block trees, formulated in terms of the LZ77 size [Belazzougui, Cáceres, Gagie, Gawrychowski, Kärkkäinen, Navarro, Ordóñez, Puglisi, Tabei; J. Comput. Syst. Sci. 2021] and substring complexity [Kociumaka, Navarro, Prezza; IEEE Trans. Inf. Theory 2023].
Our data structure admits an efficient deterministic construction algorithm. Beyond Random Access, its variants also support substring extraction (with optimal additive overhead for a length- substring, provided that ), as well as rank and select queries.
All our results rely on novel grammar transformations that generalize contracting grammars [Ganardi; ESA 2021] and achieve the optimal trade-off between grammar size and height while enforcing extra structure crucial for constant-time navigation in the parse tree.
Keywords and phrases:
grammar-based compression, straight-line programs, random access problemCategory:
Track A: Algorithms, Complexity and GamesCopyright and License:
2012 ACM Subject Classification:
Theory of computation Data compression ; Theory of computation Cell probe models and lower boundsAcknowledgements:
The authors thank an anonymous reviewer for exceptionally careful reading.Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Random Access is arguably the most basic query one can ask about a string and a fundamental building block of classic string-processing algorithms. For a string and a position , it asks for the -th character of .111We adhere to -based indexing of strings, that is, . For , we denote and . Half-open integer intervals and are defined analogously. In the standard representation of strings as arrays, Random Access trivially takes constant time. For strings over integer alphabets , constant-time Random Access can still be supported using a packed representation in bits thanks to the bit-manipulation operations available in the standard word RAM model. Up to a constant factor, this simple data structure matches the information-theoretic lower bound of bits.222All logarithms in this work are binary unless another base is provided. More advanced tools [15] come even closer, achieving bits.
The complexity landscape of Random Access queries becomes much more interesting in the compressed setting, where we aim to achieve much smaller data structures for some “compressible” strings at the price of marginally larger data structures for the remaining “incompressible” strings. Every injective function can be seen as a compression method, but few such functions admit an efficient query algorithm for Random Access. In particular, the most popular compressors such as arithmetic coding [27], Lempel–Ziv parsing [53], or run-length encoded Burrows–Wheeler transform [8] do not natively support Random Access in time. Since Random Access is needed for most string-processing algorithms, a lot of research has been devoted to understanding how much extra space is needed to enable such support. This question formally asks what trade-offs are possible between the data structure size and its Random Access query time, where both complexities are measured not only in terms of the length and alphabet size of the input string but also a parameter capturing the size of its compressed representation.
In this work, we focus on the so-called highly-compressible regime, where typical space complexities are of the form or rather than . In this setting, a clean formalization that captures many compressors is grammar-compression [46, 32]: the input string is encoded using a context-free grammar that produces and no other string. Such a grammar is a straight-line grammar (SLG) because it cannot use circular dependencies between variables or define multiple productions for the same variable. The underlying compressibility measure, denoted , is the size (total production length) of the smallest grammar generating . A long line of works has aimed to understand the complexity of Random Access in SLG-compressed strings:
SLG Random Access
Parameters:
Input: A string represented by an SLG of size at most .
Queries: Given a position , return .
Time-space trade-offs for this problem are inherently related to the trade-offs between the grammar height (the height of the underlying parse tree, i.e., the worst-case number of productions needed to derive a given character of ) and its size. In 2002, parallel works of Charikar et al. [9] and Rytter [47] showed that if is produced by an arbitrary SLG of size , it is also produced by a balanced SLG of height and size . This immediately implies -time Random Access using a data structure of size .333We state all results in the word RAM model. In the introduction, we typically use word size , and we measure space complexities in machine words. Later on, we switch to bits and treat as a separate parameter. A decade later, a breakthrough of Bille et al. [7] achieved -time Random Access using space. On the lower-bound side, an influential work of Verbin and Yu [51] showed that an -space data structure cannot support -time Random Access in their hard regime. Shortly afterward, Belazzougui et al. [5] proved that query time is achievable in space for balanced SLGs and any constant . In a recent milestone, Ganardi, Jeż, and Lohrey [24] showed every SLG can be balanced while keeping its size at ; this immediately recovers the trade-off of [7] and proves that the trade-off of [5] is valid for every SLG. More generally, one can answer Random Access queries in time using space for .
A common limitation of all these previous works is that they measure the Random Access time as a function of only. The lower bound of [51] is only valid when ,444Verbin and Yu [51] also prove a separate lower bound for a particular value , which depends on and the data structure size . That result only shows that the query time is at least . so we can hope for faster queries for the cases of and, much more importantly for applications, . Moreover, neither the lower bound nor the upper bound applies to data structures of size exceeding . In this work, we aim to characterize what trade-offs are possible.
What is the optimal Random Access time in grammar-compressed strings, as a function of string length , grammar size , alphabet size , and data structure size ?
On the positive side, we show that, for any , Random Access queries can be answered in time555In the introduction, we follow the convention that time complexity should be read as . using space. Phrased in terms of rather than , this reads as follows:
Theorem 1.1.
Let be an SLG of size generating a string . In the word RAM model with word size , given and any value with , one can in time construct an -size data structure supporting Random Access queries in time
Already in the regime of space, we improve the query time from to . Our time bound smoothly interpolates between logarithmic for and constant for . Since every string can be produced by an SLG of size , we recover the standard uncompressed bound: time using bits. Allowing more space, we generalize the trade-off of [5] beyond and strictly improve upon it when . In particular, we get query time already using bits for a constant .
On the lower-bound side, our main result is that the query time of Theorem 1.1 is optimal for all parameter regimes except for very small grammars and relatively small data structures.
Theorem 1.2.
Consider integers and a real constant such that , , , and . Suppose that, for every instance of SLG Random Access with parameters , there is a data structure of -bit machine words that answers each query by accessing of these machine words. Then,
This bound remains valid for nondeterministic and randomized data structures with two-sided error.
In the most studied setting of , our tight lower bound applies to all grammar sizes except and all data structure sizes except . As noted already in [51], is a natural barrier: if for some constant , then the query algorithm could read the entire grammar using memory accesses. The limitation is shared with most static data-structure lower bounds, which typically capture space complexity only up to sub-logarithmic factors, except for a handful of isolated problems; see [35]. Whether query time can be achieved in space remains a long-standing open problem.
Beyond SLGs.
In [10, 39], the -time -space trade-off for SLG Random Access [7, 24] has been generalized to run-length straight-line grammars (RLSLGs) [40], which differ from SLGs in that production sizes are measured in terms of run-length encoding size rather than length. Equivalently, in RLSLGs, productions of the form for are assumed to be of size one. The size of the smallest RLSLG generating satisfies , so RLSLG Random Access is at least as hard as SLG Random Access, and the lower bound of Theorem 1.2 generalizes automatically. Even though we are not aware of any previous work generalizing the trade-off of [5] to RLSLGs, in [18, Section 6] we state and prove our upper bound of Theorem 1.1 already in the stronger RLSLG variant (without any penalty).
A notable advantage of is that it is a tighter upper bound of further measures, including the LZ77 size [53] and the substring complexity [45, 33], which satisfy . In particular, , and the first of these bounds fails for [33]. Thanks to this characterization of , Theorem 1.1 recovers the Random Access trade-offs of block trees formulated in [4, 33] using and , respectively. Moreover, we derive from Theorem 1.2 that these trade-offs are optimal, as functions of and , respectively, in a wide range of parameter regimes.
Corollary 1.3 (see [18, Section 9]).
For every string and all parameters , , and , there is a data structure of size supporting Random Access queries in time . This query time is optimal if , , and for a constant , even restricted to strings satisfying .
Beyond Random Access.
Many previous data structures for (RL)SLG Random Access support extracting not only individual characters but also substrings of of arbitrary length , with the additive time overhead of [7, 10, 39] or, if the substring is returned in the packed representation, [5] or [4, 33]. We generalize Theorem 1.1 to achieve the optimal overhead of . Moreover, ours is the first solution that outputs the packed representation and comes with an efficient construction.
Theorem 1.4.
Let be an RLSLG of size generating a string . In the word RAM model with word size , given and any value with , one can in time construct an -size data structure that extracts any length- substring in time
More generally, we support fast character iterators that, upon initialization at position , can in constant time move in either direction by positions and output the characters at the intermediate positions. None of the previous works achieves this without amortization for .
Our approach readily generalizes to computing various aggregate information about the prefixes of , modeled by the prefix sum problem in which every character is mapped to an element of a monoid. In particular, similarly to [7, 5, 24, 39, 10, 33], we support rank and select queries, asking for the number of occurrences of a given character in the prefix and the position of the -th leftmost occurrence of in , respectively.
Theorem 1.5.
Let be an RLSLG of size generating a string . In the word RAM model with , given and any value with , one can in time construct an -size data structure supporting and queries in time
For constant alphabet size , this result matches our time-space trade-off for Random Access. It is also straightforward to see that, already for , rank and select queries are at least as hard as Random Access,666For rank, note that if and only if . For select, we map through a morphism and , preserving and up to a constant factor. The resulting string satisfies . so our bounds remain tight for almost all parameter regimes. The only penalty that we suffer already for is the extra term in the construction algorithm. As we discuss in [18, Section 8], this term arises only for select, and only when . It is an artifact of our usage of Elias–Fano encoding [19, 20], which currently lacks an efficient construction from the packed input representation using variable-length gap encoding.
In general, similarly to all previous data structures in grammar-compressed space, ours suffers from a -factor overhead in space complexity (and construction time). Reducing this overhead, possibly at the cost of slight increase in the query time, remains a major open question. As noted in [5, Section 6], this would require breakthroughs for counting paths between DAG vertices.
1.1 Our Techniques
We prove Theorems 1.1, 1.4, and 1.5 by converting the input (RL)SLG into an equivalent shallow grammar that admits fast navigation in its parse tree. Let be an (RL)SLG and let be a symbol (variable or terminal). We write for the right-hand side of its production (a string over ) and for its full expansion (the unique string over terminals derived from ).
Random Access can be implemented recursively. Suppose is a variable with production , and we are asked to retrieve . Then there is a unique such that , and the query recurses on the symbol and the shifted index . We denote the task of finding this by . It is a rank query over the prefix sums , asking for the number of such sums that are at most .
Grammar balancing [24] yields grammars of height , size , and production lengths , leading to -time Random Access in space. To reduce the query time to , we would like to decrease the height to by creating a new length- right-hand side of the starting symbol . This is where our first obstacle appears: even if every variable has recursion depth , a natural process starting with and exhaustively replacing all symbols longer than by their right-hand sides may create a sequence of symbols, exceeding space. We avoid this by working with contracting grammars [23], where a variable can appear on the right-hand side of a variable only if . We show in [18, Lemma 5.11] how this implies that the same process produces a sequence of symbols of length at most , thus reducing to a rank query on an -element set of prefix sums. This query can then be implemented in time [7] or even in time [3].
For a more general trade-off with query time, we want to similarly increase the fan-out of every other variable to so that the height becomes . Here, an obstacle is that we have to implement in constant time in order to avoid extra factors in Random Access time. This is possible for using fusion trees [21], which is why the previous trade-offs [5] were limited to small . Our key structural notion is -niceness ([18, Definition 5.10]): as for the start symbol, we replace by a longer right-hand side of symbols of length at most each. Crucially (see [18, Lemma 5.11]), the contracting property of implies a strong locality condition: any substring of of length at most intersects only consecutive symbols of . Thus, by storing the answers to evenly spaced rank queries, we reduce every to a rank query in a set of size , which we answer in constant time using fusion trees (see [18, Lemma 6.1]). Combining this with a standard shortcut (storing explicitly whenever ) yields the trade-off of Theorem 1.1. The approach extends to RLSLGs once we generalize the transformation of [23] appropriately ([18, Corollary 5.8]; a parallel work [11] achieves almost the same generalization).
Substring Extraction.
To extract any substring of with constant delay per character using an -size data structure, we could simply use the character iterators of [25] or [37], with slight adaptations to support RLSLGs and have construction time matching our Random Access. Outputting blocks of characters with constant delay is much more challenging; see [5]. The underlying issue is that a long variable may contain a very short child (even of constant expansion length), so a character-by-character traversal cannot be turned into a block-by-block traversal by local shortcuts alone. We address this by converting into a -leafy grammar: leaf variables have expansion length , while the remaining top variables have constant-size right-hand sides over top and leaf variables only. Treating leaf variables as terminals yields a grammar for a shorter string of length , whose characters represent blocks of characters of . Hence, standard character iterators can output one leaf per step, i.e., characters at a time. To preserve lengths under this reinterpretation, we lift most constructions to weighted strings, assigning each leaf a weight equal to its original expansion length. This is how we prove Theorem 1.4.
Prefix Aggregation, rank, and select.
Prefix aggregation queries can be handled similarly to Random Access: during the same root-to-leaf traversal, we maintain the monoid aggregate of the already traversed prefix, yielding time once is supported in constant time. The query is the special case where each character is mapped to or and the aggregate is the sum. As in previous works [5, 43], for , we first transform so that each character encodes a block of non- characters followed by an , reducing select to a prefix aggregation query on the transformed string. Obtaining the bound in Theorem 1.5 (with in the denominator) requires a succinct structure for the leaf variables; we use Elias–Fano encoding [19, 20].
Lower Bound.
We prove Theorem 1.2 in the nondeterministic cell-probe model, formulated in terms of certificates by Wang and Yin [52], as well as in the randomized cell-probe model with two-sided bounded error. We use a reduction from Blocked Lopsided Set Disjointness (BLSD) [41], extending the construction of Verbin and Yu [51] behind the lower bound discussed in Footnote 4 by introducing a tunable splitting parameter . The key idea is that, instead of answering a single BLSD query using one Random Access query in a highly compressible string (), we answer it using Random Access queries in a moderately compressible string (roughly ). This simple idea not only recovers the other lower bound of [51] (for ) but also readily generalizes it to almost all parameter regimes. The original proof of Verbin and Yu [51] also ultimately relies on the hardness of BLSD, but it passes through a several-step chain of reductions from [41, 51]. In the randomized setting, errors could accumulate across all Random Access queries, so our reduction uses an extra subroutine that repeats some queries using multiple copies of the data structure in order to derive a bounded-error communication protocol for BLSD that violates the lower bound of [41]. No such subroutine appears in [41], which is why their randomized cell-probe lower bounds only work in the zero-error models. In the nondeterministic setting, this issue disappears; the remaining annoyance, shared with the randomized setting, is the amount of calculations needed to map between all the parameters in the reduction.
1.2 Related Work
Random Access has been studied from a multitude of perspectives for dozens of compressibility measures . Early milestone results provide constant-time random access to entropy-compressed strings, achieving bits for binary strings [44] and bits for strings over larger alphabets [48] (for ); see also [26] for a survey. Unfortunately, low-order entropy does not capture large-scale repetitions, and the lower-order terms in these data structures are relatively large, which makes them unsuitable for highly compressible strings. That regime brings a whole zoo of compressibility (repetitiveness) measures; see [38] for a dedicated survey, which discusses which measures support efficient random access. In space , the best one can typically hope for (in highly compressible strings) is Random Access time: see [13] for a work that generalizes the lower bound of [51] to many measures that are not bounded by . An exception is LZ78 [54], for which -time access is possible [16]. Unfortunately, it is not known how to support Random Access queries efficiently (e.g., in time) in space proportional to the size of the LZ77 parsing or of the run-length encoded Burrows–Wheeler transform. The latter is particularly surprising given -space data structures supporting pattern-matching queries [22], which often makes Random Access the sole bottleneck; see [2]. There exists, however, a trade-off between Random Access time and an additive term on top of a succinct encoding of [50]. The lack of efficient access in space motivated the introduction of more restricted variants like LZ-End [34], which support Random Access in time [31], height-bounded LZ [1], bounded-access-time LZ [36], and LZBE [49]. Further works for Random Access in grammar-compressed strings include schemes providing faster access to characters that are close to static bookmarks [12] or dynamic fingers [6, 23], or located in incompressible regions [11]. Very recently, Random Access has also been studied for two-dimensional grammar-compressed strings [14].
1.3 Open Problems
The most important open problem about grammar-compressed Random Access remains whether -time queries can be achieved in space for any . We hope that our direct reduction from BLSD will inspire renewed efforts to tackle this question from the lower-bound side. A more structured variant that seems as difficult as the general case is when each production is of length two and each expansion length is a power of two; in that case, no balancing is needed and queries remain trivial for every . With appropriate parameters, our lower bound of Theorem 1.2 only produces grammars of this form, albeit ones supporting -time queries.
Another task stemming from the limitations of Theorem 1.2 is to understand whether SLG Random Access becomes easier for very small (e.g., ) in the word RAM model.
Since every SLG can be encoded in bits, for very small grammars () it is also open to achieve efficient (e.g., polylogarithmic-time) Random Access queries in bits.
Compressibility measures closely related to pose many further interesting and long-standing problems. In particular, it is not known how to answer Random Access queries in time and in or space (where is the number of runs in the Burrows–Wheeler transform).
Very recently [30], lower bounds for moderately compressible strings have been proved for many queries beyond Random Access, including suffix array and inverse suffix array queries. Can one generalize these lower bounds to almost all parameter regimes, similarly to Theorem 1.2? Further queries, such as Longest Common Extension and Internal Pattern Matching, are at least as hard as Random Access, so the lower bounds translate automatically. However, for those queries it remains open if the existing upper bounds [28, 29, 17] (formulated in terms of or ) can be improved for weakly compressible strings and generalized to smooth interpolations with the uncompressed setting, in the spirit of Corollary 1.3.
Finally, we leave for future work whether our techniques can help in settings where the characters at some positions are supposed to be more easily accessible than others, e.g., due to bookmarks [12] or fingers [6, 23]. Currently, we only achieve this functionality by varying character weights, but the weight needs to be the same across occurrences of the character.
2 Preliminaries
Let be some finite set. Let . We call a string (or sequence) of length over the alphabet . We use character notation for and substring notation for .
Let for character and integer denote the -fold repetition of ; we also refer to it as the -th power of . Given any sequence , where for and for , we define its run-length encoding . Note that .
Straight-Line Grammars.
We call a weighted straight-line grammar (SLG) with variables , terminals , right-hand sides , start symbol , and weight function if there is an order on such that holds whenever appears in . We call the set of symbols. When clear from context we drop the subscript . The size of an SLG is the sum of the lengths of all right-hand sides.
Straight-line grammars whose right-hand sides are stored in run-length encoded form are called run-length straight-line grammars (RLSLGs). Their semantics are unchanged; only the size is measured as the sum of the lengths of the run-length-encoded right-hand sides. Whenever we construct an (RL)SLG from another (RL)SLG, we assume that if the input is an SLG (i.e., without runs), then the output is also an SLG. Usually, we bound the size of every individual rule. Note that this size is measured differently for SLGs and RLSLGs.
The expansion of a terminal is . We extend expansions recursively to variables and sequences of symbols:
We say that a symbol or a sequence of symbols expands to the string . The grammar produces the string . It defines the strings for all .
Let denote the set of strings defined by . If , then we say that defines all strings defined by . We call the function a grammar homomorphism from to if holds for every . The existence of such a homomorphism implies .
If the weight function is not stated explicitly, we assume it is the unit function . We call such a grammar unweighted. We extend the weight function recursively to variables and sequences of symbols:
For every sequence of symbols , the property holds.
The height of every symbol is also defined recursively:
Parse Trees.
We call the following directed graph the parse tree of a weighted SLG. Here, each node is a pair consisting of a symbol and a weighted offset into the expansion of the start symbol.
Definition 2.1.
Let be an (RL)SLG. We call the directed graph the parse tree of if it is the smallest graph such that:
-
1.
contains a node ;
-
2.
for every node with and , and for every , the parse tree contains a node and an edge .
Note that, for every node of the parse tree , the height is equal to the number of edges of the longest path from to a leaf of (the height of the subtree rooted at ).
3 The Upper Bounds: Overview
This section overviews [18, Sections 5 to 8], which contain the upper-bound proofs behind Theorems 1.1, 1.4, and 1.5. As discussed in Section 1.1, the core theme is to transform an input grammar into a form that admits constant-time local navigation, while keeping the grammar shallow and the overall size under control. All transformations are phrased in terms of grammar homomorphisms, so they preserve expansions and let us switch to more structured grammars producing the same strings.
Random Access in Weighted Strings and Parse-Tree Viewpoint.
Most of our results are stated for strings over weighted alphabets . In that setting, a random access query is given and returns for the unique position such that . If needed, we can also output the offset and the position .
Random Access in a string produced by an (RL)SLG corresponds to descending the parse tree : we maintain a node with and repeatedly move to the child whose interval contains , until a terminal is reached [18, Algorithm 1]. This transition step is implemented by a query. For , reduces to a rank query in on input ; see [18, Lemma 6.1]. Thus, the overall query time is governed by (i) the per-node cost of and (ii) the depth of ; the goal is to optimize both.
Contracting Grammars.
The first step is to obtain a grammar in which every variable shrinks in a controlled way along parse-tree edges. Ganardi [23] introduced contracting SLGs, requiring that every child of a variable satisfies . He proved that every SLG can be homomorphically embedded into a contracting SLG of size and production lengths bounded by some constant . Although the final result in [23] is established for the unweighted case, the key ingredients of its proof already use weighted SLGs. In [18, Theorem 5.5], we extend the statement and the remaining arguments to fully incorporate the weighted perspective. This extension makes it easy to lift the result to RLSLGs in [18, Corollary 5.8].777A parallel independent work [11] proves the same result, albeit for unweighted RLSLGs only. We treat these results as black boxes, relying only on the constant bound on right-hand side size (number of symbols or runs of symbols).
From Contracting to Nice.
The contracting property already implies logarithmic height for every symbol , but to obtain the desired trade-off we need faster shrinkage. For , a child of is -heavy if , and -light otherwise; see [18, Definition 5.9]. We also impose a local regularity condition that later yields -time implementation.
In [18, Definition 5.10], we call a variable -nice if:
-
(a)
every variable child in is -light;
-
(b)
has at most runs (or symbols, for SLGs);
-
(c)
every substring of of weight at most has at most runs.
The key construction in [18, Lemma 5.11] starts from a contracting grammar and replaces by a sequence , obtained by exhaustively replacing all -heavy children with their right-hand sides. The construction runs in time and ensures (b) and (c); its proof is an induction on via the recursion . The only difference between and is that -heavy children are replaced by their right-hand sides; thanks to the contracting property, these replacements can happen in parallel, and there are of them in total and in a substring of weight at most . Each replacement produces at most runs, so the bounds in (b) and (c) grow by and compared to .
We apply this process to all variables, with for the starting symbol and for the remaining ones, to obtain what we call a -nice grammar of size . In the resulting parse tree, the depth of every node is at most ; see [18, Lemma 5.14].
Leafy Grammars: Packing Characters per Leaf.
To exploit bit-parallelism when is small, we introduce -leafy grammars; see [18, Definition 5.15]. Here variables split into: leaf variables expanding to explicit terminal strings of length in , and top variables whose right-hand sides contain only (top and leaf) variables. The top part treats leaf variables as terminals and captures the global structure, while leaf variables store the explicit blocks (packed into bits, so words for our choices of ). The construction in [18, Lemma 5.17] guarantees and runs in time : we maintain only helper variables per original variable and generate each explicit block directly as a packed string. The produced top rules have a deliberately restricted form: the homomorphic image of each variable of with expansion length at least is a top variable whose right-hand side consists of at most two leaf variables plus possibly a middle top variable in between, and every helper top rule has constant run-length size. This prevents the parse tree from containing long chains of tiny explicit pieces and is the structural reason why the traversal routines in [18, Section 7] can output characters per step.
We then combine leafiness with niceness: [18, Corollary 5.18] builds, from an unweighted RLSLG, a -leafy grammar whose weighted top part is -nice; this is where we need the preceding niceness construction to work for weighted strings. Leafiness yields a further height reduction, giving a height bound of .
Constant-Time Queries from Niceness.
After the above transformations, the remaining algorithmic bottleneck is answering at a -nice variable . [18, Lemma 6.1] shows that we can preprocess in time into bits so that is answered in time. At a high level, we store the run-length encoding and the cumulative run boundaries (prefix weights of runs). Then reduces to computing the rank of in the set of run boundaries plus arithmetic operations (integer division) to locate within the run. Condition (c) in -niceness implies a local sparsity property: every interval of weighted length intersects only run boundaries. This enables a standard bucketing strategy: we partition the universe into buckets, and inside each bucket store the boundaries in a constant-time rank structure (fusion tree [21, 42]). The total size of the buckets is still , so these rank structures take bits in total, and they can be constructed in total time.
Random Access: Putting It Together.
For weighted strings, [18, Lemma 6.3] constructs a -nice grammar and the per-variable structures, and then answers queries by the parse-tree traversal above. The time becomes the nice height bound, namely for the returned character . For unweighted , we additionally apply the leafy transformation with so each leaf block fits in words (when ), yielding [18, Lemma 6.4] and the trade-off in Theorem 1.1. We also prove a weighted analog of [18, Lemma 6.4] in [18, Theorem 6.5].
Traversal and Substring Extraction.
[18, Section 7] generalizes random access to a pointer interface that supports constant-time forward/backward traversal. For weighted strings, we show how to traverse characters one by one, building upon [37]. For unweighted strings over small alphabets, we crucially exploit -leafy grammars. The key is to apply character pointers to the weighted top string while maintaining an offset inside the current explicit leaf block; a character pointer to is represented as “(a pointer to ) + (an offset in the current block)”. Because each leaf block has length and is stored packed, each traversal step can return characters in constant time. As a result, [18, Corollary 7.10] supports extracting consecutive characters around a position in time , with construction time matching the random-access trade-off; [18, Corollary 7.11] turns this directly into substring extraction. The final bounds choose , so the block operations fit in words and the additive extraction term becomes .
Rank/Select via Prefix Sums.
Finally, [18, Section 8] lifts the entire framework from extracting characters to computing arbitrary monoid-valued aggregates. Given a mapping , prefix-sum queries ask for . [18, Lemma 8.4 and 8.5] mirror Random Access: we store for each variable the monoid value of its expansion and combine it along the traversed path. Rank follows by instantiating appropriately (mapping a queried character to and the rest to ). For select, we first transform the string so that each character encodes the number of non-occurrences between consecutive occurrences (i.e., a block of non- characters followed by an ), reducing to a prefix-sum query on the transformed string; see [18, Lemma 8.9]. To obtain the tightest bounds, we additionally build succinct rank/select structures for the short leaf blocks: we use constant-time rank within packed bitmasks and constant-time select in the Elias–Fano encoding ([18, Facts 8.1 and 8.2]), so the extra work and storage at leaves do not introduce additional overhead.
4 The Lower Bound
In this section, we prove cell-probe lower bounds for SLG Random Access against both nondeterministic and bounded-error randomized query algorithms. The lower bounds share the high-level structure and many steps, so we present them in parallel. We first explain the formal settings.
Any data structure problem can be modeled as a function , where is a query, is an input, and is the correct answer. A deterministic cell-probe data structure with cells of bits consists of an encoding
and a query algorithm that probes at most cells. Formally, the query algorithm is given by probe functions and an output function , where
For a fixed query and input , the probed addresses are
and the returned answer is
Correctness means for all and .
In the nondeterministic cell-probe model, the query algorithm additionally receives a hint from an unbounded domain. Equivalently, the functions , and hence also the derived outcome function , receive as an extra parameter. Moreover, the output function is allowed to return an extra value . Correctness requires that for every query and input ,
-
there exists a hint such that , and
-
for every hint , either or .
Since hints are unbounded, we may assume that a hint specifies the probed cells together with their expected contents, and the algorithm outputs as soon as one probe disagrees with the hint. Thus, a successful hint is simply a set of cells whose contents determine the answer uniquely. This leads to the notion of certificates due to Wang and Yin [52].
Definition 4.1 (Certificates [52]).
A data structure problem has -certificates if there exists a function such that, for every query and every input , there exists a set with such that, for every , if for all , then .
In the randomized setting, the data structure and the query algorithm share a random seed drawn uniformly from a finite domain . Formally, both and the functions receive as an extra argument. Hence the derived outcome function also depends on . The correctness requirement is that, for every and , we have .
Definition 4.2.
A data structure problem admits an -bounded-error structure if there exist a finite seed domain , an encoding , probe functions for , and an output function such that for every and .
We will reduce Blocked Lopsided Set Disjointness to SLG Random Access. Recall that, in Lopsided Set Disjointness (LSD), the goal is to decide whether two sets and over a common universe are disjoint. In the data-structure version, one of the sets, say , can be preprocessed, while the other set is revealed at query time. In Blocked LSD (BLSD), the universe is partitioned into blocks of size , and the set must contain exactly one element from each block. Equivalently, an instance of BLSD can be represented by functions and , so that, for each , the value specifies the unique element of in the -th block, whereas specifies the intersection of with that block.
Blocked Lopsided Set Disjointness (BLSD) [41]
Parameters:
Input: A function .
Queries: Given , decide if there exists such that .
Wang and Yin [52, Theorem 26] proved a certificate lower bound for 2-Blocked-LSD, which imposes an additional distinctness condition within every group of consecutive blocks, namely whenever . Since this is a more restrictive version of BLSD, it yields the following lower bound for BLSD as well:
Corollary 4.3.
Consider such that , and a real constant . If BLSD with parameters has -certificates, then or .
For a lower bound against randomized algorithms, we interpret BLSD as a communication problem with two players: Alice, who receives , and Bob, who receives . Pătrașcu [41] proved asymmetric communication complexity lower bounds for this problem:
Theorem 4.4 ([41, Theorem 1.4]).
Consider and a real constant . In any bounded-error communication protocol for BLSD with parameters , Alice sends at least bits or Bob sends at least bits.
Next, we reduce BLSD to SLG Random Access. We follow the encoding of Verbin and Yu [51] with a crucial extension that allows answering a single BLSD query using several Random Access queries. The following lemma captures the original reduction of [51].
Lemma 4.5 ([51, Lemma 2]).
Let . For every function , there exists an SLG of size at most producing a binary string of length such that, for every function , we have
Our generalization splits the input BLSD instances into smaller subinstances before applying Lemma 4.5. The parameter controls the number of Random Access queries needed to answer one BLSD query. While keeping the compressed size of the produced string at , this allows reducing the length of from to . As a result, we obtain a smooth trade-off between storing explicitly ( bits) and storing the answers to all queries explicitly ( bits).
Lemma 4.6.
Let . For every function , there exists an SLG of size at most that produces a binary string of length such that, for every function , we have
Proof.
Given a BLSD instance of blocks of size each, we split the instance into parts of consecutive blocks each. Each such part, indexed with , corresponds to blocks and, after shifting this interval by , can be interpreted as a BLSD instance of size . Lemma 4.5 yields a binary string of length produced by a grammar of size at most such that
The final string is the concatenation ; since , this immediately yields the claimed equivalence. Moreover, and is produced by a grammar obtained by taking a disjoint union of grammars and introducing a new start symbol (with a production of length ) capturing the top-level concatenation. The total size of is at most .
Example 4.7.
If , then the universe consists of four blocks of size two, which we split into two subinstances on blocks and . The reduction builds a string of length , where each has length . Consider the following instance:
Here, the first subinstance has hits exactly for , so . Likewise, the second subinstance has hits exactly for , so . Thus, . For a query , the two accessed positions are
For instance, if , then , so the BLSD answer is . On the other hand, if , then , so the BLSD answer is .
With this reduction, we can translate certificates for random access into certificates for BLSD.
Corollary 4.8.
Consider such that . If SLG Random Access with parameters , , and has -certificates, then BLSD with parameters and has certificates.
Proof.
Consider a BLSD input and the corresponding string obtained using Lemma 4.6. By construction, this string is an SLG Random Access instance with parameters , , and . We use the hypothetical SLG Random Access data structure for as a data structure for BLSD queries in . By Lemma 4.6, every BLSD query to can be answered using random access queries to , asking for for some positions indexed with . By our assumption, for each , there is a certificate of size that determines the value of . Taking the union , padded with arbitrary elements to reach size , we obtain a certificate that determines for all , and hence also their disjunction. By Lemma 4.6, this disjunction is exactly the BLSD answer, that is, whether holds. Thus, BLSD with parameters and has -certificates.
In order to derive a counterpart of Corollary 4.8 for bounded-error randomized data structures, extra care is needed to avoid accumulating error probabilities from multiple random access queries used to answer a single BLSD query. In [41], similar one-to-many reductions miss analogous error analysis and thus almost all cell-probe lower bounds hold only against zero-error query algorithms. The central piece that allows supporting bounded-error structures is the following abstract result.
Proposition 4.9.
Consider a bit sequence and a randomized oracle that, given any subset , returns bits such that for every . The returned bits may be arbitrarily dependent within a single oracle call, but the randomness used by different oracle calls is independent. Then, the disjunction can be computed correctly with probability at least using oracle calls, where the th oracle call is made on a subset of size .
Proof.
Our high-level strategy is to maintain and gradually shrink a subset such that . Each step of this process is implemented using the following subroutine:
Claim 4.10.
There exists a randomized procedure that, given a set and an integer , uses at most oracle calls, all on the set , and returns a subset satisfying
Proof.
If , we return , which satisfies all requirements. Henceforth, suppose .
We make independent oracle calls on . For every , let be the majority value among the obtained bits . Construct , and return an arbitrary subset of size .
For every and every , let indicate whether the -th returned bit for is wrong. Then , and the random variables are independent. Since implies , Hoeffding’s inequality yields
Since , we conclude that the following holds for every :
If , then every subset satisfies . It remains to consider the case . Define the set of false positives
Then, , and by Markov’s inequality,
Moreover, for a fixed with , we have
Hence, with probability at least , we have both and . Conditioned on this event, contains at least one true positive and strictly fewer than false positives. Therefore, every subset of of size still contains a true positive, and so the returned set satisfies .
Let us continue with the proof of Proposition 4.9. We define and construct a descending sequence of sets so that, for each , the set is obtained from by applying Claim 4.10 with parameter .
Since holds for all positive integers , an induction on shows that
holds for every and, in particular,
If , we output . Otherwise, we make independent oracle calls on the singleton set , and output the majority value among the obtained estimates for the unique element of .
If all reduction steps succeed, then . By Claim 4.10 and the union bound, the probability that all reduction steps succeed is at least
The final majority vote on is correct with probability at least , after increasing the hidden constant in its repetitions if necessary. Therefore, the overall success probability is at least .
It remains to justify the complexity bound. In batch , the algorithm queries the set , which we know to be of size , and it makes oracle calls. The number of oracle calls used in the reduction steps is proportional to
Together with the final singleton calls, this gives oracle calls in total.
Finally, enumerate all oracle calls in chronological order. If the th oracle call belongs to batch , then the first batches contain only oracle calls in total, so , and therefore . Hence, this call is made on a subset of size . If the th oracle call is one of the final singleton calls, then , and its queried set has size , after decreasing the constant hidden in the exponent if necessary.
We are now ready to provide a counterpart of Corollary 4.8 for bounded-error data structures.
Corollary 4.11.
Consider such that . Suppose that SLG Random Access with parameters , , and admits an -bounded-error data structure. Then, BLSD with parameters and admits a bounded-error communication protocol in which Alice sends bits and Bob sends bits.
Proof.
Fix a BLSD input held by Bob. Let be the binary string produced from using Lemma 4.6. This string constitutes an SLG Random Access instance with parameters , , and ; by assumption, it thus admits an -bounded-error data structure.
For the BLSD query , held by Alice, and for every , define
By Lemma 4.6, the BLSD answer is exactly . Hence, by Proposition 4.9, it suffices to implement the oracle from that lemma with communication costs matching the claimed bounds.
Consider one oracle call on a subset . Using public randomness, Alice and Bob sample one random seed for the data structure. Bob constructs the data structure , and together they simulate all Random Access query executions asking for the positions for . The seed is sampled independently for each oracle call, so different oracle calls are independent. Within one oracle call, the queried bits may be dependent, which is allowed by Proposition 4.9.
We simulate the probe rounds in lockstep. In round , Alice knows the queried positions , the seed , and all answers received in earlier rounds. Hence, she can determine the set of all memory cells that at least one of the queries requests in round . Since , the number of possibilities for is so Alice can encode using bits and send this encoding to Bob. Bob replies with the contents of the cells in , in a canonical order, using bits. After rounds, Alice can reconstruct the outputs of all simulated Random Access queries for .
For each , the value equals with probability at least , because each simulated query is exactly one execution of the bounded-error Random Access data structure on . Thus, this simulation realizes the oracle required by Proposition 4.9.
Consequently, Proposition 4.9 yields a bounded-error algorithm for , and hence for the BLSD answer, that uses oracle calls in total. By Proposition 4.9, there exist constants such that the subset size in the th oracle call satisfies for each . The total number of bits sent by Bob is therefore at most
For Alice, the total communication is
We choose so that for every and utilize the fact that is increasing on and decreasing on .
For , we use only the trivial bound to obtain
because implies .
For , we use to obtain
Since the series and converge, the tail contributes
Adding the values of , we conclude that Alice sends bits, as claimed.
We also need a technical claim about the monotonicity of SLG Random Access, proved only in the full version [18].
Lemma 4.12 ([18, Lemma 4.12]).
Consider with , , and .
-
If SLG Random Access with parameters has -certificates, then SLG Random Access with parameters also has -certificates.
-
If SLG Random Access with parameters admits an -bounded-error data structure, then SLG Random Access with parameters also admits an -bounded-error data structure.
In the final step, we put everything together and change the parametrization to .
Theorem 4.13.
Consider integers and a real constant such that , , , and .
If Random Access with parameters , , and has -certificates or admits an -bounded-error data structure, then
Proof.
Set , , and . Due to , we have
| (1) |
Moreover, implies
| (2) |
The assumption , together with (1) and (2), yields
| (3) |
Since holds for , the assumption further yields
| (4) |
Define and . Combining (4) and (2) implies
| (5) |
Moreover, (4) yields
| (6) |
The bounds in (5) and (6) let us apply Lemma 4.12 to conclude that Random Access with parameters has -certificates or admits a bounded-error data structure.
We may henceforth assume . Set and .
If Random Access with parameters has -certificates, then Corollary 4.8 implies that BLSD with parameters has -certificates. Hence, Corollary 4.3 yields
If instead Random Access with parameters admits an -bounded-error data structure, then Corollary 4.11 yields a bounded-error communication protocol for BLSD with parameters in which Alice sends bits and Bob sends bits. The randomized BLSD lower bound therefore implies
In either case, dividing by and using , we obtain
| (9) |
We first handle the former case. By (1) and the definition of , we have
and hence (9) implies . Moreover, the theorem assumption gives
| (10) |
Since (1) implies , (10) yields . Therefore, using (2), we obtain
| (11) |
It remains to consider the second alternative in (9). Let us first focus on the logarithmic denominator. Due to (4), (1), and (2), we have
By (10),
| (12) |
Combining (9), (2), and (12), we conclude that
| (13) |
Equations (8), (11), and (13) together prove the first inequality in the theorem. For the second inequality, it suffices to plug in the following bound:
| (14) |
where the inequality uses the assumptions and .
Note that Theorem 4.13 does not apply in the following cases:
- .
-
This corresponds to very small SLGs, which do not model BLSD inputs.
- .
-
In that case, we can derive a weaker lower bound by monotonicity with respect to (the certificate size can only increase as the data structure size decreases, with everything else unchanged). Applying the bound for yields
The same bound could have been obtained by directly adapting the proof of Theorem 4.13.
Restating Theorem 4.13 in terms of word RAM algorithms, we obtain Theorem 1.2 from the introduction. Here, we present its simplified version for the case of .
Corollary 4.14 ([18, Corollary 4.14]).
Consider integers and a real constant such that , and . Suppose that, for every instance of SLG Random Access with parameters , there is a data structure of machine words of bits each whose query algorithm runs in time in the word RAM model. Then
References
- [1] Hideo Bannai, Mitsuru Funakoshi, Diptarama Hendrian, Myuji Matsuda, and Simon J. Puglisi. Height-bounded Lempel-Ziv encodings. In 32nd Annual European Symposium on Algorithms, ESA 2024, volume 308 of LIPIcs, pages 18:1–18:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.ESA.2024.18.
- [2] Ruben Becker, Davide Cenzato, Travis Gagie, Sung-Hwan Kim, Ragnar Groot Koerkamp, Giovanni Manzini, and Nicola Prezza. Compressing suffix trees by path decompositions. In Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis, editors, 53rd International Colloquium on Automata, Languages, and Programming (ICALP 2026), volume 374 of LIPIcs, pages 24:1–24:25. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2026. doi:10.4230/LIPIcs.ICALP.2026.24.
- [3] Djamal Belazzougui, Paolo Boldi, and Sebastiano Vigna. Predecessor search with distance-sensitive query time, 2012. arXiv:1209.5441.
- [4] Djamal Belazzougui, Manuel Cáceres, Travis Gagie, Pawel Gawrychowski, Juha Kärkkäinen, Gonzalo Navarro, Alberto Ordóñez Pereira, Simon J. Puglisi, and Yasuo Tabei. Block trees. Journal of Computer and System Sciences, 117:1–22, 2021. doi:10.1016/J.JCSS.2020.11.002.
- [5] Djamal Belazzougui, Patrick Hagge Cording, Simon J. Puglisi, and Yasuo Tabei. Access, rank, and select in grammar-compressed strings. In Nikhil Bansal and Irene Finocchi, editors, 23rd Annual European Symposium on Algorithms, ESA 2015, volume 9294 of LNCS, pages 142–154. Springer, 2015. doi:10.1007/978-3-662-48350-3_13.
- [6] Philip Bille, Anders Roy Christiansen, Patrick Hagge Cording, and Inge Li Gørtz. Finger search in grammar-compressed strings. Theory of Computing Systems, 62(8):1715–1735, 2018. doi:10.1007/S00224-017-9839-9.
- [7] Philip Bille, Gad M. Landau, Rajeev Raman, Kunihiko Sadakane, Srinivasa Rao Satti, and Oren Weimann. Random access to grammar-compressed strings and trees. SIAM Journal on Computing, 44(3):513–539, 2015. doi:10.1137/130936889.
- [8] Michael Burrows and David J. Wheeler. A block-sorting lossless data compression algorithm. Technical Report 124, University of Cambridge, 1994. URL: https://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-124.pdf.
- [9] Moses Charikar, Eric Lehman, Ding Liu, Rina Panigrahy, Manoj Prabhakaran, Amit Sahai, and Abhi Shelat. The smallest grammar problem. IEEE Transactions on Information Theory, 51(7):2554–2576, 2005. doi:10.1109/TIT.2005.850116.
- [10] Anders Roy Christiansen, Mikko Berggren Ettienne, Tomasz Kociumaka, Gonzalo Navarro, and Nicola Prezza. Optimal-time dictionary-compressed indexes. ACM Transactions on Algorithms, 17(1):8:1–8:39, 2021. doi:10.1145/3426473.
- [11] Ferdinando Cicalese, Zsuzsanna Lipták, Travis Gagie, Gonzalo Navarro, Nicola Prezza, and Cristian Urbina. Incongruity-sensitive access to highly compressed strings, 2026. doi:10.48550/arXiv.2602.04523.
- [12] Patrick Hagge Cording, Paweł Gawrychowski, and Oren Weimann. Bookmarks in grammar-compressed strings. In Shunsuke Inenaga, Kunihiko Sadakane, and Tetsuya Sakai, editors, 23rd International Symposium on String Processing and Information Retrieval, SPIRE 2016, volume 9954 of LNCS, pages 153–159, 2016. doi:10.1007/978-3-319-46049-9_15.
- [13] Rajat De and Dominik Kempa. Grammar boosting: A new technique for proving lower bounds for computation over compressed data. In David P. Woodruff, editor, 35th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, pages 3376–3392. SIAM, 2024. doi:10.1137/1.9781611977912.121.
- [14] Rajat De and Dominik Kempa. Optimal random access and conditional lower bounds for 2D compressed strings. In 37th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2026, pages 1903–1915. Society for Industrial and Applied Mathematics, 2026. doi:10.1137/1.9781611978971.69.
- [15] Yevgeniy Dodis, Mihai Pătraşcu, and Mikkel Thorup. Changing base without losing space. In Leonard J. Schulman, editor, 42nd Annual ACM Symposium on Theory of Computing, STOC 2010, pages 593–602. ACM, 2010. doi:10.1145/1806689.1806771.
- [16] Akashnil Dutta, Reut Levi, Dana Ron, and Ronitt Rubinfeld. A simple online competitive adaptation of Lempel-Ziv compression with efficient random access support. In Ali Bilgin, Michael W. Marcellin, Joan Serra-Sagristà, and James A. Storer, editors, Data Compression Conference, DCC 2013, pages 113–122. IEEE, 2013. doi:10.1109/DCC.2013.19.
- [17] Anouk Duyster and Tomasz Kociumaka. Logarithmic-time internal pattern matching queries in compressed and dynamic texts. In 31st International Symposium on String Processing and Information Retrieval, SPIRE 2024, LNCS, pages 102–117. Springer, 2024. doi:10.1007/978-3-031-72200-4_8.
- [18] Anouk Duyster and Tomasz Kociumaka. Random access in grammar-compressed strings: Optimal trade-offs in almost all parameter regimes, 2026. arXiv:2602.10864v2.
- [19] Peter Elias. Efficient storage and retrieval by content and address of static files. Journal of the ACM, 21(2):246–260, 1974. doi:10.1145/321812.321820.
- [20] Robert Mario Fano. On the number of bits required to implement an associative memory. Technical report, Massachusetts Institute of Technology, 1971. URL: https://csg.csail.mit.edu/CSGArchives/memos/Memo-61.pdf.
- [21] Michael L. Fredman and Dan E. Willard. Surpassing the information theoretic bound with fusion trees. Journal of Computer and System Sciences, 47(3):424–436, 1993. doi:10.1016/0022-0000(93)90040-4.
- [22] Travis Gagie, Gonzalo Navarro, and Nicola Prezza. Fully functional suffix trees and optimal text searching in BWT-runs bounded space. Journal of the ACM, 67(1):2:1–2:54, 2020. doi:10.1145/3375890.
- [23] Moses Ganardi. Compression by Contracting Straight-Line Programs. In Petra Mutzel, Rasmus Pagh, and Grzegorz Herman, editors, 29th Annual European Symposium on Algorithms, ESA 2021, volume 204 of LIPIcs, pages 45:1–45:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.ESA.2021.45.
- [24] Moses Ganardi, Artur Jeż, and Markus Lohrey. Balancing straight-line programs. Journal of the ACM, 68(4):27:1–27:40, 2021. doi:10.1145/3457389.
- [25] Leszek Gasieniec, Roman M. Kolpakov, Igor Potapov, and Paul Sant. Real-time traversal in grammar-based compressed files. In Data Compression Conference, DCC 2005, page 458. IEEE Computer Society, 2005. doi:10.1109/DCC.2005.78.
- [26] Roberto Grossi. Random Access to High-Order Entropy Compressed Text, pages 199–215. Springer, 2013. doi:10.1007/978-3-642-40273-9_14.
- [27] Paul G. Howard and Jeffrey Scott Vitter. Arithmetic coding for data compression. Proceedings of the IEEE, 82(6):857–865, 1994. doi:10.1109/5.286189.
- [28] Tomohiro I. Longest common extensions with recompression. In Juha Kärkkäinen, Jakub Radoszewski, and Wojciech Rytter, editors, 28th Annual Symposium on Combinatorial Pattern Matching, CPM 2017, volume 78 of LIPIcs, pages 18:1–18:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPIcs.CPM.2017.18.
- [29] Dominik Kempa and Tomasz Kociumaka. Collapsing the hierarchy of compressed data structures: Suffix arrays in optimal compressed space. In 64th Annual Symposium on Foundations of Computer Science, FOCS 2023, pages 1877–1886. IEEE, 2023. doi:10.1109/FOCS57990.2023.00114.
- [30] Dominik Kempa and Tomasz Kociumaka. Tight lower bounds for central string queries in compressed space. In 37th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2026, pages 1824–1840. Society for Industrial and Applied Mathematics, 2026. doi:10.1137/1.9781611978971.65.
- [31] Dominik Kempa and Barna Saha. An upper bound and linear-space queries on the LZ-end parsing. In Joseph (Seffi) Naor and Niv Buchbinder, editors, 33rd Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, pages 2847–2866. SIAM, 2022. doi:10.1137/1.9781611977073.111.
- [32] John C. Kieffer and En-Hui Yang. Grammar-based codes: A new class of universal lossless source codes. IEEE Transactions on Information Theory, 46(3):737–754, 2000. doi:10.1109/18.841160.
- [33] Tomasz Kociumaka, Gonzalo Navarro, and Nicola Prezza. Towards a definitive compressibility measure for repetitive sequences. IEEE Transactions on Information Theory, 69(4):2074–2092, 2023. doi:10.1109/TIT.2022.3224382.
- [34] Sebastian Kreft and Gonzalo Navarro. LZ77-like compression with fast random access. In James A. Storer and Michael W. Marcellin, editors, Data Compression Conference, DCC 2010, pages 239–248. IEEE Computer Society, 2010. doi:10.1109/DCC.2010.29.
- [35] Kasper Green Larsen. Higher cell probe lower bounds for evaluating polynomials. In 53rd Annual Symposium on Foundations of Computer Science, FOCS 2012, pages 293–301. IEEE Computer Society, 2012. doi:10.1109/FOCS.2012.21.
- [36] Zsuzsanna Lipták, Francesco Masillo, and Gonzalo Navarro. BAT-LZ out of hell. In 35th Annual Symposium on Combinatorial Pattern Matching, CPM 2024, volume 296 of LIPIcs, pages 21:1–21:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.CPM.2024.21.
- [37] Markus Lohrey, Sebastian Maneth, and Carl Philipp Reh. Constant-time tree traversal and subtree equality check for grammar-compressed trees. Algorithmica, 80(7):2082–2105, 2017. doi:10.1007/s00453-017-0331-3.
- [38] Gonzalo Navarro. Indexing highly repetitive string collections, part i: Repetitiveness measures. ACM Computing Surveys, 54(2):1–31, 2021. doi:10.1145/3434399.
- [39] Gonzalo Navarro, Francisco Olivares, and Cristian Urbina. Balancing run-length straight-line programs. In Diego Arroyuelo and Barbara Poblete, editors, 29th International Symposium on String Processing and Information Retrieval, SPIRE 2022, volume 13617 of LNCS, pages 117–131. Springer, 2022. doi:10.1007/978-3-031-20643-6_9.
- [40] Takaaki Nishimoto, Tomohiro I, Shunsuke Inenaga, Hideo Bannai, and Masayuki Takeda. Fully dynamic data structure for LCE queries in compressed space. In Piotr Faliszewski, Anca Muscholl, and Rolf Niedermeier, editors, 41st International Symposium on Mathematical Foundations of Computer Science, MFCS 2016, volume 58 of LIPIcs, pages 72:1–72:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2016. doi:10.4230/LIPIcs.MFCS.2016.72.
- [41] Mihai Pǎtraşcu. Unifying the landscape of cell-probe lower bounds. SIAM Journal on Computing, 40(3):827–847, 2011. doi:10.1137/09075336X.
- [42] Mihai Pǎtraşcu and Mikkel Thorup. Dynamic integer sets with optimal rank, select, and predecessor search. In 55th Annual Symposium on Foundations of Computer Science, FOCS 2014, pages 166–175, 2014. doi:10.1109/FOCS.2014.26.
- [43] Nicola Prezza. Optimal rank and select queries on dictionary-compressed text. In Nadia Pisanti and Solon P. Pissis, editors, 30th Annual Symposium on Combinatorial Pattern Matching, CPM 2019, volume 128 of LIPIcs, pages 4:1–4:12. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.CPM.2019.4.
- [44] Rajeev Raman, Venkatesh Raman, and Srinivasa Rao Satti. Succinct indexable dictionaries with applications to encoding -ary trees, prefix sums and multisets. ACM Transactions on Algorithms, 3(4):43, 2007. doi:10.1145/1290672.1290680.
- [45] Sofya Raskhodnikova, Dana Ron, Ronitt Rubinfeld, and Adam D. Smith. Sublinear algorithms for approximating string compressibility. Algorithmica, 65(3):685–709, 2013. doi:10.1007/S00453-012-9618-6.
- [46] Frank Rubin. Experiments in text file compression. Communications of the ACM, 19(11):617–623, 1976. doi:10.1145/360363.360368.
- [47] Wojciech Rytter. Application of Lempel–Ziv factorization to the approximation of grammar-based compression. Theoretical Computer Science, 302(1–3):211–222, 2003. doi:10.1016/S0304-3975(02)00777-6.
- [48] Kunihiko Sadakane and Roberto Grossi. Squeezing succinct data structures into entropy bounds. In 17th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2006, pages 1230–1239. ACM Press, 2006. URL: http://dl.acm.org/citation.cfm?id=1109557.1109693.
- [49] Hiroki Shibata, Yuto Nakashima, Yutaro Yamaguchi, and Shunsuke Inenaga. LZBE: An LZ-Style Compressor Supporting O(log n)-Time Random Access. In Philip Bille and Nicola Prezza, editors, 37th Annual Symposium on Combinatorial Pattern Matching (CPM 2026), volume 369 of LIPIcs, pages 34:1–34:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2026. doi:10.4230/LIPIcs.CPM.2026.34.
- [50] Sandip Sinha and Omri Weinstein. Local decodability of the Burrows-Wheeler transform. In 51st Annual ACM Symposium on Theory of Computing, STOC 2019, pages 744–755. ACM, 2019. doi:10.1145/3313276.3316317.
- [51] Elad Verbin and Wei Yu. Data structure lower bounds on random access to grammar-compressed strings. In Johannes Fischer and Peter Sanders, editors, 24th Annual Symposium on Combinatorial Pattern Matching, CPM 2013, LNCS, pages 247–258. Springer, 2013. doi:10.1007/978-3-642-38905-4_24.
- [52] Yaoyu Wang and Yitong Yin. Certificates in data structures. In 41st International Colloquium on Automata, Languages, and Programming, ICALP 2014, LNCS, pages 1039–1050. Springer, 2014. doi:10.1007/978-3-662-43948-7_86.
- [53] Jacob Ziv and Abraham Lempel. A universal algorithm for sequential data compression. IEEE Transactions on Information Theory, 23(3):337–343, 1977. doi:10.1109/TIT.1977.1055714.
- [54] Jacob Ziv and Abraham Lempel. Compression of individual sequences via variable-rate coding. IEEE Transactions on Information Theory, 24(5):530–536, 1978. doi:10.1109/TIT.1978.1055934.
