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

最优时空下的稀疏后缀树构造

Sparse Suffix Tree Construction in Optimal Time and Space

Paweł Gawrychowski, Tomasz Kociumaka

摘要:

后缀树(以及与之密切相关的后缀数组)是一种基本的结构,它通过按字典顺序存储所有后缀来捕获给定文本的所有子串。在某些应用中,我们使用$b$感兴趣的后缀的子集,这些后缀存储在所谓的稀疏后缀树中。由于该结构的大小为$Θ(b)$,因此自然会寻求一种仅使用空间的$O(b)$字的构造算法,假设对文本的只读随机访问。我们为这个问题设计了一个线性时间蒙特卡罗算法,从而解决了Bille等人明确提出的一个悬而未决的问题。[TALG 2016]。I等人[STACS 2014]之前已知的最佳算法在$O(n\log b)$时间内工作。我们的解决方案在$n/b$轮中进行;在第$r$轮中,我们考虑从$r$模$n/b$全等位置开始的所有后缀。通过保持滚动哈希,我们按字典顺序排序所有感兴趣的后缀,然后将它们与已经考虑过的后缀合并。为了有效地合并,我们还需要在小空间中回答LCE查询。通过插入Bille等人[CPM 2015]的结构,我们获得了$O(n+b\log b)$时间复杂度。我们改进了这种结构,这意味着一个线性时间稀疏后缀树的构造算法。我们补充我们的Monte Carlo算法与确定性验证程序。验证需要$O(n\sqrt{\log b})$时间,这改善了I等人[STACS 2014]获得的$O(n\log b)$的范围。这是通过首先观察到在先前的解决方案中完成的修剪使用具有小乘法拉伸的图空间的概念具有相当清晰的描述来获得的。然后,我们能够通过两次应用差异覆盖来减少验证时间。结合Monte Carlo算法,给出了$O(n\sqrt{\log b})$ -时间和$O(b)$ -空间的Las Vegas算法.

英文摘要:

Suffix tree (and the closely related suffix array) are fundamental structures capturing all substrings of a given text essentially by storing all its suffixes in the lexicographical order. In some applications, we work with a subset of $b$ interesting suffixes, which are stored in the so-called sparse suffix tree. Because the size of this structure is $Θ(b)$, it is natural to seek a construction algorithm using only $O(b)$ words of space assuming read-only random access to the text. We design a linear-time Monte Carlo algorithm for this problem, hence resolving an open question explicitly stated by Bille et al. [TALG 2016]. The best previously known algorithm by I et al. [STACS 2014] works in $O(n\log b)$ time. Our solution proceeds in $n/b$ rounds; in the $r$-th round, we consider all suffixes starting at positions congruent to $r$ modulo $n/b$. By maintaining rolling hashes, we lexicographically sort all interesting suffixes starting at such positions, and then we merge them with the already considered suffixes. For efficient merging, we also need to answer LCE queries in small space. By plugging in the structure of Bille et al. [CPM 2015] we obtain $O(n+b\log b)$ time complexity. We improve this structure, which implies a linear-time sparse suffix tree construction algorithm. We complement our Monte Carlo algorithm with a deterministic verification procedure. The verification takes $O(n\sqrt{\log b})$ time, which improves upon the bound of $O(n\log b)$ obtained by I et al. [STACS 2014]. This is obtained by first observing that the pruning done inside the previous solution has a rather clean description using the notion of graph spanners with small multiplicative stretch. Then, we are able to decrease the verification time by applying difference covers twice. Combined with the Monte Carlo algorithm, this gives us an $O(n\sqrt{\log b})$-time and $O(b)$-space Las Vegas algorithm.

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

↑