Table of Contents
Fetching ...

Optimal Random Access and Conditional Lower Bounds for 2D Compressed Strings

Rajat De, Dominik Kempa

TL;DR

The paper advances native 2D compressed indexing by (i) giving a data structure that achieves near-optimal random access time on 2D grammar-compressed texts with space proportional to the grammar size, (ii) establishing conditional lower bounds for 2D pattern matching via the Orthogonal Vectors conjecture, and (iii) tying the hardness of 2D queries to fundamental open problems in 1D grammar-compressed data, via reductions from rank and symbol-occurrence problems. The authors introduce bookmark-based approaches and 2D hook/offset constructs, extend them to multi-level 1D and 2D structures, and prove reductions that connect 2D querying complexity to 1D compression problems, thus placing 2D compressed indexing within a broader landscape of fine-grained complexity. The results show a clear separation from the 1D case for several core tasks and illuminate the limitations and potential of native 2D compressions for scalable querying in high-dimensional data. Together, these findings offer both practical data-structure techniques for efficient 2D querying on compressed data and a rigorous hardness framework guiding future work in 2D information retrieval and matrix-based representations.

Abstract

Compressed indexing is a powerful technique that enables efficient querying over data stored in compressed form, significantly reducing memory usage and often accelerating computation. While extensive progress has been made for one-dimensional strings, many real-world datasets (such as images, maps, and adjacency matrices) are inherently two-dimensional and highly compressible. Unfortunately, naively applying 1D techniques to 2D data leads to suboptimal results, as fundamental structural repetition is lost during linearization. This motivates the development of native 2D compressed indexing schemes that preserve both compression and query efficiency. We present three main contributions that advance the theory of compressed indexing for 2D strings: (1) We design the first data structure that supports optimal-time random access to a 2D string compressed by a 2D grammar. Specifically, for a 2D string $T\inΣ^{r\times c}$ compressed by a 2D grammar $G$ and any constant $ε>0$, we achieve $O(\log n/\log \log n)$ query time and $O(|G|\log^{2+ε}n)$ space, where $n=\max(r,c)$. (2) We prove conditional lower bounds for pattern matching over 2D-grammar compressed strings. Assuming the Orthogonal Vectors Conjecture, no algorithm can solve this problem in time $O(|G|^{2-ε}\cdot |P|^{O(1)})$ for any $ε>0$, demonstrating a separation from the 1D case, where optimal solutions exist. (3) We show that several fundamental 2D queries, such as the 2D longest common extension, rectangle sum, and equality, cannot be supported efficiently under hardness assumptions for rank and symbol occurrence queries on 1D grammar-compressed strings. This is the first evidence connecting the complexity of 2D compressed indexing to long-standing open problems in the 1D setting.

Optimal Random Access and Conditional Lower Bounds for 2D Compressed Strings

TL;DR

The paper advances native 2D compressed indexing by (i) giving a data structure that achieves near-optimal random access time on 2D grammar-compressed texts with space proportional to the grammar size, (ii) establishing conditional lower bounds for 2D pattern matching via the Orthogonal Vectors conjecture, and (iii) tying the hardness of 2D queries to fundamental open problems in 1D grammar-compressed data, via reductions from rank and symbol-occurrence problems. The authors introduce bookmark-based approaches and 2D hook/offset constructs, extend them to multi-level 1D and 2D structures, and prove reductions that connect 2D querying complexity to 1D compression problems, thus placing 2D compressed indexing within a broader landscape of fine-grained complexity. The results show a clear separation from the 1D case for several core tasks and illuminate the limitations and potential of native 2D compressions for scalable querying in high-dimensional data. Together, these findings offer both practical data-structure techniques for efficient 2D querying on compressed data and a rigorous hardness framework guiding future work in 2D information retrieval and matrix-based representations.

Abstract

Compressed indexing is a powerful technique that enables efficient querying over data stored in compressed form, significantly reducing memory usage and often accelerating computation. While extensive progress has been made for one-dimensional strings, many real-world datasets (such as images, maps, and adjacency matrices) are inherently two-dimensional and highly compressible. Unfortunately, naively applying 1D techniques to 2D data leads to suboptimal results, as fundamental structural repetition is lost during linearization. This motivates the development of native 2D compressed indexing schemes that preserve both compression and query efficiency. We present three main contributions that advance the theory of compressed indexing for 2D strings: (1) We design the first data structure that supports optimal-time random access to a 2D string compressed by a 2D grammar. Specifically, for a 2D string compressed by a 2D grammar and any constant , we achieve query time and space, where . (2) We prove conditional lower bounds for pattern matching over 2D-grammar compressed strings. Assuming the Orthogonal Vectors Conjecture, no algorithm can solve this problem in time for any , demonstrating a separation from the 1D case, where optimal solutions exist. (3) We show that several fundamental 2D queries, such as the 2D longest common extension, rectangle sum, and equality, cannot be supported efficiently under hardness assumptions for rank and symbol occurrence queries on 1D grammar-compressed strings. This is the first evidence connecting the complexity of 2D compressed indexing to long-standing open problems in the 1D setting.
Paper Structure (54 sections, 37 theorems, 35 equations, 6 figures, 5 algorithms)

This paper contains 54 sections, 37 theorems, 35 equations, 6 figures, 5 algorithms.

Key Result

Theorem 1.1

For every 2D SLP $G$ of size $|G| = g$ representing a 2D string $T \in \Sigma^{r \times c}$ (see sec:prelim-2d-grammars), and any constant $\epsilon > 0$, there exists a data structure of size $\mathcal{O}(g \cdot \log^{2+\epsilon} n)$, where $n = \max(r, c)$, that, given any $(i,j) \in [1 \mathinne

Figures (6)

  • Figure 1: Illustration of \ref{['def:hook', 'def:offset']}. Here, $N \in V$, $\mathrm{hook}_{G}(N,b,e) = H$, and $\mathrm{offset}_{G}(N,b,e) = \alpha$.
  • Figure 2: Illustration of \ref{['def:2d-hook', 'def:2d-offset']}. Here $N \in V$, $\mathrm{hook}_{G}(N,b_r,b_c,e_r,e_c) = H$, and $\mathrm{offset}_{G}(N,b_r,b_c,e_r,e_c) = (\alpha_r,\alpha_c)$.
  • Figure 3: Illustration of the construction presented in \ref{['lm:ov-reduction']}. The highlighted blocks of zeros in $T$ correspond to orthogonal pairs $(a_2,a_4)$ and $(a_3,a_5)$.
  • Figure 4: LeftMap$(t,p,\delta)$
  • Figure 5: TopLeftMap$(t,p_r,p_c,\delta_r,\delta_c)$
  • ...and 1 more figures

Theorems & Definitions (90)

  • Theorem 1.1
  • Theorem 1.2
  • Theorem 1.3
  • Theorem 1.4
  • Lemma 2.2
  • proof
  • Lemma 2.4
  • proof
  • Definition 4.1: Hook
  • Definition 4.2: Offset
  • ...and 80 more