We introduce a data structure for counting pattern occurrences in texts compressed with any run-length context-free grammar. Our structure uses space proportional to the grammar size and counts the occurrences of a pattern of length m in a text of length n in time O(mlog^{2+ε} n), for any constant ε > 0 chosen at indexing time. This is the first solution to an open problem posed by Christiansen et al. [ACM TALG 2020] and enhances our abilities for computation over compressed data; we give an example application.
@InProceedings{navarro_et_al:LIPIcs.CPM.2025.3, author = {Navarro, Gonzalo and Pacheco, Alejandro}, title = {{Counting on General Run-Length Grammars}}, booktitle = {36th Annual Symposium on Combinatorial Pattern Matching (CPM 2025)}, pages = {3:1--3:17}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-95977-369-0}, ISSN = {1868-8969}, year = {2025}, volume = {331}, editor = {Bonizzoni, Paola and M\"{a}kinen, Veli}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CPM.2025.3}, URN = {urn:nbn:de:0030-drops-230977}, doi = {10.4230/LIPIcs.CPM.2025.3}, annote = {Keywords: Grammar-based indexing, Run-length context-free grammars, Counting pattern occurrences, Periods in strings} }
Feedback for Dagstuhl Publishing