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

线性后缀Trie树的在线构造算法

Online Algorithms for Constructing Linear-size Suffix Trie

Diptarama Hendrian, Takuya Takagi, Shunsuke Inenaga

摘要:

后缀树是各种字符串处理的基本数据结构。长度为$n$的字符串$T$的后缀树具有$O(n)$节点和边,并且每个边的字符串标签由$T$中的一对位置编码。因此,即使在构建树之后,输入文本$T$也需要保持存储,并且仍然需要对$T$的随机访问。由Crochemore等人提出的线性大小后缀tries(LST)[Linear-size suffix tries,TCS 638:171-178,2016]是后缀树的“独立”替代方案。即,长度为$n$的串$T$的LST占用$O(n)$总空间,并且以与后缀树相同的效率支持模式匹配和其它任务,而不需要存储输入文本$T$。Crochemore等人提出了一种离线算法,该算法将$T$的后缀树转换成$T$在$O(n \log σ)$时间和$O(n)$空间上的LST,其中$σ$是字母表大小。在本文中,我们提出了两种类型的在线算法,“直接”构造LST,从右到左,从左到右,而不构造后缀树作为中间结构。这两种算法在读取新符号时递增地构造LST,并且不访问先前读取的符号。从右到左构造算法在$O(n \log σ)$时间和$O(n)$空间中工作,从左到右构造算法在$O(n (\log σ+ \log n / \log \log n))$时间和$O(n)$空间中工作。我们的算法的主要特点是,输入的文本不需要存储。

英文摘要:

The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a string $T$ of length $n$ has $O(n)$ nodes and edges, and the string label of each edge is encoded by a pair of positions in $T$. Thus, even after the tree is built, the input text $T$ needs to be kept stored and random access to $T$ is still needed. The linear-size suffix tries (LSTs), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a `stand-alone' alternative to the suffix trees. Namely, the LST of a string $T$ of length $n$ occupies $O(n)$ total space, and supports pattern matching and other tasks in the same efficiency as the suffix tree without the need to store the input text $T$. Crochemore et al. proposed an offline algorithm which transforms the suffix tree of $T$ into the LST of $T$ in $O(n \log σ)$ time and $O(n)$ space, where $σ$ is the alphabet size. In this paper, we present two types of online algorithms which `directly' construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access to the previously read symbols. The right-to-left construction algorithm works in $O(n \log σ)$ time and $O(n)$ space and the left-to-right construction algorithm works in $O(n (\log σ+ \log n / \log \log n))$ time and $O(n)$ space. The main feature of our algorithms is that the input text does not need to be stored.

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

↑