,
Adam Górkiewicz
Creative Commons Attribution 4.0 International license
We revisit the complexity of building, given a two-dimensional string of size n, an indexing structure that allows locating all k occurrences of a two-dimensional pattern of size m. While a structure of size 𝒪(n) with query time 𝒪(m+k) 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 𝒪(nlog n) that supports such queries for any rectangular pattern in 𝒪(m+klog^{ε}n) time, for any ε > 0.
@InProceedings{gawrychowski_et_al:LIPIcs.ESA.2025.33,
author = {Gawrychowski, Pawe{\l} and G\'{o}rkiewicz, Adam},
title = {{Better Indexing for Rectangular Pattern Matching}},
booktitle = {33rd Annual European Symposium on Algorithms (ESA 2025)},
pages = {33:1--33:7},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-395-9},
ISSN = {1868-8969},
year = {2025},
volume = {351},
editor = {Benoit, Anne and Kaplan, Haim and Wild, Sebastian and Herman, Grzegorz},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ESA.2025.33},
URN = {urn:nbn:de:0030-drops-245011},
doi = {10.4230/LIPIcs.ESA.2025.33},
annote = {Keywords: 2D strings, pattern matching, string indexing}
}