{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/compressed-multiple-pattern-matching","title":"Compressed Multiple Pattern Matching","arxiv_id":"1811.01248","date":"2018-11-03","proceeding":null,"authors":["Dmitry Kosolobov","Nikita Sivukhin"],"abstract":"Given $d$ strings over the alphabet $\\{0,1,\\ldots,\\sigma{-}1\\}$, the classical Aho--Corasick data structure allows us to find all $occ$ occurrences of the strings in any text $T$ in $O(|T| + occ)$ time using $O(m\\log m)$ bits of space, where $m$ is the number of edges in the trie containing the strings. Fix any constant $\\varepsilon \\in (0, 2)$. We describe a compressed solution for the problem that, provided $\\sigma \\le m^\\delta$ for a constant $\\delta < 1$, works in $O(|T| \\frac{1}{\\varepsilon} \\log\\frac{1}{\\varepsilon} + occ)$ time, which is $O(|T| + occ)$ since $\\varepsilon$ is constant, and occupies $mH_k + 1.443 m + \\varepsilon m + O(d\\log\\frac{m}{d})$ bits of space, for all $0 \\le k \\le \\max\\{0,\\alpha\\log_\\sigma m - 2\\}$ simultaneously, where $\\alpha \\in (0,1)$ is an arbitrary constant and $H_k$ is the $k$th-order empirical entropy of the trie. Hence, we reduce the $3.443m$ term in the space bounds of previously best succinct solutions to $(1.443 + \\varepsilon)m$, thus solving an open problem posed by Belazzougui. Further, we notice that $L = \\log\\binom{\\sigma (m+1)}{m} - O(\\log(\\sigma m))$ is a worst-case space lower bound for any solution of the problem and, for $d = o(m)$ and constant $\\varepsilon$, our approach allows to achieve $L + \\varepsilon m$ bits of space, which gives an evidence that, for $d = o(m)$, the space of our data structure is theoretically optimal up to the $\\varepsilon m$ additive term and it is hardly possible to eliminate the term $1.443m$. In addition, we refine the space analysis of previous works by proposing a more appropriate definition for $H_k$. We also simplify the construction for practice adapting the fixed block compression boosting technique, then implement our data structure, and conduct a number of experiments showing that it is comparable to the state of the art in terms of time and is superior in space.","url_abs":"https://arxiv.org/abs/1811.01248v2","url_pdf":"https://arxiv.org/pdf/1811.01248v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"compressed-multiple-pattern-matching","repo_url":"https://bitbucket.org/umqra/multiple-pattern-matching","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}