,
Dvir Fried
,
Shay Golan
,
Matan Kraus
,
Adrian Miclăuş
,
Arseny Shur
Creative Commons Attribution 4.0 International license
We study a natural type of repetitions in 2-dimensional strings. Such a repetition, called a matching frame, is a rectangular substring of size at least 2× 2 with equal marginal rows and equal marginal columns. Matching frames first appeared in literature in the context of Wang tiles.
We present two algorithms finding a matching frame with the maximum perimeter in a given n× m input string. The first algorithm solves the problem exactly in Õ(n^{2.5}) time (assuming n ≥ m). The second algorithm finds a (1-ε)-approximate solution in Õ((nm)/ε⁴) time, which is near linear in the size of the input for constant ε. In particular, by setting ε = O(1) the second algorithm decides the existence of a matching frame in a given string in Õ(nm) time. Some technical elements and structural properties used in these algorithms can be of independent interest.
@InProceedings{boneh_et_al:LIPIcs.CPM.2024.10,
author = {Boneh, Itai and Fried, Dvir and Golan, Shay and Kraus, Matan and Micl\u{a}u\c{s}, Adrian and Shur, Arseny},
title = {{Searching 2D-Strings for Matching Frames}},
booktitle = {35th Annual Symposium on Combinatorial Pattern Matching (CPM 2024)},
pages = {10:1--10:19},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-326-3},
ISSN = {1868-8969},
year = {2024},
volume = {296},
editor = {Inenaga, Shunsuke and Puglisi, Simon J.},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CPM.2024.10},
URN = {urn:nbn:de:0030-drops-201205},
doi = {10.4230/LIPIcs.CPM.2024.10},
annote = {Keywords: 2D string, matching frame, LCP, multidimensional range query}
}