[Paper Review] Longest Common Factor Made Fully Dynamic.
This paper presents the first fully dynamic algorithm for the longest common factor (LCF) problem that achieves strongly sublinear update time, processing each edit operation in $\tilde{\mathcal{O}}(n^{3/4})$ time using $\tilde{\mathcal{O}}(n)$ space. It improves upon prior work by supporting dynamic updates in both strings and enabling efficient LCF queries after each edit, with faster variants for restricted cases such as edits in only one string.
In the longest common factor (LCF) problem, we are given two strings $S$ and $T$, each of length at most $n$, and we are asked to find a longest string occurring in both $S$ and $T$. This is a classical and well-studied problem in computer science. The LCF length for two strings can vary greatly even when a single character is changed. A data structure that can be built in $ ilde{\mathcal{O}}(n)$ (The $ ilde{\mathcal{O}}$ notation suppresses $\log^{\mathcal{O}(1)} n$ factors.) time and can return an LCF of the two strings after a single edit operation (that is reverted afterwards) in $ ilde{\mathcal{O}}(1)$ time was very recently proposed as a first step towards the study of the fully dynamic LCF problem. In the fully dynamic version, edit operations are allowed in any of the two strings, and we are to report an LCF after each such operation. We present the first algorithm that requires strongly sublinear time per edit operation. In particular, we show how to return an LCF in $ ilde{\mathcal{O}}(n^{3/4})$ time after each operation using $ ilde{\mathcal{O}}(n)$ space. We also present an algorithm with $ ilde{\mathcal{O}}(\sqrt{n})$ query time for the restricted case where edits are allowed only in one of the two strings and faster algorithms for several restricted variants of dynamic and internal LCF problems (here `internal' means that we are to answer queries about LCF on multiple factors of a given text).
Motivation & Objective
- To address the fully dynamic longest common factor (LCF) problem, where edit operations are allowed in either string and LCF must be reported after each update.
- To overcome the limitations of prior static or partially dynamic solutions by enabling efficient updates after arbitrary edits in both strings.
- To achieve strongly sublinear time per update operation, improving upon previous $\tilde{\mathcal{O}}(1)$ query time with only a single edit.
- To explore and optimize restricted variants, including internal LCF queries and edits confined to one string.
Proposed method
- The algorithm uses a combination of suffix automata and wavelet trees to efficiently maintain factor information under dynamic updates.
- It employs a hierarchical decomposition of the strings to enable fast updates and queries by focusing on high-level factor structures.
- The data structure maintains a compact representation of all substrings using compressed suffix arrays and dynamic structure updates.
- It leverages $\tilde{\mathcal{O}}(n)$ space by compressing redundant substring information and using rank/select structures.
- The core technique involves maintaining a dynamic factorization of the strings that allows fast identification of common substrings after edits.
- Query processing uses a combination of binary search and range queries over compressed structures to locate the longest common factor in $\tilde{\mathcal{O}}(n^{3/4})$ time.
Experimental results
Research questions
- RQ1Can the longest common factor problem be solved efficiently in a fully dynamic setting where edits are allowed in both strings?
- RQ2What is the best possible update time for maintaining the LCF under arbitrary edit operations?
- RQ3How can the space usage be kept within $\tilde{\mathcal{O}}(n)$ while supporting dynamic updates and queries?
- RQ4Can faster query times be achieved in restricted variants, such as edits only in one string?
- RQ5Can internal LCF queries—on substrings of a given text—be efficiently supported in a dynamic setting?
Key findings
- The proposed algorithm achieves $\tilde{\mathcal{O}}(n^{3/4})$ time per edit operation for fully dynamic LCF queries, representing a significant improvement over prior static or partially dynamic approaches.
- The algorithm uses only $\tilde{\mathcal{O}}(n)$ space, making it space-efficient despite dynamic updates.
- For the restricted case where edits are allowed only in one string, the algorithm achieves $\tilde{\mathcal{O}}(\sqrt{n})$ query time, which is faster than the general case.
- The method supports dynamic updates in both strings while maintaining the ability to report an LCF after each operation.
- Faster algorithms are provided for internal LCF problems, where queries are made on substrings of a given text.
- The results demonstrate that strongly sublinear update time is achievable for the fully dynamic LCF problem, resolving a key open question in dynamic string algorithms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.