arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2602.10864cs.DS
收藏

在语法压缩字符串中的随机访问:几乎所有参数范围内的最优折中

Random Access in Grammar-Compressed Strings: Optimal Trade-Offs in Almost All Parameter Regimes

Max Planck Institute for Informatics(马克斯·普朗克信息学研究所);Saarbrücken Graduate School of Computer Sciences(萨尔布吕肯计算机科学研究生院)

Anouk Duyster, Tomasz Kociumaka

AI总结:

研究在语法压缩字符串中随机访问的最优折中,提出在不同参数下高效的数据结构,支持快速查询和扩展功能。

摘要:

一个对字符串T∈[0..σ)^n的随机访问查询请求给定位置i∈[0..n)的字符T[i]。在O(nlogσ)位空间内,这项基本任务允许常数时间查询。虽然这是在最坏情况下的最优解,但许多研究集中在可压缩字符串上,希望找到更小的数据结构仍能高效查询。我们研究了语法压缩设置,其中T由一个直线语法表示。我们的主要结果是一个通用折中,优化随机访问时间作为字符串长度n、语法大小(生产总长度)g、字母表大小σ、数据结构大小M和单词大小w=Ω(logn)的函数。对于任何M满足glogn<Mw<nlogσ,我们展示了一个O(M)大小的数据结构,查询时间为O(log(nlogσ/Mw)/log(Mw/glogn))。值得注意的是,我们还证明了一个匹配的无条件下界,适用于所有参数范围,除了非常小的语法和相对较小的数据结构。先前的工作集中在查询时间作为n的函数上,仅用O(g)空间实现了O(logn)时间[ Bille et al.; SIAM J. Comput. 2015],以及用O(logn/loglogn)时间用O(glog^εn)空间[ Belazzougui et al.; ESA'15], [ Ganardi, Jeż, Lohrey; J. ACM 2021]。唯一的紧下界[ Verbin and Yu; CPM'13]是Ω(logn/loglogn)对于w=Θ(logn), n^{Ω(1)}≤g≤n^{1-Ω(1)}, 和M=glog^{Θ(1)}n。相比之下,我们的结果在所有相关参数和几乎所有范围内提供了紧界。我们的数据结构允许高效的确定性构造。它依赖于新的语法转换,这些转换推广了收缩语法[ Ganardi; ESA'21]。除了随机访问外,其变体还支持子字符串提取、排名和选择。

英文摘要:

A Random Access query to a string $T\in [0..σ)^n$ asks for the character $T[i]$ at a given position $i\in [0..n)$. In $O(n\logσ)$ bits of space, this fundamental task admits constant-time queries. While this is optimal in the worst case, much research has focused on compressible strings, hoping for smaller data structures that still admit efficient queries. We investigate the grammar-compressed setting, where $T$ is represented by a straight-line grammar. Our main result is a general trade-off that optimizes Random Access time as a function of string length $n$, grammar size (the total length of productions) $g$, alphabet size $σ$, data structure size $M$, and word size $w=Ω(\log n)$ of the word RAM model. For any $M$ with $g\log n<Mw<n\logσ$, we show an $O(M)$-size data structure with query time $O(\frac{\log(n\logσ\,/\,Mw)}{\log(Mw\,/\,g\log n)})$. Remarkably, we also prove a matching unconditional lower bound that holds for all parameter regimes except very small grammars and relatively small data structures. Previous work focused on query time as a function of $n$ only, achieving $O(\log n)$ time using $O(g)$ space [Bille et al.; SIAM J. Comput. 2015] and $O(\frac{\log n}{\log \log n})$ time using $O(g\log^ε n)$ space for any constant $ε> 0$ [Belazzougui et al.; ESA'15], [Ganardi, Jeż, Lohrey; J. ACM 2021]. The only tight lower bound [Verbin and Yu; CPM'13] was $Ω(\frac{\log n}{\log\log n})$ for $w=Θ(\log n)$, $n^{Ω(1)}\le g\le n^{1-Ω(1)}$, and $M=g\log^{Θ(1)}n$. In contrast, our result yields tight bounds in all relevant parameters and almost all regimes. Our data structure admits efficient deterministic construction. It relies on novel grammar transformations that generalize contracting grammars [Ganardi; ESA'21]. Beyond Random Access, its variants support substring extraction, rank, and select.

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

↑