[Paper Review] Approximate Circular Pattern Matching
This paper presents improved algorithms for approximate circular pattern matching (CPM) under Hamming and edit distances, introducing faster reporting and decision-time complexities. It achieves O(n + (n/m)·k³) time for Hamming distance and O(nk²) for edit distance, with near-optimal decision algorithms that nearly match the best-known bounds for standard approximate pattern matching.
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.
Motivation & Objective
- To address the computational complexity of approximate circular pattern matching (CPM) under Hamming and edit distances, where pattern rotations are considered equivalent.
- To improve the worst-case time complexity of both reporting and decision variants of approximate CPM beyond prior average-case or heuristic approaches.
- To establish conditional lower bounds suggesting a polynomial separation between approximate CPM under Hamming distance (binary alphabet) and its non-circular counterpart.
- To develop a new algorithm for the Longest Prefix k′-Edit Match problem for all k′ ∈ {1, ..., k}, enabling applications to approximate longest common substrings.
Proposed method
- Proposes an O(n + (n/m)·k³)-time algorithm for the reporting version of approximate CPM under Hamming distance, improving over the prior O(n + (n/m)·k⁴) bound.
- Introduces an O(nk²)-time algorithm for the reporting version under edit distance, a novel contribution to the field.
- Designs an O(n + (n/m)·k² log k / log log k)-time decision algorithm for Hamming distance CPM, achieving O(n) time when k = O(√(m log log m / log m)).
- Develops an O(nk log²k)-time algorithm for the Longest Prefix k′-Edit Match problem across all k′ ∈ {1, ..., k}, serving as a key subroutine.
- Uses a reduction from edit distance computation to k-Edit CPM on specially constructed quaternary strings to prove conditional lower bounds.
- Applies the Longest Prefix k′-Edit Match algorithm to compute approximate longest common substrings, demonstrating broader utility.
Experimental results
Research questions
- RQ1Can the reporting version of approximate CPM under Hamming distance be solved faster than O(n + (n/m)·k⁴)?
- RQ2Is there a near-optimal decision algorithm for approximate CPM under Hamming distance that matches the performance of standard approximate pattern matching?
- RQ3Can the decision version of approximate CPM under edit distance be solved in near-linear time relative to k, approaching the efficiency of the Landau–Vishkin algorithm?
- RQ4What is the conditional complexity of approximate CPM under Hamming and edit distances, and does it separate from the non-circular case?
- RQ5Can the Longest Prefix k′-Edit Match problem be solved efficiently for all k′ ∈ {1, ..., k} to enable broader applications in string algorithms?
Key findings
- The reporting version of approximate CPM under Hamming distance is solved in O(n + (n/m)·k³) time, improving upon the prior O(n + (n/m)·k⁴) bound.
- The reporting version under edit distance is solved in O(nk²) time, a novel result for this problem variant.
- The decision version under Hamming distance runs in O(n + (n/m)·k² log k / log log k) time, achieving O(n) time when k = O(√(m log log m / log m)), approaching the performance of the best-known standard pattern matching algorithms.
- The decision version under edit distance runs in O(nk log²k) time, which is nearly optimal as it is close to the O(nk) complexity of the Landau–Vishkin algorithm for standard approximate matching.
- An O(nk log²k)-time algorithm is developed for the Longest Prefix k′-Edit Match problem across all k′ ∈ {1, ..., k}, enabling new applications in approximate string matching.
- A conditional lower bound shows that a strongly subquadratic-time algorithm for the decision version of edit-distance CPM would refute the Strong Exponential Time Hypothesis (SETH).
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.