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

基于语法压缩文本的卷积计算

Computing convolution on grammar-compressed text

Toshiya Tanaka, Tomohiro I, Shunsuke Inenaga, Hideo Bannai, Masayuki Takeda

摘要:

长度为$N$的文本串$S$和长度为$m$的模式串$P$之间的卷积可以通过FFT在$O(N \log m)$时间内计算。众所周知,各种类型的近似字符串匹配问题都可以简化为卷积。在本文中,我们假设输入的文本字符串是在一个压缩的形式,作为一个\emph{straight-line program (SLP)},这是一个上下文无关的语法在乔姆斯基范式,推导出一个单一的字符串。给定大小为$n$的SLP $\mathcal{S}$描述长度为$N$的文本$S$,以及长度为$m$的未压缩模式$P$,我们提出了一个简单的$O(nm \log m)$时间算法来计算$S$和$P$之间的卷积。然后,我们表明,这可以提高到$O(\min\{nm, N-α\} \log m)$的时间,其中$α\geq 0$是一个值,表示的冗余量,SLP捕获的长度$m$子串。改进的关键是我们的新算法,在$O(r \log m)$时间内计算大小为$r$的trie和长度为$m$的模式串$P$之间的卷积。

英文摘要:

The convolution between a text string $S$ of length $N$ and a pattern string $P$ of length $m$ can be computed in $O(N \log m)$ time by FFT. It is known that various types of approximate string matching problems are reducible to convolution. In this paper, we assume that the input text string is given in a compressed form, as a \emph{straight-line program (SLP)}, which is a context free grammar in the Chomsky normal form that derives a single string. Given an SLP $\mathcal{S}$ of size $n$ describing a text $S$ of length $N$, and an uncompressed pattern $P$ of length $m$, we present a simple $O(nm \log m)$-time algorithm to compute the convolution between $S$ and $P$. We then show that this can be improved to $O(\min\{nm, N-α\} \log m)$ time, where $α\geq 0$ is a value that represents the amount of redundancy that the SLP captures with respect to the length-$m$ substrings. The key of the improvement is our new algorithm that computes the convolution between a trie of size $r$ and a pattern string $P$ of length $m$ in $O(r \log m)$ time.

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

↑