🤖 AI Summary
This paper addresses the problem of compactly representing all maximal palindromic substrings in a string. We propose a succinct data structure occupying only $O(n)$ bits—exponentially smaller than the standard $O(n log n)$-bit representation. Our method builds upon Manacher’s algorithm, integrating integer array compression with carefully engineered auxiliary data structures to implicitly encode all maximal palindrome information. The resulting structure supports two key queries efficiently: (1) retrieving, in $O(1)$ time, the length of the maximal palindrome centered at any given position; and (2) computing, in $O(log n)$ time, the length of the longest palindromic substring within any query interval. By achieving optimal linear-bit space while preserving fast query guarantees, our approach significantly enhances practicality and scalability for large-scale palindrome detection in formal language analysis and bioinformatics applications.
📝 Abstract
Palindromes are strings that read the same forward and backward. The computation of palindromic structures within strings is a fundamental problem in string algorithms, being motivated by potential applications in formal language theory and bioinformatics. Although the number of palindromic factors in a string of length $n$ can be quadratic, they can be implicitly represented in $O(n log n)$ bits of space by storing the lengths of all maximal palindromes in an integer array, which can be computed in $O(n)$ time [Manacher, 1975]. In this paper, we propose a novel $O(n)$-bit representation of all maximal palindromes in a string, which enables $O(1)$-time retrieval of the length of the maximal palindrome centered at any given position. Since Manacher's algorithm and the notion of maximal palindromes are widely utilized for solving numerous problems involving palindromic structures, our compact representation will accelerate the development of more space-efficient solutions. Indeed, as the first application of our compact representation of maximal palindromes, we present a data structure of size $O(n)$ bits that can compute the longest palindrome appearing in any given factor of the string in $O(log n)$ time.