π€ AI Summary
This study addresses the problem of efficiently identifying the longest palindromic substring in strings containing wildcards, where each wildcard can match any character and thereby disrupts the symmetry exploited by classical palindrome-finding algorithms. To overcome this challenge, we present the first non-trivial algorithm that operates within linear space, leveraging a novel wildcard-based longest common extension (wildcard-LCE) technique. Our approach establishes a continuous trade-off between time and memory usage, achieving substantial improvements in the timeβmemory product across a range of parameter settings. Furthermore, the method generalizes effectively to the more challenging setting allowing up to k mismatches, yielding both theoretical advances and practical performance gains.
π Abstract
This paper addresses the problem of identifying palindromic factors in texts that include wildcards -- special characters that match all others. These symbols challenge many classical algorithms, as numerous combinatorial properties are not satisfied in their presence. We apply existing wildcard-LCE techniques to obtain a continuous time-memory tradeoff, and present the first non-trivial linear-space algorithm for computing all maximal palindromes with wildcards, improving the best known time-memory product in certain parameter ranges. Our main results are algorithms to find and approximate all maximal palindromes in a given text. We also generalize both methods to the $k$-mismatches setting, with or without wildcards.