Compressed Dictionary Matching on Run-Length Encoded Strings
Given a set of pattern strings 𝒫 = {P₁, P₂,… P_k} and a text string S, the classic dictionary matching problem is to report all occurrences of each pattern in S. We study the dictionary problem in the compressed setting, where the pattern strings and the text string are compressed using run-length encoding, and the goal is to solve the problem without decompression and achieve efficient time and space in the size of the compressed strings. Let m and n be the total length of the patterns 𝒫 and the length of the text string S, respectively, and let ̅m and ̅n be the total number of runs in the run-length encoding of the patterns in 𝒫 and S, respectively. Our main result is an algorithm that achieves O(( ̅m + ̅n)log log m + occ) expected time, and O( ̅m) space, where occ is the total number of occurrences of patterns in S. This is the first non-trivial solution to the problem. Since any solution must read the input, our time bound is optimal within an log log m factor. We introduce several new techniques to achieve our bounds, including a new compressed representation of the classic Aho-Corasick automaton and a new efficient string index that supports fast queries in run-length encoded strings.
Authors
- Simon J. Puglisi (ORCID: https://orcid.org/0000-0001-7668-7636)
- Simon R. Tarnow (ORCID: https://orcid.org/0009-0002-4293-6475)
- Inge Li Gørtz (ORCID: https://orcid.org/0000-0002-8322-4952)
- Philip Bille (ORCID: https://orcid.org/0000-0002-1120-5154)
Institutions
- University of Helsinki (FI)
- Helsinki Institute for Information Technology (FI)
- Technical University of Denmark (DK)
Publication Details
- Journal
- ArXiv.org
- Published
- 2025-01-01
- DOI
- https://doi.org/10.4230/lipics.cpm.2025.21
- Primary Topic
- Algorithms and Data Compression
- Type
- article
- Field-Weighted Citation Impact
- 0.00