arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1607.00138cs.DScs.FL
收藏

模式匹配算法的多项式自动机表示

Representing Pattern Matching Algorithms by Polynomial-Size Automata

Tobias Marschall, Noemi E. Passing

摘要:

在文本$T\inΣ^n$中找到模式$S\inΣ^m$的精确出现的模式匹配算法已经相对于渐近最佳、最差和平均情况运行时间被广泛地分析。对于更详细的分析,已经考虑了在针对固定模式$S$搜索长度为$n$的随机文本时由算法$\mathcal{A}$执行的文本字符访问$X^{\mathcal{A},S}_n$的数量。构建反映模式匹配算法行为的状态空间和相应的转移规则(例如,在马尔科夫链中)是渐进($n\to\infty$)和非渐进状态下现有的$X^{\mathcal{A},S}_n$分析中的关键步骤。因此,这种状态空间的大小是这种分析的关键参数。在本文中,我们介绍了一种通用的方法来构建相应的状态空间,并证明它适用于广泛的算法,包括Boyer-Moore(BM),Boyer-Moore-Horspool(BMH),向后Oracle匹配(BOM),向后(非确定性)DAWG匹配(B(N)DM)。在所有情况下,除了BOM,我们的方法导致状态空间的大小为$O(m^3)$模式长度$m$,以前只获得了BMH的结果。在所有其他情况下,只有$m$中的状态空间具有指数大小。我们的研究结果立即意味着一个算法来计算固定$S$,固定$n$,和$\mathcal{A}\in\{\text{BM},\text{BMH},\text{B(N)DM}\}$在多项式时间的一个非常普遍的一类随机文本模型的$X^{\mathcal{A},S}_n$的分布。

英文摘要:

Pattern matching algorithms to find exact occurrences of a pattern $S\inΣ^m$ in a text $T\inΣ^n$ have been analyzed extensively with respect to asymptotic best, worst, and average case runtime. For more detailed analyses, the number of text character accesses $X^{\mathcal{A},S}_n$ performed by an algorithm $\mathcal{A}$ when searching a random text of length $n$ for a fixed pattern $S$ has been considered. Constructing a state space and corresponding transition rules (e.g. in a Markov chain) that reflect the behavior of a pattern matching algorithm is a key step in existing analyses of $X^{\mathcal{A},S}_n$ in both the asymptotic ($n\to\infty$) and the non-asymptotic regime. The size of this state space is hence a crucial parameter for such analyses. In this paper, we introduce a general methodology to construct corresponding state spaces and demonstrate that it applies to a wide range of algorithms, including Boyer-Moore (BM), Boyer-Moore-Horspool (BMH), Backward Oracle Matching (BOM), and Backward (Non-Deterministic) DAWG Matching (B(N)DM). In all cases except BOM, our method leads to state spaces of size $O(m^3)$ for pattern length $m$, a result that has previously only been obtained for BMH. In all other cases, only state spaces with size exponential in $m$ had been reported. Our results immediately imply an algorithm to compute the distribution of $X^{\mathcal{A},S}_n$ for fixed $S$, fixed $n$, and $\mathcal{A}\in\{\text{BM},\text{BMH},\text{B(N)DM}\}$ in polynomial time for a very general class of random text models.

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

↑