TY - JOUR

T1 - Computing longest palindromic substring after single-character or block-wise edits

AU - Funakoshi, Mitsuru

AU - Nakashima, Yuto

AU - Inenaga, Shunsuke

AU - Bannai, Hideo

AU - Takeda, Masayuki

N1 - Funding Information:
This work was supported by JSPS KAKENHI Grant Numbers JP20J21147 (MF), JP18K18002 (YN), JP17H01697 (SI), JP16H02783 (HB), JP20H04141 (HB), JP18H04098 (MT), and by JST PRESTO Grant Number JPMJPR1922 (SI). The authors thank anonymous referees for helpful comments, in particular, for suggesting simpler solutions for Sections 4.2.2 and 4.2.3 which are described in Appendix.
Funding Information:
This work was supported by JSPS KAKENHI Grant Numbers JP20J21147 (MF), JP18K18002 (YN), JP17H01697 (SI), JP16H02783 (HB), JP20H04141 (HB), JP18H04098 (MT), and by JST PRESTO Grant Number JPMJPR1922 (SI).
Publisher Copyright:
© 2021 Elsevier B.V.

PY - 2021/3/6

Y1 - 2021/3/6

N2 - Palindromes are important objects in strings which have been extensively studied from combinatorial, algorithmic, and bioinformatics points of views. It is known that the length of the longest palindromic substrings (LPSs) of a given string T of length n can be computed in O(n) time by Manacher's algorithm [12]. In this paper, we consider the problem of finding the LPS after the string is edited. We present an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(log(min{σ,logn})) time after a single character substitution, insertion, or deletion, where σ denotes the number of distinct characters appearing in T. We also propose an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(ℓ+loglogn) time, after an existing substring in T is replaced by a string of arbitrary length ℓ.

AB - Palindromes are important objects in strings which have been extensively studied from combinatorial, algorithmic, and bioinformatics points of views. It is known that the length of the longest palindromic substrings (LPSs) of a given string T of length n can be computed in O(n) time by Manacher's algorithm [12]. In this paper, we consider the problem of finding the LPS after the string is edited. We present an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(log(min{σ,logn})) time after a single character substitution, insertion, or deletion, where σ denotes the number of distinct characters appearing in T. We also propose an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(ℓ+loglogn) time, after an existing substring in T is replaced by a string of arbitrary length ℓ.

UR - http://www.scopus.com/inward/record.url?scp=85099287466&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=85099287466&partnerID=8YFLogxK

U2 - 10.1016/j.tcs.2021.01.014

DO - 10.1016/j.tcs.2021.01.014

M3 - Article

AN - SCOPUS:85099287466

VL - 859

SP - 116

EP - 133

JO - Theoretical Computer Science

JF - Theoretical Computer Science

SN - 0304-3975

ER -