arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.12146cs.DS
收藏

亚线性时间的Lempel-Ziv(LZ77)因子分解

Lempel-Ziv (LZ77) Factorization in Sublinear Time

Dominik Kempa, Tomasz Kociumaka

AI总结:

本研究提出首个亚线性时间LZ77因子分解算法,打破近50年线性时间壁垒,同时构建高效索引解决其在线变体,在字符串处理领域具有重要理论意义。

摘要:

Lempel-Ziv(LZ77)因子分解是字符串处理中的一个基础问题:将给定字符串$T$从左到右贪心划分为若干块(称为短语),使得每个短语要么是某个字母的最左出现,要么是未处理后缀的最长前缀,且该前缀在$T$的更早位置有另一次出现。由于应用广泛,LZ77因子分解是字符串领域研究最多的问题之一。自提出以来的47年间,研究者针对并行、GPU、外存、量子等不同计算模型开发了多种算法。但值得注意的是,最基础变体的复杂度仍未解决:RAM模型下所有现有算法的运行时间均为$Ω(n)$,与$Ω(n/\log n)$的下界相差$Θ(\log n)$倍(该下界源于读取输入的必要性:对于$T\in\{0,1\}^{n}$,读取输入需要$Θ(n/\log n)$空间)。\n 我们提出了首个$o(n)$时间的LZ77因子分解算法,打破了近50年来的线性时间壁垒。对于$T\in\{0,1\}^{n}$,我们的算法运行时间为$\mathcal{O}(n/\sqrt{\log n})=o(n)$,且使用最优的$\mathcal{O}(n/\log n)$工作空间。我们的算法可推广到字母表$Σ=[0..σ)$的情况,其中$σ=n^{\mathcal{O}(1)}$,此时运行时间和工作空间分别变为$\mathcal{O}((n\logσ)/\sqrt{\log n})$和$\mathcal{O}(n/\log_σ n)$。为得到该算法,我们证明了一个更具一般性的结论:对于任意常数$ε\in(0,1)$和$T\in[0..σ)^{n}$,我们可以在$\mathcal{O}((n\logσ)/\sqrt{\log n})$时间和$\mathcal{O}(n/\log_σn)$空间内构建一个大小为$\mathcal{O}(n/\log_σn)$的索引,给定任意子串$P=T[j..j+\ell)$(以$(j,\ell)$表示),该索引能在$\mathcal{O}(\log^εn)$时间内计算出$P$在$T$中的最左出现位置。换言之,我们解决了LZ77问题的索引/在线变体。

英文摘要:

Lempel-Ziv (LZ77) factorization is a fundamental problem in string processing: Greedily partition a given string $T$ from left to right into blocks (called phrases) so that each phrase is either the leftmost occurrence of a letter or the longest prefix of the unprocessed suffix that has another occurrence earlier in $T$. Due to numerous applications, LZ77 factorization is one of the most studied problems on strings. In the 47 years since its inception, several algorithms were developed for different models of computation, including parallel, GPU, external-memory, and quantum. Remarkably, however, the complexity of the most basic variant is still not settled: All existing algorithms in the RAM model run in $Ω(n)$ time, which is a $Θ(\log n)$ factor away from the lower bound of $Ω(n/\log n)$ (following from the necessity to read the input, which takes $Θ(n/\log n)$ space for $T\in\{0,1\}^{n}$). We present the first $o(n)$-time algorithm for LZ77 factorization, breaking the linear-time barrier present for nearly 50 years. For $T\in\{0,1\}^{n}$, our algorithm runs in $\mathcal{O}(n/\sqrt{\log n})=o(n)$ time and uses the optimal $\mathcal{O}(n/\log n)$ working space. Our algorithm generalizes to $Σ=[0..σ)$, where $σ=n^{\mathcal{O}(1)}$. The runtime and working space then become $\mathcal{O}((n\logσ)/\sqrt{\log n})$ and $\mathcal{O}(n/\log_σ n)$. To obtain our algorithm, we prove a more general result: For any constant $ε\in(0,1)$ and $T\in[0..σ)^{n}$, in $\mathcal{O}((n\logσ)/\sqrt{\log n})$ time and using $\mathcal{O}(n/\log_σn)$ space, we can construct an $\mathcal{O}(n/\log_σn)$-size index that, given any $P=T[j..j+\ell)$ (represented as $(j,\ell)$), computes the leftmost occurrence of $P$ in $T$ in $\mathcal{O}(\log^εn)$ time. In other words, we solve the indexing/online variant of the LZ77 problem.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑