Skip to main content
QUICK REVIEW

[论文解读] Alphabet-Dependent String Searching with Wexponential Search Trees

Johannes Fischer, Paweł Gawrychowski|arXiv (Cornell University)|Feb 14, 2013
Algorithms and Data Compression参考文献 12被引用 5
一句话总结

本文提出Wexponential Search Trees,一种数据结构,可在字典序依赖的Trie中实现确定性最坏情况时间复杂度为$O(m + \lg\lg\sigma)$的字符串搜索(静态Trie)和$O(m + \frac{\lg^2\lg\sigma}{\lg\lg\lg\sigma})$(动态Trie)。该方法结合加权指数搜索树与虚拟分支节点及增量更新机制,实现了对字母表大小$\sigma$的改进对数依赖,优于先前的$O(m + \lg\sigma)$时间复杂度。

ABSTRACT

It is widely assumed that $O(m+\lg σ)$ is the best one can do for finding a pattern of length $m$ in a compacted trie storing strings over an alphabet of size $σ$, if one insists on linear-size data structures and deterministic worst-case running times [Cole et al., ICALP'06]. In this article, we first show that a rather straightforward combination of well-known ideas yields $O(m+\lg\lg σ)$ deterministic worst-case searching time for static tries. Then we move on to dynamic tries, where we achieve a worst-case bound of $O(m+\frac{\lg^{2}\lgσ}{\lg\lg\lgσ})$ per query or update, which should again be compared to the previously known $O(m+\lgσ)$ deterministic worst-case bounds [Cole et al., ICALP'06], and to the alphabet \emph{in}dependent $O(m+\sqrt{\lg n/\lg\lg n})$ deterministic worst-case bounds [Andersson and Thorup, SODA'01], where $n$ is the number of nodes in the trie. The basis of our update procedure is a weighted variant of exponential search trees which, while simple, might be of independent interest. As one particular application, the above bounds (static and dynamic) apply to suffix trees. There, an update corresponds to pre- or appending a letter to the text, and an additional goal is to do the updates quicker than rematching entire suffixes. We show how to do this in $O(\lg\lg n + \frac{\lg^{2}\lgσ}{\lg\lg\lgσ})$ time, which improves the previously known $O(\lg n)$ bound [Amir et al., SPIRE'05].

研究动机与目标

  • 为克服先前认为最优的确定性线性空间Trie中$O(m + \lg\sigma)$的最坏情况搜索时间复杂度。
  • 设计一种动态数据结构,支持在Trie中高效更新与查询,并改进对字母表大小$\sigma$的依赖关系。
  • 通过将最坏情况时间从$O(\lg n)$降低至$O(\lg\lg n + \frac{\lg^2\lg\sigma}{\lg\lg\lg\sigma})$,实现更快的后缀树更新与模式匹配。
  • 提出一种加权指数搜索树变体,支持可控最坏情况开销的增量、确定性更新。

提出的方法

  • 引入加权指数搜索树的变体,通过动态插入虚拟分支节点来控制边长,从而维持平衡。
  • 为每条边设置一个主进程,该进程在处理$\frac{s}{4}$次更新后,逐步分割长边并使节点成为分支节点,确保每次分割耗时$O(\sigma)$。
  • 在更新过程中,每个节点维护双指针(旧边和新边),并使用链表追踪软链接,从而实现增量式数组构造。
  • 通过遍历字母表并按节点遍历的逆序更新指针,逐步构建新边的数组,以保持一致性。
  • 将该结构应用于后缀树,将文本扩展视为字符串插入操作,实现在更新后支持高效的在线模式匹配。
  • 采用基于队列的系统,检测边长是否超过阈值$s$,一旦超过则触发边分割与节点分支,以维持性能界限。

实验结果

研究问题

  • RQ1我们能否在静态压缩Trie中实现$O(m + \lg\lg\sigma)$的确定性最坏情况搜索时间复杂度,且保持线性空间?
  • RQ2我们能否在保持线性空间的前提下,将Trie中的动态更新时间从$O(m + \lg\sigma)$降低至$O(m + \frac{\lg^2\lg\sigma}{\lg\lg\lg\sigma})$?
  • RQ3所提出的结构能否应用于后缀树,以支持更快的文本扩展与模式查询?
  • RQ4是否可能通过增量更新避免后缀的完全重新处理,同时维持确定性最坏情况性能?

主要发现

  • 该论文在静态压缩Trie中实现了前缀查询与前驱查询的$O(m + \lg\lg\sigma)$确定性最坏情况时间复杂度,优于先前的$O(m + \lg\sigma)$界限。
  • 对于动态Trie,所提结构支持在$O(m + \frac{\lg^2\lg\sigma}{\lg\lg\lg\sigma})$的确定性最坏情况时间复杂度内完成更新与查询,优于先前的$O(m + \lg\sigma)$界限。
  • 当在文本前添加字符时,该方法将后缀树的最坏情况更新代价从$O(\lg n)$降低至$O(\lg\lg n + \frac{\lg^2\lg\sigma}{\lg\lg\lg\sigma})$。
  • 通过使用虚拟分支节点与增量边分割,确保任意边的长度不超过$\frac{3}{2}s$,从而维持高效的搜索与更新性能。
  • 主进程机制确保每个节点在其轻子树的$\frac{s}{2}$次更新内被设为分支节点,从而保证摊还效率。
  • 该数据结构支持线性空间存储,并在$\sigma = n^{O(1)}$时,实现静态Trie的$O(n)$时间确定性构造。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。