Table of Contents
Fetching ...

Double-Ended Palindromic Trees in Linear Time

Qisheng Wang, Ming Yang, Xinrui Zhu

TL;DR

This work addresses online maintenance of palindromic substrings under deque updates, introducing a double-ended eertree that supports push_back, push_front, pop_back, pop_front and palindrome-structure queries. The key idea is a surface recording framework built on reduced sets of occurrences, plus the notion of surfaces that capture the distribution of palindromic substrings in the current string. The authors achieve a linear-time maintenance regime with worst-case per-operation costs of $O^*(\log^*(\sigma))$, reducing to $O^*(1)$ for constant alphabet, and provide two practical implementations. They demonstrate broad applicability to range palindrome queries (counting distinct palindromes, longest palindromic substring, shortest unique palindrome, and shortest absent palindrome) and discuss persistence, block-based trade-offs, and potential extensions to other palindrome structures. The work advances real-time palindrome processing and has potential impact in bioinformatics and advanced string-processing tasks that require online deque updates.

Abstract

The palindromic tree (a.k.a. eertree) is a data structure that provides access to all palindromic substrings of a string. In this paper, we propose a dynamic version of eertree, called double-ended eertree, which supports online operations on the stored string, including double-ended queue operations, counting distinct palindromic substrings, and finding the longest palindromic prefix/suffix. At the heart of our construction, we identify a new class of substring occurrences, called surfaces, that are palindromic substring occurrences that are neither prefixes nor suffixes of any other palindromic substring occurrences, which is of independent interest. Surfaces characterize the link structure of all palindromic substrings in the eertree, thereby allowing a linear-time implementation of double-ended eertrees through a linear-time maintenance of surfaces.

Double-Ended Palindromic Trees in Linear Time

TL;DR

This work addresses online maintenance of palindromic substrings under deque updates, introducing a double-ended eertree that supports push_back, push_front, pop_back, pop_front and palindrome-structure queries. The key idea is a surface recording framework built on reduced sets of occurrences, plus the notion of surfaces that capture the distribution of palindromic substrings in the current string. The authors achieve a linear-time maintenance regime with worst-case per-operation costs of , reducing to for constant alphabet, and provide two practical implementations. They demonstrate broad applicability to range palindrome queries (counting distinct palindromes, longest palindromic substring, shortest unique palindrome, and shortest absent palindrome) and discuss persistence, block-based trade-offs, and potential extensions to other palindrome structures. The work advances real-time palindrome processing and has potential impact in bioinformatics and advanced string-processing tasks that require online deque updates.

Abstract

The palindromic tree (a.k.a. eertree) is a data structure that provides access to all palindromic substrings of a string. In this paper, we propose a dynamic version of eertree, called double-ended eertree, which supports online operations on the stored string, including double-ended queue operations, counting distinct palindromic substrings, and finding the longest palindromic prefix/suffix. At the heart of our construction, we identify a new class of substring occurrences, called surfaces, that are palindromic substring occurrences that are neither prefixes nor suffixes of any other palindromic substring occurrences, which is of independent interest. Surfaces characterize the link structure of all palindromic substrings in the eertree, thereby allowing a linear-time implementation of double-ended eertrees through a linear-time maintenance of surfaces.
Paper Structure (54 sections, 45 theorems, 74 equations, 3 figures, 2 tables, 17 algorithms)

This paper contains 54 sections, 45 theorems, 74 equations, 3 figures, 2 tables, 17 algorithms.

Key Result

Theorem 1.1

Double-ended eertree can be implemented with worst-case time and space complexity $O\lparen*\rparen{\log\lparen*\rparen{\sigma}}$ per operation, where $\sigma$ is the size of the alphabet.

Figures (3)

  • Figure 1: The eertree after performing $\texttt{push\_back}\lparen a\rparen$ on the string $s = abaaaba$. For the definition and notations, please refer to Section \ref{['sec:eertree']}. Newly created nodes and transitions are colored in blue. A solid arrow from node $v$ with character $c$ means the transition $\operatorname{next}\lparen v, c\rparen$. A dashed arrow from node $v$ means the suffix link. The set near to node $v$ means $\operatorname{occur}\lparen*\rparen{s, v}$.
  • Figure 2: The eertree after performing $\texttt{pop\_back}\lparen\rparen$ on the string $s = abaaaba$. Newly deleted nodes and transitions are colored in green. See Figure \ref{['fig:push_back']} for the meaning of the arrows.
  • Figure 3: Illustration for the proof of Lemma \ref{['lemma:cond3']}.

Theorems & Definitions (80)

  • Theorem 1.1: Double-ended eertrees
  • Lemma 2.1: Periods of palindromes, Lemma 2 and Lemma 3 in KRS15
  • Lemma 2.2
  • proof
  • Corollary 2.3
  • Proposition 2.4: Longest suffix palindromes using direct links RS18
  • Lemma 2.5: Efficient direct links RS18
  • Theorem 2.6: Stack operations for eertrees RS18
  • Theorem 2.7: Queue operations for eertrees MWN+22
  • Lemma 4.1: Uniqueness checking via reduced sets of occurrences
  • ...and 70 more