2018/11/03 by Dmitry Kosolobov, Kosolobov, Dmitry, Nikita Sivukhin +1 · 2 citations
Computer Science · #Data Structures and Algorithms (cs.DS) #FOS: Computer and information sciences #cs.DS
paper · pdf · doi:10.48550/arxiv.1811.01248
14 pages, 3 figures, 1 table
arxiv created 2019/03/31 · arxiv updated 2019/04/02
Given d strings over the alphabet \0,1,…,σ-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(mlog m) bits of space, where m is the number of edges in the trie containing the strings. Fix any constant ε ∈ (0, 2). We describe a compressed solution for the problem that, provided σ≤ mδ for a constant δ< 1, works in O(|T| (1)/(ε) log(1)/(ε) + occ) time, which is O(|T| + occ) since ε is constant, and occupies mHk + 1.443 m + ε m + O(dlog(m)/(d)) bits of space, for all 0 ≤ k ≤ max\0,αlogσm - 2\ simultaneously, where α∈ (0,1) is an arbitrary constant and Hk is the kth-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 + ε)m, thus solving an open problem posed by Belazzougui. Further, we notice that L = log\binomσ(m+1)m - O(log(σm)) is a worst-case space lower bound for any solution of the problem and, for d = o(m) and constant ε, our approach allows to achieve L + ε 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 ε 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 Hk. 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.