Skip to main content
QUICK REVIEW

[Paper Review] Finding Distinct Subpalindromes Online

Dmitry Kosolobov, Mikhail Rubinchik|arXiv (Cornell University)|May 11, 2013
semigroups and automata theoryComputer Science3 references9 citations
TL;DR

This paper presents an online algorithm that finds all distinct subpalindromes in a string in O(n log |Σ|) time for ordered alphabets and O(n|Σ|) time for unordered alphabets, using a modified Manacher's algorithm with a data structure that maintains maximal suffix-palindromes. The algorithm is proven optimal in the comparison-based model, resolving an open problem on online distinct subpalindrome enumeration.

ABSTRACT

We exhibit an online algorithm finding all distinct palindromes inside a given string in time $Θ(n\log|Σ|)$ over an ordered alphabet and in time $Θ(n|Σ|)$ over an unordered alphabet. Using a reduction from a dictionary-like data structure, we prove the optimality of this algorithm in the comparison-based computation model.

Motivation & Objective

  • To solve the open problem of finding all distinct subpalindromes in a string using an online algorithm.
  • To achieve linear time and space complexity for distinct subpalindrome enumeration in the comparison-based model.
  • To prove the optimality of the proposed algorithm through a reduction to an insert-only dictionary problem.
  • To extend the method to compute lengths of maximal suffix-palindromes and palindromic closures online.

Proposed method

  • Extends Manacher’s algorithm by maintaining a data structure that tracks maximal odd and even suffix-palindromes using center and radius arrays.
  • Uses a boolean flag Δ to distinguish between odd and even palindromes and dynamically updates the radius array Rad based on symmetry and extension checks.
  • Employs a while loop to extend the maximal suffix-palindrome when a matching character is found at the symmetric position.
  • Introduces a special sentinel character '$' to simplify initialization and handle edge cases in the first step.
  • Reduces the problem of maintaining an insert-only dictionary to subpalindrome counting using a string construction that encodes membership via subpalindrome count changes.
  • Uses Lemma 3.5 to show that only single letters are subpalindromes in strings of the form abx1abx2…abxn, enabling detection of new elements via subpalindrome count increase.

Experimental results

Research questions

  • RQ1Can all distinct subpalindromes in a string be found in linear time using an online algorithm?
  • RQ2What is the optimal time complexity for online distinct subpalindrome enumeration in the comparison-based model?
  • RQ3How can the palindromic closure and maximal suffix-palindrome lengths be computed online for all string prefixes?
  • RQ4Is there a reduction from the insert-only dictionary problem to subpalindrome counting that establishes lower bounds?

Key findings

  • The algorithm runs in O(n log |Σ|) time for ordered alphabets and O(n|Σ|) time for unordered alphabets, both with linear space.
  • The algorithm is proven optimal in the comparison-based model via a reduction from the insert-only dictionary problem.
  • The lower bound for ordered alphabets is Ω(n log |Σ|), and for unordered alphabets it is Ω(n|Σ|), matching the algorithm’s complexity.
  • The method correctly computes the lengths of maximal suffix-palindromes and palindromic closures for all prefixes online.
  • The construction using strings of the form abx1abx2…abxn ensures that a new subpalindrome appears if and only if a new letter is introduced, enabling membership detection.
  • The proof establishes that no comparison-based algorithm can solve the problem faster than the proposed bounds, confirming optimality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.