Skip to main content
QUICK REVIEW

[Paper Review] Dynamic Longest Common Substring in Polylogarithmic Time

Panagiotis Charalampopoulos, Paweł Gawrychowski|arXiv (Cornell University)|Jan 1, 2020
Algorithms and Data CompressionComputer Science31 references3 citations
TL;DR

This paper presents a dynamic algorithm for maintaining the longest common substring (LCS) of two strings undergoing edit operations, achieving an amortized update time of O(log⁷n) with high probability. The approach leverages dynamic tree structures with labeled bicolored leaves and a novel application of string parsing consistency, significantly improving upon the prior ˜O(n²/³) bound and establishing a near-optimal lower bound of Ω(log n / log log n) for any polynomial-size data structure.

ABSTRACT

The longest common substring problem consists in finding a longest string that appears as a (contiguous) substring of two input strings. We consider the dynamic variant of this problem, in which we are to maintain two dynamic strings $S$ and $T$, each of length at most $n$, that undergo substitutions of letters, in order to be able to return a longest common substring after each substitution. Recently, Amir et al. [ESA 2019] presented a solution for this problem that needs only $ ilde{\mathcal{O}}(n^{2/3})$ time per update. This brought the challenge of determining whether there exists a faster solution with polylogarithmic update time, or (as is the case for other dynamic problems), we should expect a polynomial (conditional) lower bound. We answer this question by designing a significantly faster algorithm that processes each substitution in amortized $\log^{\mathcal{O}(1)} n$ time with high probability. Our solution relies on exploiting the local consistency of the parsing of a collection of dynamic strings due to Gawrychowski et al. [SODA 2018], and on maintaining two dynamic trees with labeled bicolored leaves, so that after each update we can report a pair of nodes, one from each tree, of maximum combined weight, which have at least one common leaf-descendant of each color. We complement this with a lower bound of $Ω(\log n/ \log\log n)$ for the update time of any polynomial-size data structure that maintains the LCS of two dynamic strings, and the same lower bound for the update time of any data structure of size $ ilde{\mathcal{O}}(n)$ that maintains the LCS of a static and a dynamic string. Both lower bounds hold even allowing amortization and randomization.

Motivation & Objective

  • To design a dynamic data structure that maintains the longest common substring (LCS) of two strings under edit operations with polylogarithmic update time.
  • To resolve the open question of whether a polylogarithmic update time is achievable for the fully dynamic LCS problem.
  • To establish tight conditional lower bounds for dynamic LCS data structures, even under amortization and randomization.
  • To extend PĂtrařscu's reduction from lopsided set disjointness to butterfly reachability for dynamic string problems.

Proposed method

  • Employing the local consistency of string parsing from Gawrychowski et al. (SODA 2018) to maintain dynamic string representations.
  • Maintaining two dynamic trees with labeled bicolored leaves to represent and update the dynamic strings efficiently.
  • Using a gadget-based construction to encode activation and query patterns for the longest common substring via substring matching.
  • Reducing the dynamic LCS problem to the activation of leaf pairs in labeled trees, where LCS length corresponds to path depth and label match.
  • Applying a credits-based deamortization technique to transform expected amortized bounds into worst-case bounds for lower bound analysis.
  • Extending PĂtrařscu's reduction from lopsided set disjointness to butterfly reachability to derive conditional lower bounds.

Experimental results

Research questions

  • RQ1Can the fully dynamic longest common substring problem be solved with polylogarithmic update time per edit operation?
  • RQ2Is there a conditional lower bound that rules out polylogarithmic update time for dynamic LCS, even with amortization or randomization?
  • RQ3Can the dynamic LCS problem be reduced to a known hard problem like butterfly reachability to establish tight complexity bounds?
  • RQ4Does the use of dynamic trees with labeled bicolored leaves and string parsing consistency enable a significant improvement over prior approaches?

Key findings

  • The paper presents a dynamic algorithm that maintains the longest common substring in amortized O(log⁷n) time per edit operation with high probability.
  • The proposed algorithm improves upon the prior ˜O(n²/³) update time bound, achieving an exponential speedup.
  • A conditional lower bound of Ω(log n / log log n) is established for any polynomial-size data structure maintaining the LCS of two dynamic strings.
  • The same lower bound holds for the case of a static and a dynamic string, even under amortization and Las Vegas randomization.
  • The lower bound is derived via a novel extension of PĂtrařscu's reduction from lopsided set disjointness to butterfly reachability.
  • The results show that the proposed algorithm is nearly optimal, up to a polylogarithmic factor, under standard complexity assumptions.

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.