Gapped String Indexing in Subquadratic Space and Sublinear Query Time

Philip Bille, Inge Li Gørtz, Moshe Lewenstein, Solon P. Pissis, Eva Rotenberg, Teresa Anna Steiner

Research output: Chapter in Book/Report/Conference proceedingArticle in proceedingsResearchpeer-review

5 Downloads (Pure)


In Gapped String Indexing, the goal is to compactly represent a string S of length n such that for any query consisting of two strings P₁ and P₂, called patterns, and an integer interval [α, β], called gap range, we can quickly find occurrences of P₁ and P₂ in S with distance in [α, β]. Gapped String Indexing is a central problem in computational biology and text mining and has thus received significant research interest, including parameterized and heuristic approaches. Despite this interest, the best-known time-space trade-offs for Gapped String Indexing are the straightforward 𝒪(n) space and 𝒪(n+ occ) query time or Ω(n²) space and Õ(|P₁| + |P₂| + occ) query time. We break through this barrier obtaining the first interesting trade-offs with polynomially subquadratic space and polynomially sublinear query time. In particular, we show that, for every 0 ≤ δ ≤ 1, there is a data structure for Gapped String Indexing with either Õ(n2-δ/3) or Õ(n3-2δ) space and Õ(|P₁| + |P₂| + nδ⋅ (occ+1)) query time, where occ is the number of reported occurrences. As a new fundamental tool towards obtaining our main result, we introduce the Shifted Set Intersection problem: preprocess a collection of sets S₁, …, Sk of integers such that for any query consisting of three integers i,j,s, we can quickly output YES if and only if there exist a ∈ Si and b ∈ Sj with a+s = b. We start by showing that the Shifted Set Intersection problem is equivalent to the indexing variant of 3SUM (3SUM Indexing) [Golovnev et al., STOC 2020]. We then give a data structure for Shifted Set Intersection with gaps, which entails a solution to the Gapped String Indexing problem. Furthermore, we enhance our data structure for deciding Shifted Set Intersection, so that we can support the reporting variant of the problem, i.e., outputting all certificates in the affirmative case. Via the obtained equivalence to 3SUM Indexing, we thus give new improved data structures for the reporting variant of 3SUM Indexing, and we show how this improves upon the state-of-the-art solution for Jumbled Indexing [Chan and Lewenstein, STOC 2015] for any alphabet of constant size σ > 5.
Original languageEnglish
Title of host publicationProceedings of the 41st International Symposium on Theoretical Aspects of Computer Science (STACS 2024)
PublisherSchloss Dagstuhl - Leibniz-Zentrum für Informatik
Publication date2024
ISBN (Print)978-3-95977-311-9
Publication statusPublished - 2024
Event41st International Symposium on Theoretical Aspects of Computer Science - Clermont-Ferrand, France
Duration: 12 Mar 202414 Apr 2024


Conference41st International Symposium on Theoretical Aspects of Computer Science


  • Data structures
  • String indexing
  • Indexing with gaps
  • Two patterns


Dive into the research topics of 'Gapped String Indexing in Subquadratic Space and Sublinear Query Time'. Together they form a unique fingerprint.

Cite this