保序模式匹配的对偶扫描算法
Duel and sweep algorithm for order-preserving pattern matching
摘要:
给定文本$T$和字母表$Σ$上的模式$P$,经典的精确匹配问题搜索文本$T$中模式$P$的所有出现。与精确匹配问题不同,保序模式匹配(OPPM)考虑的是元素的相对顺序,而不是它们的真实值。在本文中,我们提出了一个有效的算法OPPM问题使用的“双扫描”范式。我们的算法运行在$O(n + m\log m)$时间一般和$O(n + m)$时间的假设下,字符串中的字符可以排序在线性时间的字符串大小。我们还进行了实验,并表明我们的算法是基于KMP的算法更快。最后,我们介绍了二维保序模式匹配,并给出了一种双扫描算法,该算法在双阶段运行于$O(n^2)$时间内,在扫描时间运行于$O(n^2 m)$时间内,并带有$O(m^3)$预处理时间。
英文摘要:
Given a text $T$ and a pattern $P$ over alphabet $Σ$, the classic exact matching problem searches for all occurrences of pattern $P$ in text $T$. Unlike exact matching problem, order-preserving pattern matching (OPPM) considers the relative order of elements, rather than their real values. In this paper, we propose an efficient algorithm for OPPM problem using the "duel-and-sweep" paradigm. Our algorithm runs in $O(n + m\log m)$ time in general and $O(n + m)$ time under an assumption that the characters in a string can be sorted in linear time with respect to the string size. We also perform experiments and show that our algorithm is faster that KMP-based algorithm. Last, we introduce the two-dimensional order preserved pattern matching and give a duel and sweep algorithm that runs in $O(n^2)$ time for duel stage and $O(n^2 m)$ time for sweeping time with $O(m^3)$ preprocessing time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。