## Abstract

String matching is rich with a variety of algorithmic tools. In contrast, multidimensional matching has had a rather sparse set of techniques. This paper presents a new algorithmic technique for two-dimensional matching: periodicity analysis. Its strength appears to lie in the fact that it is inherently two-dimensional. Periodicity in strings has been used to solve string matching problems. Multidimensional periodicity, however, is not as simple as it is in strings and was not formally studied or used in pattern matching. In this paper, we define and analyze two-dimensional periodicity in rectangular arrays. One definition of string periodicity is that a periodic string can self-overlap in a particular way. An analogous concept is true in two dimensions. The self-overlap vectors of a rectangle generate a regular pattern of locations where the rectangle may originate. Based on this regularity, we define four categories of periodic arrays - nonperiodic, lattice periodic, line periodic, and radiant periodic - and prove theorems about the properties of the classes. We give serial and parallel algorithms that find all locations where an overlap originates. In addition, our algorithms find a witness proving that the array does not self-overlap in any other location. The serial algorithm runs in time O(m^{2}) (linear time) when the alphabet size is finite, and in O(m^{2}log m) otherwise. The parallel algorithm runs in time O(log m) using O(m^{2}) CRCW processors.

Original language | English |
---|---|

Pages (from-to) | 90-106 |

Number of pages | 17 |

Journal | SIAM Journal on Computing |

Volume | 27 |

Issue number | 1 |

DOIs | |

State | Published - Feb 1998 |

Externally published | Yes |

## Keywords

- Parallel algorithm
- Periodicity
- Sequential algorithm
- String matching
- Two-dimensional
- Witness