# Order Preserving Matching

arXiv: https://arxiv.org/abs/1302.4064 · HTML: https://mlsanity.com/paper/1302.4064/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 17 Feb 2013.

## Built on by (most cited first, 1 of 1)

- [OPP-Miner: Order-preserving sequential pattern mining](https://mlsanity.com/paper/2202.03140/) (2022)

## Abstract (arXiv)

We introduce a new string matching problem called order-preserving matching on numeric strings where a pattern matches a text if the text contains a substring whose relative orders coincide with those of the pattern. Order-preserving matching is applicable to many scenarios such as stock price analysis and musical melody matching in which the order relations should be matched instead of the strings themselves. Solving order-preserving matching has to do with representations of order relations of a numeric string. We define prefix representation and nearest neighbor representation, which lead to efficient algorithms for order-preserving matching. We present efficient algorithms for single and multiple pattern cases. For the single pattern case, we give an O(n log m) time algorithm and optimize it further to obtain O(n + m log m) time. For the multiple pattern case, we give an O(n log m) time algorithm.
