English

PalFM-index: FM-index for Palindrome Pattern Matching

Data Structures and Algorithms 2023-04-17 v2

Abstract

The palindrome pattern matching (pal-matching) is a kind of generalized pattern matching, in which two strings xx and yy of same length are considered to match (pal-match) if they have the same palindromic structures, i.e., for any possible 1i<jx=y1 \le i < j \le |x| = |y|, x[i..j]x[i..j] is a palindrome if and only if y[i..j]y[i..j] is a palindrome. The pal-matching problem is the problem of searching for, in a text, the occurrences of the substrings that pal-match with a pattern. Given a text TT of length nn over an alphabet of size σ\sigma, an index for pal-matching is to support, given a pattern PP of length mm, the counting queries that compute the number occ\mathsf{occ} of occurrences of PP and the locating queries that compute the occurrences of PP. The authors in~[I et al., Theor. Comput. Sci., 2013] proposed an O(nlgn)O(n \lg n)-bit data structure to support the counting queries in O(mlgσ)O(m \lg \sigma) time and the locating queries in O(mlgσ+occ)O(m \lg \sigma + \mathsf{occ}) time. In this paper, we propose an FM-index type index for the pal-matching problem, which we call the PalFM-index, that occupies 2nlgmin(σ,lgn)+2n+o(n)2n \lg \min(\sigma, \lg n) + 2n + o(n) bits of space and supports the counting queries in O(m)O(m) time. The PalFM-indexes can support the locating queries in O(m+Δocc)O(m + \Delta \mathsf{occ}) time by adding nΔlgn+n+o(n)\frac{n}{\Delta} \lg n + n + o(n) bits of space, where Δ\Delta is a parameter chosen from {1,2,,n}\{1, 2, \dots, n\} in the preprocessing phase.

Keywords

Cite

@article{arxiv.2206.12600,
  title  = {PalFM-index: FM-index for Palindrome Pattern Matching},
  author = {Shinya Nagashita and Tomohiro I},
  journal= {arXiv preprint arXiv:2206.12600},
  year   = {2023}
}

Comments

Accepted to 34th Annual Symposium on Combinatorial Pattern Matching (CPM) 2023