Better Indexing for Rectangular Pattern Matching
Abstract
We revisit the complexity of building, given a two-dimensional string of size , an indexing structure that allows locating all occurrences of a two-dimensional pattern of size . While a structure of size with query time is known for this problem under the additional assumption that the pattern is a square [Giancarlo, SICOMP 1995], a popular belief was that for rectangular patterns one cannot achieve such (or even similar) bounds, due to a lower bound for a certain natural class of approaches [Giancarlo, WADS 1993]. We show that, in fact, it is possible to construct a very simple structure of size that supports such queries for any rectangular pattern in time, for any . Further, our structure can be constructed in time.
Cite
@article{arxiv.2508.17365,
title = {Better Indexing for Rectangular Pattern Matching},
author = {Paweł Gawrychowski and Adam Górkiewicz},
journal= {arXiv preprint arXiv:2508.17365},
year = {2025}
}
Comments
Extended version of a paper to appear in ESA 2025