English

Text Indexing and Pattern Matching with Ephemeral Edits

Data Structures and Algorithms 2026-01-08 v2

Abstract

A sequence e0,e1,e_0,e_1,\ldots of edit operations in a string TT is called ephemeral if operation eie_i constructing string TiT^i, for all i=2ki=2k with kNk\in\mathbb{N}, is reverted by operation ei+1e_{i+1} that reconstructs TT. Such a sequence arises when processing a stream of independent edits or testing hypothetical edits. We introduce text indexing with ephemeral substring edits, a new version of text indexing. Our goal is to design a data structure over a given text that supports subsequent pattern matching queries with ephemeral substring insertions, deletions, or substitutions in the text; we require insertions and substitutions to be of constant length. In particular, we preprocess a text T=T[0..n)T=T[0\mathinner{.\,.} n) over an integer alphabet Σ=[0,σ)\Sigma=[0,\sigma) with σ=nO(1)\sigma=n^{\mathcal{O}(1)} in O(n)\mathcal{O}(n) time. Then, we can preprocess any arbitrary pattern P=P[0..m)P=P[0\mathinner{.\,.} m) given online in O(mloglogm)\mathcal{O}(m\log\log m) time and O(m)\mathcal{O}(m) space and allow any ephemeral sequence of edit operations in TT. Before reverting the iith operation, we report all Occ occurrences of PP in TiT^i in O(loglogn+Occ)\mathcal{O}(\log\log n + \text{Occ}) time. We also introduce pattern matching with ephemeral edits. In particular, we preprocess two strings TT and PP, each of length at most nn, over an integer alphabet Σ=[0,σ)\Sigma=[0,\sigma) with σ=nO(1)\sigma=n^{\mathcal{O}(1)} in O(n)\mathcal{O}(n) time. Then, we allow any ephemeral sequence of edit operations in TT. Before reverting the iith operation, we report all Occ occurrences of PP in TiT^i in the optimal O(Occ)\mathcal{O}(\text{Occ}) time. Along our way to this result, we also give an optimal solution for pattern matching with ephemeral block deletions.

Keywords

Cite

@article{arxiv.2508.05124,
  title  = {Text Indexing and Pattern Matching with Ephemeral Edits},
  author = {Solon P. Pissis},
  journal= {arXiv preprint arXiv:2508.05124},
  year   = {2026}
}

Comments

SOSA 2026 (abstract abridged to satisfy arXiv requirements)

R2 v1 2026-07-01T04:38:36.216Z