# Duel and sweep algorithm for order-preserving pattern matching

**Authors:** Davaajav Jargalsaikhan, Diptarama, Ryo Yoshinaka, Ayumi, Shinohara

arXiv: 1705.09438 · 2017-05-29

## TL;DR

This paper introduces an efficient duel-and-sweep algorithm for order-preserving pattern matching, improving speed over previous methods and extending to two-dimensional cases with specific time complexities.

## Contribution

The paper presents a novel duel-and-sweep algorithm for order-preserving pattern matching with improved time complexity and extends it to two-dimensional pattern matching.

## Key findings

- Algorithm runs in $O(n + m\log m)$ time generally
- Faster than KMP-based algorithms in experiments
- Extends to two-dimensional order-preserving pattern matching

## Abstract

Given a text $T$ and a pattern $P$ over alphabet $\Sigma$, 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.

## Full text

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

## Figures

16 figures with captions in the complete paper: https://tomesphere.com/paper/1705.09438/full.md

## References

17 references — full list in the complete paper: https://tomesphere.com/paper/1705.09438/full.md

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