Lempel-Ziv (LZ77) Factorization in Sublinear Time

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kempa, Dominik, Kociumaka, Tomasz
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909652072005632
author Kempa, Dominik
Kociumaka, Tomasz
author_facet Kempa, Dominik
Kociumaka, Tomasz
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2409_12146
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Lempel-Ziv (LZ77) Factorization in Sublinear Time
Kempa, Dominik
Kociumaka, Tomasz
Data Structures and Algorithms
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.
title Lempel-Ziv (LZ77) Factorization in Sublinear Time
topic Data Structures and Algorithms
url https://arxiv.org/abs/2409.12146