### Abstract

Two equal-length strings, or two equal-sized two-dimensional texts, parameterize match (p-match) if there is a one-one mapping (relative to the alphabet) of their characters. Two-dimensional parameterized matching is the task of finding all m x m substrings of an n x n text that p-match an m x m pattern. This models searching for color images with changing of color maps, for example. We present two algorithms that solve the twodimensional parameterized matching problem. The time complexities of our algorithms are O(n^{2}log^{2}m) and O(n^{2} + m^{2.5} polylog(m)). Our algorithms are faster than the O(n^{2}mlog^{2}m log log m) time algorithm for this problem of Amir et al. [2006]. A key step in both of our algorithms is to count the number of distinct characters in every m x m substring of an n x n string. We show how to solve this problem in O(n^{2}) time. This result may be of independent interest.

Original language | English (US) |
---|---|

Journal | ACM Transactions on Algorithms |

Volume | 11 |

Issue number | 2 |

DOIs | |

State | Published - Oct 30 2014 |

### Fingerprint

### Keywords

- Parameterized matching
- Two-dimensional pattern matching
- Witness computation

### ASJC Scopus subject areas

- Mathematics (miscellaneous)

### Cite this

*ACM Transactions on Algorithms*,

*11*(2). https://doi.org/10.1145/2650220

**Two-dimensional parameterized matching.** / Cole, Richard; Hazay, Carmit; Lewenstein, Moshe; Tsur, Dekel.

Research output: Contribution to journal › Article

*ACM Transactions on Algorithms*, vol. 11, no. 2. https://doi.org/10.1145/2650220

}

TY - JOUR

T1 - Two-dimensional parameterized matching

AU - Cole, Richard

AU - Hazay, Carmit

AU - Lewenstein, Moshe

AU - Tsur, Dekel

PY - 2014/10/30

Y1 - 2014/10/30

N2 - Two equal-length strings, or two equal-sized two-dimensional texts, parameterize match (p-match) if there is a one-one mapping (relative to the alphabet) of their characters. Two-dimensional parameterized matching is the task of finding all m x m substrings of an n x n text that p-match an m x m pattern. This models searching for color images with changing of color maps, for example. We present two algorithms that solve the twodimensional parameterized matching problem. The time complexities of our algorithms are O(n2log2m) and O(n2 + m2.5 polylog(m)). Our algorithms are faster than the O(n2mlog2m log log m) time algorithm for this problem of Amir et al. [2006]. A key step in both of our algorithms is to count the number of distinct characters in every m x m substring of an n x n string. We show how to solve this problem in O(n2) time. This result may be of independent interest.

AB - Two equal-length strings, or two equal-sized two-dimensional texts, parameterize match (p-match) if there is a one-one mapping (relative to the alphabet) of their characters. Two-dimensional parameterized matching is the task of finding all m x m substrings of an n x n text that p-match an m x m pattern. This models searching for color images with changing of color maps, for example. We present two algorithms that solve the twodimensional parameterized matching problem. The time complexities of our algorithms are O(n2log2m) and O(n2 + m2.5 polylog(m)). Our algorithms are faster than the O(n2mlog2m log log m) time algorithm for this problem of Amir et al. [2006]. A key step in both of our algorithms is to count the number of distinct characters in every m x m substring of an n x n string. We show how to solve this problem in O(n2) time. This result may be of independent interest.

KW - Parameterized matching

KW - Two-dimensional pattern matching

KW - Witness computation

UR - http://www.scopus.com/inward/record.url?scp=84908892377&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=84908892377&partnerID=8YFLogxK

U2 - 10.1145/2650220

DO - 10.1145/2650220

M3 - Article

VL - 11

JO - ACM Transactions on Algorithms

JF - ACM Transactions on Algorithms

SN - 1549-6325

IS - 2

ER -