Creative Commons Attribution 3.0 Unported license
This paper extends the problem of palindrome searching into a higher dimension, addressing two definitions of 2D palindromes. The first definition implies a square, while the second definition (also known as a centrosymmetric factor), can be any rectangular shape. We describe two algorithms for searching a 2D text for maximal palindromes, one for each type of 2D palindrome. The first algorithm is optimal; it runs in linear time, on par with Manacher's linear time 1D palindrome algorithm. The second algorithm searches a text of size n_1 x n_2 (n_1 >= n_2) in O(n_2) time for each of its n_1 x n_2 positions. Since each position may have up to O(n_2) maximal palindromes centered at that location, the second result is also optimal in terms of the worst-case output size.
@InProceedings{geizhals_et_al:LIPIcs.CPM.2016.19,
author = {Geizhals, Sara and Sokol, Dina},
title = {{Finding Maximal 2-Dimensional Palindromes}},
booktitle = {27th Annual Symposium on Combinatorial Pattern Matching (CPM 2016)},
pages = {19:1--19:12},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-012-5},
ISSN = {1868-8969},
year = {2016},
volume = {54},
editor = {Grossi, Roberto and Lewenstein, Moshe},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CPM.2016.19},
URN = {urn:nbn:de:0030-drops-60752},
doi = {10.4230/LIPIcs.CPM.2016.19},
annote = {Keywords: palindrome, pattern matching, 2-Dimensional, centrosymmetric factor}
}