Lempel-Ziv (LZ77) Factorization in Sublinear Time

Dominik Kempa, Tomasz Kociumaka
{"title":"Lempel-Ziv (LZ77) Factorization in Sublinear Time","authors":"Dominik Kempa, Tomasz Kociumaka","doi":"arxiv-2409.12146","DOIUrl":null,"url":null,"abstract":"Lempel-Ziv (LZ77) factorization is a fundamental problem in string\nprocessing: Greedily partition a given string $T$ from left to right into\nblocks (called phrases) so that each phrase is either the leftmost occurrence\nof a letter or the longest prefix of the unprocessed suffix that has another\noccurrence earlier in $T$. Due to numerous applications, LZ77 factorization is\none of the most studied problems on strings. In the 47 years since its\ninception, several algorithms were developed for different models of\ncomputation, including parallel, GPU, external-memory, and quantum. Remarkably,\nhowever, the complexity of the most basic variant is still not settled: All\nexisting algorithms in the RAM model run in $\\Omega(n)$ time, which is a\n$\\Theta(\\log n)$ factor away from the lower bound of $\\Omega(n/\\log n)$\n(following from the necessity to read the input, which takes $\\Theta(n/\\log n)$\nspace for $T\\in\\{0,1\\}^{n}$). We present the first $o(n)$-time algorithm for LZ77 factorization, breaking\nthe linear-time barrier present for nearly 50 years. For $T\\in\\{0,1\\}^{n}$, our\nalgorithm runs in $\\mathcal{O}(n/\\sqrt{\\log n})=o(n)$ time and uses the optimal\n$\\mathcal{O}(n/\\log n)$ working space. Our algorithm generalizes to\n$\\Sigma=[0..\\sigma)$, where $\\sigma=n^{\\mathcal{O}(1)}$. The runtime and\nworking space then become $\\mathcal{O}((n\\log\\sigma)/\\sqrt{\\log n})$ and\n$\\mathcal{O}(n/\\log_{\\sigma} n)$. To obtain our algorithm, we prove a more\ngeneral result: For any constant $\\epsilon\\in(0,1)$ and $T\\in[0..\\sigma)^{n}$,\nin $\\mathcal{O}((n\\log\\sigma)/\\sqrt{\\log n})$ time and using\n$\\mathcal{O}(n/\\log_{\\sigma}n)$ space, we can construct an\n$\\mathcal{O}(n/\\log_{\\sigma}n)$-size index that, given any $P=T[j..j+\\ell)$\n(represented as $(j,\\ell)$), computes the leftmost occurrence of $P$ in $T$ in\n$\\mathcal{O}(\\log^{\\epsilon}n)$ time. In other words, we solve the\nindexing/online variant of the LZ77 problem.","PeriodicalId":501525,"journal":{"name":"arXiv - CS - Data Structures and Algorithms","volume":"27 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Data Structures and Algorithms","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.12146","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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 $\Omega(n)$ time, which is a $\Theta(\log n)$ factor away from the lower bound of $\Omega(n/\log n)$ (following from the necessity to read the input, which takes $\Theta(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 $\Sigma=[0..\sigma)$, where $\sigma=n^{\mathcal{O}(1)}$. The runtime and working space then become $\mathcal{O}((n\log\sigma)/\sqrt{\log n})$ and $\mathcal{O}(n/\log_{\sigma} n)$. To obtain our algorithm, we prove a more general result: For any constant $\epsilon\in(0,1)$ and $T\in[0..\sigma)^{n}$, in $\mathcal{O}((n\log\sigma)/\sqrt{\log n})$ time and using $\mathcal{O}(n/\log_{\sigma}n)$ space, we can construct an $\mathcal{O}(n/\log_{\sigma}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^{\epsilon}n)$ time. In other words, we solve the indexing/online variant of the LZ77 problem.
亚线性时间内的 Lempel-Ziv (LZ77) 因式分解
Lempel-Ziv (LZ77) 因式分解是字符串处理中的一个基本问题:将给定的字符串 $T$ 从左到右贪婪地分割成块(称为词组),使每个词组要么是最左边出现的字母,要么是在 $T$ 中较早出现的未处理后缀的最长前缀。由于应用广泛,LZ77 因式分解是研究最多的字符串问题之一。自其问世以来的 47 年中,针对不同的计算模型,包括并行、GPU、外部内存和量子,开发了多种算法。然而,值得注意的是,最基本变体的复杂度问题仍未解决:RAM 模型中的现有算法运行时间为 $\Omega(n)$,与下限 $\Omega(n/\log n)$相差一个 $\Theta(\log n)$因子(因为必须读取输入,而读取输入需要 $\Tin/{0,1\}^{n}$的 $\Theta(n/\log n)$空间)。我们提出了第一个用于 LZ77 因式分解的 $o(n)$ 时算法,打破了存在近 50 年的线性时间障碍。对于$T\in\{0,1\}^{n}$,我们的算法在$\mathcal{O}(n/\sqrt{log n})=o(n)$时间内运行,并使用最优的$\mathcal{O}(n/\log n)$工作空间。我们的算法适用于$\Sigma=[0...\sigma)$,其中$\sigma=n^{mathcal{O}(1)}$。运行时间和工作空间就变成了$\mathcal{O}((n\log\sigma)/\sqrt{log n})$和$\mathcal{O}(n/\log_{\sigma} n)$。为了得到我们的算法,我们要证明一个更一般的结果:对于任意常数 $\epsilon\in(0,1)$ 和 $T\in[0.\sigma)^{n}$,在$/mathcal{O}((n/log/sigma)//sqrt/{log n})$时间内,使用$/mathcal{O}(n//log_{/sigma}n)$空间,我们可以构造一个$/mathcal{O}(n//log_{/sigma}n)$大小的索引,在给定任意$P=T[j..j+ell)$(表示为 $(j,\ell)$),在$mathcal{O}(\log^\{epsilon}n)$时间内计算 $P$ 在 $T$ 中最左边出现的次数。换句话说,我们解决的是 LZ77 问题的索引/在线变体。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信