Skip to main content
QUICK REVIEW

[论文解读] Approximate Circular Pattern Matching

Panagiotis Charalampopoulos, Tomasz Kociumaka|arXiv (Cornell University)|Jan 1, 2022
Algorithms and Data CompressionComputer Science被引用 1
一句话总结

本文提出了在汉明距离和编辑距离下近似循环模式匹配(CPM)的改进算法,显著提升了报告和决策时间复杂度。在汉明距离下达到 O(n + (n/m)·k³) 时间,在编辑距离下达到 O(nk²) 时间,其决策算法近乎最优,几乎达到标准近似模式匹配的最佳已知界限。

ABSTRACT

We consider approximate circular pattern matching (CPM, in short) under the Hamming and edit distance, in which we are given a length-$n$ text $T$, a length-$m$ pattern $P$, and a threshold $k>0$, and we are to report all starting positions of fragments of $T$ (called occurrences) that are at distance at most $k$ from some cyclic rotation of $P$. In the decision version of the problem, we are to check if any such occurrence exists. All previous results for approximate CPM were either average-case upper bounds or heuristics, except for the work of Charalampopoulos et al. [CKP$^+$, JCSS'21], who considered only the Hamming distance. For the reporting version of the approximate CPM problem, under the Hamming distance we improve upon the main algorithm of [CKP$^+$, JCSS'21] from ${\cal O}(n+(n/m)\cdot k^4)$ to ${\cal O}(n+(n/m)\cdot k^3)$ time; for the edit distance, we give an ${\cal O}(nk^2)$-time algorithm. We also consider the decision version of the approximate CPM problem. Under the Hamming distance, we obtain an ${\cal O}(n+(n/m)\cdot k^2\log k/\log\log k)$-time algorithm, which nearly matches the algorithm by Chan et al. [CGKKP, STOC'20] for the standard counterpart of the problem. Under the edit distance, the ${\cal O}(nk\log^2 k)$ running time of our algorithm nearly matches the ${\cal O}(nk)$ running time of the Landau-Vishkin algorithm [LV, J. Algorithms'89]. As a stepping stone, we propose an ${\cal O}(nk\log^2 k)$-time algorithm for the Longest Prefix $k'$-Approximate Match problem, proposed by Landau et al. [LMS, SICOMP'98], for all $k'\in \{1,\dots,k\}$. We give a conditional lower bound that suggests a polynomial separation between approximate CPM under the Hamming distance over the binary alphabet and its non-circular counterpart. We also show that a strongly subquadratic-time algorithm for the decision version of approximate CPM under edit distance would refute SETH.

研究动机与目标

  • 解决在汉明距离和编辑距离下近似循环模式匹配(CPM)的计算复杂度问题,其中模式旋转被视为等价。
  • 在最坏情况时间复杂度上,超越以往基于平均情况或启发式方法的近似CPM报告和决策变体。
  • 建立条件性下界,表明在二进制字母表下,近似CPM的汉明距离版本与非循环版本之间存在多项式分离。
  • 为所有 k′ ∈ {1, ..., k} 开发新的最长前缀 k′-编辑匹配问题算法,从而支持近似最长公共子串的应用。

提出的方法

  • 提出一种 O(n + (n/m)·k³)-时间算法用于汉明距离下近似CPM的报告版本,优于先前的 O(n + (n/m)·k⁴) 上界。
  • 提出一种 O(nk²)-时间算法用于编辑距离下近似CPM的报告版本,为该领域的新贡献。
  • 设计一种 O(n + (n/m)·k² log k / log log k)-时间决策算法用于汉明距离CPM,在 k = O(√(m log log m / log m)) 时达到 O(n) 时间。
  • 为所有 k′ ∈ {1, ..., k} 开发一种 O(nk log²k)-时间算法求解最长前缀 k′-编辑匹配问题,作为关键子程序。
  • 通过将编辑距离计算归约到特殊构造的四元字母表字符串上的 k-编辑CPM,证明条件性下界。
  • 将最长前缀 k′-编辑匹配算法应用于计算近似最长公共子串,展示其更广泛的应用潜力。

实验结果

研究问题

  • RQ1近似CPM在汉明距离下的报告版本能否在 O(n + (n/m)·k⁴) 以下求解?
  • RQ2是否存在一种近乎最优的决策算法,用于汉明距离下的近似CPM,其性能可媲美标准近似模式匹配?
  • RQ3编辑距离下近似CPM的决策版本能否以接近线性时间(相对于 k)求解,接近 Landau–Vishkin 算法的效率?
  • RQ4近似CPM在汉明距离和编辑距离下的条件性复杂度是多少?是否与非循环情形存在分离?
  • RQ5能否高效求解所有 k′ ∈ {1, ..., k} 的最长前缀 k′-编辑匹配问题,以支持字符串算法中的更广泛应用?

主要发现

  • 在汉明距离下,近似CPM的报告版本以 O(n + (n/m)·k³) 时间求解,优于先前的 O(n + (n/m)·k⁴) 上界。
  • 在编辑距离下,近似CPM的报告版本以 O(nk²) 时间求解,为该问题变体的首次新结果。
  • 在汉明距离下,决策版本以 O(n + (n/m)·k² log k / log log k) 时间运行,当 k = O(√(m log log m / log m)) 时达到 O(n) 时间,接近最佳已知标准模式匹配算法的性能。
  • 在编辑距离下,决策版本以 O(nk log²k) 时间运行,接近最优,因其接近标准近似匹配中 Landau–Vishkin 算法的 O(nk) 复杂度。
  • 为所有 k′ ∈ {1, ..., k} 开发了一种 O(nk log²k)-时间算法求解最长前缀 k′-编辑匹配问题,支持近似字符串匹配中的新应用。
  • 条件性下界表明,若存在强亚二次时间算法求解编辑距离CPM的决策版本,则将否定强指数时间假设(SETH)。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。