English

Internal Pattern Matching in Small Space and Applications

Data Structures and Algorithms 2024-04-29 v1

Abstract

In this work, we consider pattern matching variants in small space, that is, in the read-only setting, where we want to bound the space usage on top of storing the strings. Our main contribution is a space-time trade-off for the Internal Pattern Matching (IPM) problem, where the goal is to construct a data structure over a string SS of length nn that allows one to answer the following type of queries: Compute the occurrences of a fragment PP of SS inside another fragment TT of SS, provided that T<2P|T| < 2|P|. For any τ[1..n/log2n]\tau \in [1 .. n/\log^2 n], we present a nearly-optimal O˜(n/τ)\~O(n/\tau)-size data structure that can be built in O˜(n)\~O(n) time using O˜(n/τ)\~O(n/\tau) extra space, and answers IPM queries in O(τ+lognlog3logn)O(\tau+\log n \log^3 \log n) time. IPM queries have been identified as a crucial primitive operation for the analysis of algorithms on strings. In particular, the complexities of several recent algorithms for approximate pattern matching are expressed with regards to the number of calls to a small set of primitive operations that include IPM queries; our data structure allows us to port these results to the small-space setting. We further showcase the applicability of our IPM data structure by using it to obtain space-time trade-offs for the longest common substring and circular pattern matching problems in the asymmetric streaming setting.

Keywords

Cite

@article{arxiv.2404.17502,
  title  = {Internal Pattern Matching in Small Space and Applications},
  author = {Gabriel Bathie and Panagiotis Charalampopoulos and Tatiana Starikovskaya},
  journal= {arXiv preprint arXiv:2404.17502},
  year   = {2024}
}

Comments

To be published in CPM 2024

R2 v1 2026-06-28T16:07:53.052Z