English

String Indexing for Patterns with Wildcards

Data Structures and Algorithms 2012-09-07 v2

Abstract

We consider the problem of indexing a string tt of length nn to report the occurrences of a query pattern pp containing mm characters and jj wildcards. Let occocc be the number of occurrences of pp in tt, and σ\sigma the size of the alphabet. We obtain the following results. - A linear space index with query time O(m+σjloglogn+occ)O(m+\sigma^j \log \log n + occ). This significantly improves the previously best known linear space index by Lam et al. [ISAAC 2007], which requires query time Θ(jn)\Theta(jn) in the worst case. - An index with query time O(m+j+occ)O(m+j+occ) using space O(σk2nlogklogn)O(\sigma^{k^2} n \log^k \log n), where kk is the maximum number of wildcards allowed in the pattern. This is the first non-trivial bound with this query time. - A time-space trade-off, generalizing the index by Cole et al. [STOC 2004]. We also show that these indexes can be generalized to allow variable length gaps in the pattern. Our results are obtained using a novel combination of well-known and new techniques, which could be of independent interest.

Keywords

Cite

@article{arxiv.1110.5236,
  title  = {String Indexing for Patterns with Wildcards},
  author = {Philip Bille and Inge Li Goertz and Hjalte Wedel Vildhøj and Søren Vind},
  journal= {arXiv preprint arXiv:1110.5236},
  year   = {2012}
}
R2 v1 2026-06-21T19:24:44.234Z