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

CDAWG索引与语法压缩字符串上的模式匹配

The CDAWG Index and Pattern Matching on Grammar-Compressed Strings

Alan M. Cleary, Joseph Winjum, Jordan Dood, Shunsuke Inenaga

AI总结:

本研究提出将CDAWG用作语法压缩字符串的索引,实现了高效模式匹配,实验验证其运行时性能达当前最优,且空间复杂度符合已知最优渐近界。

摘要:

紧凑有向无环单词图(compact directed acyclic word graph,CDAWG)是可识别字符串所有后缀的最小紧凑自动机。传统上,CDAWG被实现为其所识别字符串的索引,需要o(n)的空间来存储被索引字符串T的副本,其中n=|T|。在本研究中,我们提出将CDAWG用作语法压缩字符串的索引。这一方案支持CDAWG在任意语法压缩字符串上的所有分析功能,本文中我们重点研究模式匹配场景。借助CDAWG索引,可在任意语法压缩字符串上以O(ra(m)+occ)的时间完成模式匹配,仅需额外占用O(er(T))的空间,其中m为模式长度,ra(m)为语法随机访问时间,occ为模式在T中的出现次数,er(T)为T中最大重复子串的右扩展数量。我们的实验表明,即便采用朴素随机访问算法,CDAWG索引在语法压缩字符串的模式匹配任务中仍能达到当前最优的运行时性能。此外我们发现,实验中计算得到的所有语法的规模,均小于其生成字符串的右扩展数量,因此这些语法对应的CDAWG空间复杂度符合已知最优的O(er(T))渐近空间界。

英文摘要:

The compact directed acyclic word graph (CDAWG) is the minimal compact automaton that recognizes all the suffixes of a string. Classically the CDAWG has been implemented as an index of the string it recognizes, requiring $o(n)$ space for a copy of the string $T$ being indexed, where $n=|T|$. In this work, we propose using the CDAWG as an index for grammar-compressed strings. While this enables all analyses supported by the CDAWG on any grammar-compressed string, in this work we specifically consider pattern matching. Using the CDAWG index, pattern matching can be performed on any grammar-compressed string in $\mathcal{O}(\text{ra}(m)+\text{occ})$ time while requiring only $\mathcal{O}(\text{er}(T))$ additional space, where $m$ is the length of the pattern, $\text{ra}(m)$ is the grammar random access time, $\text{occ}$ is the number of occurrences of the pattern in $T$, and $\text{er}(T)$ is the number of right-extensions of the maximal repeats in $T$. Our experiments show that even when using a naïve random access algorithm, the CDAWG index achieves state of the art run-time performance for pattern matching on grammar-compressed strings. Additionally, we find that all of the grammars computed for our experiments are smaller than the number of right-extensions in the string they produce and, thus, their CDAWGs are within the best known $\mathcal{O}(\text{er}(T))$ space asymptotic bound.

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

↑