Generalization of Repetitiveness Measures for Two-Dimensional Strings
Lorenzo Carfagna, Giovanni Manzini, Giuseppe Romana, Marinella Sciortino, Cristian Urbina
TL;DR
The paper extends the 1D repetitiveness framework to two-dimensional and higher dimensions by introducing rectangular-factor variants of $δ$ and $γ$ and copy-based measures $g$, $g_{rl}$, and $b$ for $2$D strings $N=mn$. It shows that $δ(\mathcal{M}) \le γ(\mathcal{M})$ and $b(\mathcal{M}) \le g_{rl}(\mathcal{M}) \le g(\mathcal{M})$, but that the two families become incomparable when $d \ge 2$, with $g$, $g_{rl}$, and $b$ sometimes asymptotically smaller than $δ$ and $γ$. It introduces a 2D grammar-based representation that supports random access to any symbol in $O(\log N)$ time for an $m \times n$ matrix of size $N=mn$, and compares with the 2D Block Tree, highlighting limitations of square-based approaches, while also analyzing linearization strategies such as row-wise and Peano–Hilbert orderings. The work further extends these notions to $d$-dimensional strings, discusses practical implications for compressor design, and outlines open questions and directions, including extensions of greedy grammar construction and non-square partitioning in 2D-block trees.
Abstract
The problem of detecting and measuring the repetitiveness of one-dimensional strings has been extensively studied in data compression and text indexing. Our understanding of these issues has been significantly improved by the introduction of the notion of string attractor [Kempa and Prezza, STOC 2018] and by the results showing the relationship between attractors and other measures of compressibility. When the input data are structured in a non-linear way, as in two-dimensional strings, inherent redundancy often offers an even richer source for compression. However, systematic studies on repetitiveness measures for two-dimensional strings are still scarce. In this paper we extend to two or more dimensions the main measures of complexity introduced for one-dimensional strings. We distinguish between the measures $δ$ and $γ$, defined in terms of the substrings of the input, and the measures $g$, $g_{rl}$, and $b$, which are based on copy-paste mechanisms. We study the properties and mutual relationships between these two classes and we show that the two classes become incomparable for $d$-dimensional inputs as soon as $d\geq 2$. Moreover, we show that our grammar-based representation of a $d$-dimensional string of size $N$ enables direct access to any symbol in $O(\log N)$ time. We also compare our measures for two-dimensional strings with the 2D Block Tree data structure [Brisaboa et al., Computer J., 2024] and provide some insights for the design of future effective two-dimensional compressors.
