Text Indexing and Pattern Matching with Ephemeral Edits

preprint2026arXivOpen access

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 k∈Nk\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,σ)Σ=[0,σ) with σ=nO(1)σ=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(mlog⁡log⁡m)\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(log⁡log⁡n+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,σ)Σ=[0,σ) with σ=nO(1)σ=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.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.