Table of Contents
Fetching ...

Optimal Bounds for Distinct Quartics

Panagiotis Charalampopoulos, Paweł Gawrychowski, Samah Ghazawi

Abstract

A fundamental concept related to strings is that of repetitions. It has been extensively studied in many versions, from both purely combinatorial and algorithmic angles. One of the most basic questions is how many distinct squares, i.e., distinct strings of the form $UU$, a string of length $n$ can contain as fragments. It turns out that this is always $\mathcal{O}(n)$, and the bound cannot be improved to sublinear in $n$ [Fraenkel and Simpson, JCTA 1998]. Several similar questions about repetitions in strings have been considered, and by now we seem to have a good understanding of their repetitive structure. For higher-dimensional strings, the basic concept of periodicity has been successfully extended and applied to design efficient algorithms -- it is inherently more complex than for regular strings. Extending the notion of repetitions and understanding the repetitive structure of higher-dimensional strings is however far from complete. Quartics were introduced by Apostolico and Brimkov [TCS 2000] as analogues of squares in two dimensions. Charalampopoulos, Radoszewski, Rytter, Waleń, and Zuba [ESA 2020] proved that the number of distinct quartics in an $n\times n$ 2D string is $\mathcal{O}(n^2 \log^2 n)$ and that they can be computed in $\mathcal{O}(n^2 \log^2 n)$ time. Gawrychowski, Ghazawi, and Landau [SPIRE 2021] constructed an infinite family of $n \times n$ 2D strings with $Ω(n^2 \log n)$ distinct quartics. This brings the challenge of determining asymptotically tight bounds. Here, we settle both the combinatorial and the algorithmic aspects of this question: the number of distinct quartics in an $n\times n$ 2D string is $\mathcal{O}(n^2 \log n)$ and they can be computed in the worst-case optimal $\mathcal{O}(n^2 \log n)$ time.

Optimal Bounds for Distinct Quartics

Abstract

A fundamental concept related to strings is that of repetitions. It has been extensively studied in many versions, from both purely combinatorial and algorithmic angles. One of the most basic questions is how many distinct squares, i.e., distinct strings of the form , a string of length can contain as fragments. It turns out that this is always , and the bound cannot be improved to sublinear in [Fraenkel and Simpson, JCTA 1998]. Several similar questions about repetitions in strings have been considered, and by now we seem to have a good understanding of their repetitive structure. For higher-dimensional strings, the basic concept of periodicity has been successfully extended and applied to design efficient algorithms -- it is inherently more complex than for regular strings. Extending the notion of repetitions and understanding the repetitive structure of higher-dimensional strings is however far from complete. Quartics were introduced by Apostolico and Brimkov [TCS 2000] as analogues of squares in two dimensions. Charalampopoulos, Radoszewski, Rytter, Waleń, and Zuba [ESA 2020] proved that the number of distinct quartics in an 2D string is and that they can be computed in time. Gawrychowski, Ghazawi, and Landau [SPIRE 2021] constructed an infinite family of 2D strings with distinct quartics. This brings the challenge of determining asymptotically tight bounds. Here, we settle both the combinatorial and the algorithmic aspects of this question: the number of distinct quartics in an 2D string is and they can be computed in the worst-case optimal time.
Paper Structure (24 sections, 22 theorems, 2 equations, 11 figures)

This paper contains 24 sections, 22 theorems, 2 equations, 11 figures.

Key Result

Lemma 2.1

If $p$ and $q$ are periods of a string $S$ and satisfy $p + q \leq |S|$, then $\gcd(p, q)$ is also a period of $S$.

Figures (11)

  • Figure 1: 2D string $W^{2,5}$ is shown for some 2D string $W$.
  • Figure 2: Consider an $n \times n$ 2D string $A$ all of whose entries that lie weakly above the main diagonal are equal to $0$ and all of whose entries that lie strictly below the main diagonal are equal to $1$. The quartic that equals $0^{2,2}$ has $n-2$ extreme occurrences in $A$. This is illustrated for $n=8$: the bottom-right corners of extreme occurrences of said quartic are marked.
  • Figure 3: An illustration of the proof of \ref{['lem:aspect_ratio']} with quartics $Q$, $Q'$, and $Q"$ drawn in red, blue, and green, respectively.
  • Figure 4: The red point corresponds to the anchor of the shown occurrence of $R^{5,5}$.
  • Figure 5: The considered occurrences of each of $M^{5,5}$ and $R^{5,5}$ are shown, together with the four specified fragments, at least one of which must be fully contained in $Q$.
  • ...and 6 more figures

Theorems & Definitions (42)

  • Lemma 2.1: Periodicity Lemma fine1965uniqueness
  • Lemma 2.2: Three Squares Lemma DBLP:journals/algorithmica/CrochemoreR95
  • Proposition 2.3
  • proof
  • Proposition 2.4
  • proof
  • Lemma 3.1
  • proof
  • Lemma 3.2
  • proof
  • ...and 32 more