Shortest cover after edit
Kazuki Mitani, Takuya Mieno, Kazuhisa Seto, Takashi Horiyama
TL;DR
The paper studies how the longest border and the shortest cover of a string change under a single edit, within the after-edit model. It formalizes two problems, LBAE (longest border after edit) and SCAE (shortest cover after edit), and proposes a data structure of size $O(n)$ that supports both queries in $O(\ell \log n)$ time after an edit of length $\ell$, with an $O(n)$-time construction on the original string of length $n$. The approach targets dynamic string analysis of quasi-periodic structures and demonstrates that efficient after-edit reporting is possible for border/cover queries. This work lays groundwork towards fully dynamic maintenance of covers and borders and has potential applications in pattern matching and data compression where quasi-periodic structure is relevant. The main contribution is achieving near-linear preprocessing and sublinear per-edit query time for these two intertwined quasi-periodic measures.
Abstract
This paper investigates the (quasi-)periodicity of a string when the string is edited. A string $C$ is called a cover (as known as a quasi-period) of a string $T$ if each character of $T$ lies within some occurrence of $C$. By definition, a cover of $T$ must be a border of $T$; that is, it occurs both as a prefix and as a suffix of $T$. In this paper, we focus on the changes in the longest border and the shortest cover of a string when the string is edited only once. We propose a data structure of size $O(n)$ that computes the longest border and the shortest cover of the string in $O(\ell \log n)$ time after an edit operation (either insertion, deletion, or substitution of some string) is applied to the input string $T$ of length $n$, where $\ell$ is the length of the string being inserted or substituted. The data structure can be constructed in $O(n)$ time given string $T$.
