# Circular Pattern Matching with $k$ Mismatches

**Authors:** Panagiotis Charalampopoulos, Tomasz Kociumaka, Solon P. Pissis, Jakub, Radoszewski, Wojciech Rytter, Juliusz Straszy\'nski, Tomasz Wale\'n, Wiktor, Zuba

arXiv: 1907.01815 · 2020-01-14

## TL;DR

This paper introduces the first worst-case efficient algorithms for circular pattern matching with up to k mismatches, providing practical bounds and extending recent techniques from the k-mismatch problem.

## Contribution

It presents the first non-trivial worst-case upper bounds for the circular pattern matching with k mismatches problem, including two algorithms with improved time complexities.

## Key findings

- An O(nk)-time algorithm for the problem.
- An O(n + (n/m)k^4)-time algorithm extending recent techniques.
- Improved the main algorithm's complexity from O(n + (n/m)k^5) to O(n + (n/m)k^4).

## Abstract

The $k$-mismatch problem consists in computing the Hamming distance between a pattern $P$ of length $m$ and every length-$m$ substring of a text $T$ of length $n$, if this distance is no more than $k$. In many real-world applications, any cyclic rotation of $P$ is a relevant pattern, and thus one is interested in computing the minimal distance of every length-$m$ substring of $T$ and any cyclic rotation of $P$. This is the circular pattern matching with $k$ mismatches ($k$-CPM) problem. A multitude of papers have been devoted to solving this problem but, to the best of our knowledge, only average-case upper bounds are known. In this paper, we present the first non-trivial worst-case upper bounds for the $k$-CPM problem. Specifically, we show an $O(nk)$-time algorithm and an $O(n+\frac{n}{m}\,k^4)$-time algorithm. The latter algorithm applies in an extended way a technique that was very recently developed for the $k$-mismatch problem [Bringmann et al., SODA 2019].   A preliminary version of this work appeared at FCT 2019. In this version we improve the time complexity of the main algorithm from $O(n+\frac{n}{m}\,k^5)$ to $O(n+\frac{n}{m}\,k^4)$.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1907.01815/full.md

## Figures

9 figures with captions in the complete paper: https://tomesphere.com/paper/1907.01815/full.md

## References

40 references — full list in the complete paper: https://tomesphere.com/paper/1907.01815/full.md

---
Source: https://tomesphere.com/paper/1907.01815