Abstract
Given two strings S and T, each of length at most n, the longest common substring (LCS) problem is to find a longest substring common to S and T. This is a classical problem in computer science with an O(n) -time solution. In the fully dynamic setting, edit operations are allowed in either of the two strings, and the problem is to find an LCS after each edit. We present the first solution to the fully dynamic LCS problem requiring sublinear time in n per edit operation. In particular, we show how to find an LCS after each edit operation in O~ (n2 / 3) time, after O~ (n) -time and space preprocessing. This line of research has been recently initiated in a somewhat restricted dynamic variant by Amir et al. [SPIRE 2017]. More specifically, the authors presented an O~ (n) -sized data structure that returns an LCS of the two strings after a single edit operation (that is reverted afterwards) in O~ (1) time. At CPM 2018, three papers (Abedin et al., Funakoshi et al., and Urabe et al.) studied analogously restricted dynamic variants of problems on strings; specifically, computing the longest palindrome and the Lyndon factorization of a string after a single edit operation. We develop dynamic sublinear-time algorithms for both of these problems as well. We also consider internal LCS queries, that is, queries in which we are to return an LCS of a pair of substrings of S and T. We show that answering such queries is hard in general and propose efficient data structures for several restricted cases.
Original language | English |
---|---|
Pages (from-to) | 3707-3743 |
Number of pages | 37 |
Journal | Algorithmica |
Volume | 82 |
Issue number | 12 |
DOIs | |
State | Published - 1 Dec 2020 |
Bibliographical note
Publisher Copyright:© 2020, The Author(s).
Funding
Amihood Amir was partially supported by Israel Science Foundation (ISF) Grant 1475/18, and Binational Science Foundation (BSF) Grant 2018141. Panagiotis Charalampopoulos was partially supported by a King’s College London NMS Faculty Studentship, an Educational Grant by the A. G. Leventis Foundation and Israel Science Foundation (ISF) Grant 794/13. Jakub Radoszewski was supported by the “Algorithms for text processing with errors and uncertainties” project carried out within the HOMING programme of the Foundation for Polish Science co-financed by the European Union under the European Regional Development Fund, Project No. POIR.04.04.00-00-24BA/16.
Funders | Funder number |
---|---|
King’s College London | |
European Commission | |
United States-Israel Binational Science Foundation | 2018141 |
Fundacja na rzecz Nauki Polskiej | |
Israel Science Foundation | 1475/18 |
A.G. Leventis Foundation | 794/13 |
European Regional Development Fund | POIR.04.04.00-00-24BA/16 |
Keywords
- Dynamic algorithms
- Longest common substring
- String algorithms