Skip to main content
QUICK REVIEW

[Paper Review] Palindromic k-Factorization in Pure Linear Time

Mikhail Rubinchik, Arseny M. Shur|arXiv (Cornell University)|Jan 1, 2020
Algorithms and Data CompressionComputer Science11 references1 citations
TL;DR

This paper presents the first online, pure linear-time algorithm for determining whether a string of length n can be factorized into k nonempty palindromes, solving the palindromic k-factorization problem in O(n) time independent of k. The algorithm simultaneously computes the minimum even and odd palindromic factorization lengths and supports efficient offline reconstruction of an explicit k-factorization in linear time using dynamic programming and advanced data structures for palindromic substring management.

ABSTRACT

Given a string $s$ of length $n$ over a general alphabet and an integer $k$, the problem is to decide whether $s$ is a concatenation of $k$ nonempty palindromes. Two previously known solutions for this problem work in time $O(kn)$ and $O(n\log n)$ respectively. Here we settle the complexity of this problem in the word-RAM model, presenting an $O(n)$-time online deciding algorithm. The algorithm simultaneously finds the minimum odd number of factors and the minimum even number of factors in a factorization of a string into nonempty palindromes. We also demonstrate how to get an explicit factorization of $s$ into $k$ palindromes with an $O(n)$-time offline postprocessing.

Motivation & Objective

  • To resolve the open problem of achieving optimal O(n) time complexity for palindromic k-factorization in the word-RAM model.
  • To design an online algorithm that decides, in linear time, whether a string admits a k-factorization into nonempty palindromes, regardless of k.
  • To compute both the minimum even and minimum odd palindromic factorization lengths simultaneously during the same linear-time pass.
  • To provide an offline linear-time algorithm for explicitly constructing a palindromic k-factorization when one exists.
  • To overcome technical challenges in adapting linear-time palindromic length algorithms to the even/odd factorization case, where prior properties do not hold.

Proposed method

  • Uses dynamic programming to compute arrays pl0[1..n] and pl1[1..n], representing the minimum even and odd palindromic factorization lengths for each prefix s[1..i].
  • Employs advanced data structures, including range updates on arrays PRE[p] and PL, to maintain information about palindromic substrings and their periods.
  • Applies chunk-based operations and minima tracking to efficiently manage series of palindromes with small periods, ensuring O(1) time per operation per iteration.
  • Leverages the Fine–Wilf theorem and properties of string periods to bound the number of relevant palindromic series and ensure linear total time complexity.
  • Uses the iterator from the online algorithm to reconstruct the explicit k-factorization in reverse order by checking palindrome suffixes.
  • Applies Lemma 2 to reduce the problem of k-factorization to computing plk mod 2(n), enabling efficient construction via dynamic programming on factorization lengths.

Experimental results

Research questions

  • RQ1Can the palindromic k-factorization problem be solved in pure linear time O(n) for a general alphabet, independent of k?
  • RQ2Is it possible to compute both the minimum even and minimum odd palindromic factorization lengths in a single linear-time pass?
  • RQ3Why do existing linear-time algorithms for palindromic length fail when adapted to even/odd factorization, and how can this be overcome?
  • RQ4Can an explicit k-factorization be reconstructed in linear time after the online decision phase?
  • RQ5What structural properties of palindromic substrings and their periods allow for an O(n) time bound in this setting?

Key findings

  • The paper presents an O(n)-time online algorithm that decides, for any k, whether a string of length n admits a palindromic k-factorization, resolving a long-standing open problem.
  • The algorithm computes both pl0(s) and pl1(s) — the minimum even and odd number of palindromic factors — in a single linear-time pass.
  • The total time complexity of the algorithm is proven to be O(n) using bounds on the number of processed palindromic series and range updates, leveraging the Fine–Wilf theorem and period properties.
  • An offline algorithm reconstructs an explicit k-factorization in O(n) time by traversing the string in reverse and using precomputed factorization lengths.
  • The method overcomes limitations of prior O(n log n) approaches by introducing novel chunk-based range operations and period-aware data structures.
  • The solution is optimal in the word-RAM model, achieving the theoretical lower bound for this problem.

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.