String Matching with a Dynamic Pattern

📅 2025-06-12
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the problem of real-time exact pattern matching for a dynamic pattern string (P) against a static text (T), supporting single-character insertions/deletions, substring deletions, shifts, and copy operations on (P), with immediate reporting of (P)’s occurrence count in (T) after each edit. We propose the first lightweight dynamic string index based on the suffix array, integrating binary search with efficient interval maintenance. The index requires (O(|T|)) preprocessing time, achieves (O(log |T|)) amortized time per edit operation, and supports online text expansion. Unlike prior approaches, our framework is the first to achieve logarithmic update complexity for multiple edit types within a unified index structure. Experimental results demonstrate high efficiency and low latency on large-scale texts.

Technology Category

Application Category

📝 Abstract
In this work, we tackle a natural variation of the String Matching Problem on the case of a dynamic pattern, that is, given a static text $T$ and a pattern $P$, we want to support character additions and deletions to the pattern, and after each operation compute how many times it occurs in the text. We show a simple and practical algorithm using Suffix Arrays that achieves $mathcal O(log |T|)$ update time, after $mathcal O(|T|)$ preprocess time. We show how to extend our solution to support substring deletion, transposition (moving a substring to another position of the pattern), and copy (copying a substring and pasting it in a specific position), in the same time complexities. Our solution can also be extended to support an online text (adding characters to one end of the text), maintaining the same amortized bounds.
Problem

Research questions and friction points this paper is trying to address.

Handling dynamic pattern updates in string matching
Supporting character edits and substring operations efficiently
Extending solution to online text with amortized bounds
Innovation

Methods, ideas, or system contributions that make the work stand out.

Uses Suffix Arrays for dynamic pattern matching
Supports substring deletion and transposition efficiently
Extends to online text with amortized bounds
🔎 Similar Papers
No similar papers found.