,
Amir-Parsa Mobed
,
Masoud Seddighin
,
Saeed Seddighin
Creative Commons Attribution 4.0 International license
We study the fully dynamic pattern matching problem where the pattern may contain up to k wildcard symbols, each matching any symbol of the alphabet. Both the text and the pattern are subject to updates (insert, delete, change). We design an algorithm with 𝒪(n log² n) preprocessing and update/query time 𝒪̃(kn^{k/{k+1}} + k² log n). The bound is truly sublinear for a constant k, and sublinear when k = o(log n). We further complement our results with a conditional lower bound: assuming subquadratic preprocessing time, achieving truly sublinear update time for the case k = Ω(log n) would contradict the Strong Exponential Time Hypothesis (SETH). Finally, we develop sublinear algorithms for two special cases:
- If the pattern contains w non-wildcard symbols, we give an algorithm with preprocessing time 𝒪(nw) and update time 𝒪(w + log n), which is truly sublinear whenever w is truly sublinear.
- Using FFT technique combined with block decomposition, we design a deterministic truly sublinear algorithm with preprocessing time 𝒪(n^{1.8}) and update time 𝒪(n^{0.8} log n) for the case that there are at most two non-wildcards.
@InProceedings{naeini_et_al:LIPIcs.STACS.2026.68,
author = {Naeini, Arshia Ataee and Mobed, Amir-Parsa and Seddighin, Masoud and Seddighin, Saeed},
title = {{Dynamic Pattern Matching with Wildcards}},
booktitle = {43rd International Symposium on Theoretical Aspects of Computer Science (STACS 2026)},
pages = {68:1--68:20},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-412-3},
ISSN = {1868-8969},
year = {2026},
volume = {364},
editor = {Mahajan, Meena and Manea, Florin and McIver, Annabelle and Thắng, Nguy\~{ê}n Kim},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.STACS.2026.68},
URN = {urn:nbn:de:0030-drops-255579},
doi = {10.4230/LIPIcs.STACS.2026.68},
annote = {Keywords: pattern matching, wildcards, dynamic algorithms, string algorithms, data structures}
}