eng
Schloss Dagstuhl – Leibniz-Zentrum für Informatik
Leibniz International Proceedings in Informatics
1868-8969
2016-06-27
19:1
19:12
10.4230/LIPIcs.CPM.2016.19
article
Finding Maximal 2-Dimensional Palindromes
Geizhals, Sara
Sokol, Dina
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.
https://drops.dagstuhl.de/storage/00lipics/lipics-vol054-cpm2016/LIPIcs.CPM.2016.19/LIPIcs.CPM.2016.19.pdf
palindrome
pattern matching
2-Dimensional
centrosymmetric factor