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

编辑距离下的近似循环模式匹配

Approximate Circular Pattern Matching under Edit Distance

Panagiotis Charalampopoulos, Solon P. Pissis, Jakub Radoszewski, Wojciech Rytter, Tomasz Waleń, Wiktor Zuba

AI总结:

本文研究编辑距离下的近似循环模式匹配问题,通过分析近似循环出现的结构并处理几乎周期情形,提出了复杂度为 O(n+(n/m) poly(k)) 的首批算法,在多种场景下优于已有方案。

摘要:

在 k-编辑循环模式匹配(k-Edit CPM)问题中,给定长度为 n 的文本 T、长度为 m 的模式 P 以及正整数阈值 k,要求报告 T 中所有与 P 的某个循环旋转之间编辑距离至多为 k 的子串的起始位置。在该问题的判定版本中,需要检查是否存在这样的子串。最近,Charalampopoulos 等人 [ESA 2022] 分别针对 k-Edit CPM 的报告版本和判定版本提出了 O(nk^2) 时间和 O(nk log^3 k) 时间的解决方案。本文中,我们证明了 k-Edit CPM 的报告版本和判定版本可以分别在 O(n+(n/m) k^6) 时间和 O(n+(n/m) k^5 log^3 k) 时间内解决,从而获得了该问题首批复杂度为 O(n+(n/m) poly(k)) 类型的算法。值得注意的是,当 m=Ω(k^6) 时,我们的算法运行时间为 O(n),并且当 m=ω(k^4) 时优于此前相应的解决方案。我们提供了一个元算法,能够在若干其他有趣场景中产生高效算法,例如当字符串以压缩形式给出(如直线程序)、当字符串是动态的、或者当我们拥有量子计算机时。我们通过利用当 T 相对于 P 较短时 P 在 T 中近似循环出现的结构来获得这些解决方案。粗略地说,要么 P 的旋转的近似出现的起始位置形成 O(k^4) 个可以高效计算的区间,要么 P 的某个旋转几乎是周期的(与某个具有小周期的字符串的编辑距离很小)。处理几乎周期的情况是这项工作中技术上最具挑战性的部分;我们利用锁定片段(locked fragments)的性质(源自 [Cole and Hariharan, SICOMP 2002])来解决该问题。

英文摘要:

In the $k$-Edit Circular Pattern Matching ($k$-Edit CPM) problem, we are given a length-$n$ text $T$, a length-$m$ pattern $P$, and a positive integer threshold $k$, and we are to report all starting positions of the substrings of $T$ that are at edit distance at most $k$ from some cyclic rotation of $P$. In the decision version of the problem, we are to check if any such substring exists. Very recently, Charalampopoulos et al. [ESA 2022] presented $O(nk^2)$-time and $O(nk \log^3 k)$-time solutions for the reporting and decision versions of $k$-Edit CPM, respectively. Here, we show that the reporting and decision versions of $k$-Edit CPM can be solved in $O(n+(n/m) k^6)$ time and $O(n+(n/m) k^5 \log^3 k)$ time, respectively, thus obtaining the first algorithms with a complexity of the type $O(n+(n/m) \mathrm{poly}(k))$ for this problem. Notably, our algorithms run in $O(n)$ time when $m=Ω(k^6)$ and are superior to the previous respective solutions when $m=ω(k^4)$. We provide a meta-algorithm that yields efficient algorithms in several other interesting settings, such as when the strings are given in a compressed form (as straight-line programs), when the strings are dynamic, or when we have a quantum computer. We obtain our solutions by exploiting the structure of approximate circular occurrences of $P$ in $T$, when $T$ is relatively short w.r.t. $P$. Roughly speaking, either the starting positions of approximate occurrences of rotations of $P$ form $O(k^4)$ intervals that can be computed efficiently, or some rotation of $P$ is almost periodic (is at a small edit distance from a string with small period). Dealing with the almost periodic case is the most technically demanding part of this work; we tackle it using properties of locked fragments (originating from [Cole and Hariharan, SICOMP 2002]).

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

↑