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

语法压缩字符串中的排序、选择和访问

Rank, select and access in grammar-compressed strings

Djamal Belazzougui, Simon J. Puglisi, Yasuo Tabei

摘要:

给定$σ$符号的固定字母表上的长度为$N$的字符串$S$,语法压缩器产生大小为$n$的上下文无关语法$G$,其生成$S$并且仅生成$S$。在本文中,我们描述的数据结构,以支持以下操作的语法压缩字符串:$\mbox{rank}_c(S,i)$(返回的符号$c$的出现次数之前的位置$i$在$S$); $\mbox{select}_c(S,i)$(返回的位置$i$的$c$在$S$);和$\mbox{access}(S,i,j)$(返回子字符串$S[i,j]$)。对于秩和选择,我们描述了支持$O(\log N)$时间中的两个操作的大小为$O(nσ\log N)$位的数据结构。我们提出了另一种结构,使用$O(nσ\log (N/n)(\log N)^{1+ε})$位,并支持在$O(\log N/\log\log N)$,其中$ε>0$是一个任意常数的两个查询。据我们所知,我们是第一个研究的渐进复杂性的排名和选择语法压缩设置,我们提供了一个硬度的结果表明,显着提高我们实现的界限将意味着一个重大突破的硬图论问题。我们的主要结果访问是一种方法,需要$O(n\log N)$位的空间和$O(\log N+m/\log_σN)$时间提取$m=j-i+1$连续符号从$S$。或者,我们可以使用$O(n\log (N/n)(\log N)^{1+ε})$位空间来实现$O(\log N/\log\log N+m/\log_σN)$查询时间。这与Verbin和Yu针对其中$N$与$n$多项式相关的字符串所声明的下限相匹配。

英文摘要:

Given a string $S$ of length $N$ on a fixed alphabet of $σ$ symbols, a grammar compressor produces a context-free grammar $G$ of size $n$ that generates $S$ and only $S$. In this paper we describe data structures to support the following operations on a grammar-compressed string: $\mbox{rank}_c(S,i)$ (return the number of occurrences of symbol $c$ before position $i$ in $S$); $\mbox{select}_c(S,i)$ (return the position of the $i$th occurrence of $c$ in $S$); and $\mbox{access}(S,i,j)$ (return substring $S[i,j]$). For rank and select we describe data structures of size $O(nσ\log N)$ bits that support the two operations in $O(\log N)$ time. We propose another structure that uses $O(nσ\log (N/n)(\log N)^{1+ε})$ bits and that supports the two queries in $O(\log N/\log\log N)$, where $ε>0$ is an arbitrary constant. To our knowledge, we are the first to study the asymptotic complexity of rank and select in the grammar-compressed setting, and we provide a hardness result showing that significantly improving the bounds we achieve would imply a major breakthrough on a hard graph-theoretical problem. Our main result for access is a method that requires $O(n\log N)$ bits of space and $O(\log N+m/\log_σN)$ time to extract $m=j-i+1$ consecutive symbols from $S$. Alternatively, we can achieve $O(\log N/\log\log N+m/\log_σN)$ query time using $O(n\log (N/n)(\log N)^{1+ε})$ bits of space. This matches a lower bound stated by Verbin and Yu for strings where $N$ is polynomially related to $n$.

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

↑