Table of Contents
Fetching ...

Computing maximal palindromes in non-standard matching models

Takuya Mieno, Mitsuru Funakoshi, Yuto Nakashima, Shunsuke Inenaga, Hideo Bannai, Masayuki Takeda

TL;DR

This work studies maximal palindromes under non-standard string matching by introducing Substring Consistent Symmetric and Two-Transitive Relations ($SCSTTR$) to unify models such as Complementary Matching, Cartesian-tree, Parameterized, Order-preserving, and Palindromic-structure. It provides two algorithmic pillars: suffix-tree-like data structures enabling linear-time computation of symmetry-based palindromes, and Manacher-like linear-time algorithms for reversal-based palindromes across the considered models. For each SCSTTR model, the paper states concrete time bounds (e.g., $O(n)$ or $O(n \log n)$) and demonstrates the feasibility of computing all maximal palindromes in $T$ efficiently, extending Gusfield’s framework and yielding practical tools for palindrome mining in biology and time-series analysis. The results pave the way for broader model coverage and potential compact representations, with future work aimed at additional matching paradigms and structural variants.

Abstract

Palindromes are popular and important objects in textual data processing, bioinformatics, and combinatorics on words. Let $S = XaY$ be a string where $X$ and $Y$ are of the same length, and $a$ is either a single character or the empty string. Then, there exist two alternative definitions for palindromes: $S$ is said to be a palindrome if $S$ is equal to its reversal $S^R$ (Reversal-based definition); or if its right-arm $Y$ is equal to the reversal of its left-arm $X^R$ (Symmetry-based definition). It is clear that if the ``equality'' ($\approx$) used in both definitions is exact character matching ($=$), then the two definitions are the same. However, if we apply other string-equality criteria $\approx$, including the complementary-matching model for biological sequences, the Cartesian-tree model [Park et al., TCS 2020], the parameterized model [Baker, JCSS 1996], the order-preserving model [Kim et al., TCS 2014], and the palindromic-structure model [I et al., TCS 2013], then are the reversal-based palindromes and the symmetry-based palindromes the same? To the best of our knowledge, no previous work has considered or answered this natural question. In this paper, we first provide answers to this question, and then present efficient algorithms for computing all maximal palindromes under the non-standard matching models in a given string. After confirming that Gusfield's offline suffix-tree-based algorithm for computing maximal symmetry-based palindromes can be readily extended to the aforementioned matching models, we show how to extend Manacher's online algorithm for computing maximal reversal-based palindromes in linear time for all the aforementioned matching models.

Computing maximal palindromes in non-standard matching models

TL;DR

This work studies maximal palindromes under non-standard string matching by introducing Substring Consistent Symmetric and Two-Transitive Relations () to unify models such as Complementary Matching, Cartesian-tree, Parameterized, Order-preserving, and Palindromic-structure. It provides two algorithmic pillars: suffix-tree-like data structures enabling linear-time computation of symmetry-based palindromes, and Manacher-like linear-time algorithms for reversal-based palindromes across the considered models. For each SCSTTR model, the paper states concrete time bounds (e.g., or ) and demonstrates the feasibility of computing all maximal palindromes in efficiently, extending Gusfield’s framework and yielding practical tools for palindrome mining in biology and time-series analysis. The results pave the way for broader model coverage and potential compact representations, with future work aimed at additional matching paradigms and structural variants.

Abstract

Palindromes are popular and important objects in textual data processing, bioinformatics, and combinatorics on words. Let be a string where and are of the same length, and is either a single character or the empty string. Then, there exist two alternative definitions for palindromes: is said to be a palindrome if is equal to its reversal (Reversal-based definition); or if its right-arm is equal to the reversal of its left-arm (Symmetry-based definition). It is clear that if the ``equality'' () used in both definitions is exact character matching (), then the two definitions are the same. However, if we apply other string-equality criteria , including the complementary-matching model for biological sequences, the Cartesian-tree model [Park et al., TCS 2020], the parameterized model [Baker, JCSS 1996], the order-preserving model [Kim et al., TCS 2014], and the palindromic-structure model [I et al., TCS 2013], then are the reversal-based palindromes and the symmetry-based palindromes the same? To the best of our knowledge, no previous work has considered or answered this natural question. In this paper, we first provide answers to this question, and then present efficient algorithms for computing all maximal palindromes under the non-standard matching models in a given string. After confirming that Gusfield's offline suffix-tree-based algorithm for computing maximal symmetry-based palindromes can be readily extended to the aforementioned matching models, we show how to extend Manacher's online algorithm for computing maximal reversal-based palindromes in linear time for all the aforementioned matching models.
Paper Structure (18 sections, 22 theorems, 2 equations, 6 figures, 2 tables)

This paper contains 18 sections, 22 theorems, 2 equations, 6 figures, 2 tables.

Key Result

Lemma 1

Let $P$ be an SCSTTR rev-palindrome. If a substring $P[i.. j]$ of $P$ is an SCSTTR rev-palindrome, then the substring at the symmetrical position is also an SCSTTR rev-palindrome, namely, $P[|P|-j+1.. |P|-i+1]$ is an SCSTTR rev-palindrome.

Figures (6)

  • Figure 1: This figure shows examples of a palindrome in each non-standard matching model. A bijection $f$ such that $f(\mathtt{a})=\mathtt{c}$, $f(\mathtt{b})=\mathtt{b}$, $f(\mathtt{c})=\mathtt{d}$, $f(\mathtt{d})=\mathtt{a}$ gives the parameterized sym-palindrome. A bijection $g$ such that $g(\mathtt{a})=\mathtt{b}$, $g(\mathtt{b})=\mathtt{a}$, $g(\mathtt{c})=\mathtt{d}$, $g(\mathtt{d})=\mathtt{c}$ gives the parameterized rev-palindrome. In the palindromic-structure sym-palindrome, though palindromes $\mathtt{bb}$, $\mathtt{abba}$, and $\mathtt{bab}$ exist, these palindromes are ignored in this symmetric condition.
  • Figure 2: Illustration for Cartesian-trees of $X = \mathsf{cabdcf}$ and $Y = \mathsf{eaacbc}$. Since they are isomorphic except their node labels, $X \approx_{\mathrm{ct}} Y$ holds.
  • Figure 3: Illustration for Cartesian-trees of strings $\mathtt{babaab}$, $\mathtt{bababb}$, $(\mathtt{babaab})^R$, and $(\mathtt{bababb})^R$.
  • Figure 4: Illustration for two sub-cases in $c \leq e$.
  • Figure 5: A concrete example for Cartesian-tree palindromes. In this example, $Z_c = 1$, $E_c = 3$, and $U_c = 1$ hold since when $\mathsf{PD}_{T[i-1.. j+1]}$ grows to $\mathsf{PD}_{T[i-2.. j+2]}$, a single value (shown in bold font) is updated from $0$ to non-zero.
  • ...and 1 more figures

Theorems & Definitions (33)

  • Definition 1: SCSTTR symmetry-based palindromes
  • Definition 2: SCSTTR reversal-based palindromes
  • Lemma 1
  • proof
  • Definition 3: outward Cartesian-tree sym-palindromes
  • Definition 4: inward Cartesian-tree sym-palindromes
  • Theorem 1
  • Lemma 2
  • Proposition 1
  • Definition 5: ParkBALP20
  • ...and 23 more