Compact q-gram profiling of compressed strings


          

刊名:Theoretical Computer Science
作者:Philip Bille
Patrick Hagge Cording
Inge Li Gortz
刊号:738LB004
ISSN:0304-3975
出版年:2014
年卷期:2014, vol.550
页码:51-58
总页数:8
分类号:TP30; O1
关键词:Q-gram profileGrammar compressionSLP
参考中译:
语种:eng
文摘:We consider the problem of computing the q-gram profile of a string T of size N compressed by a context-free grammar with n production rules. We present an algorithm that runs in O(N - α) expected time and uses O(n + q + k_(T,q)) space, where N - α≤ qn is the exact number of characters decompressed by the algorithm and k_(T,q) ≤ N - α is the number of distinct q-grams in T. This simultaneously matches the current best known time bound and improves the best known space bound. Our space bound is asymptotically optimal in the sense that any algorithm storing the grammar and the q-gram profile must use Ω(n + q + k_(T,q)) space. To achieve this we introduce the q-gram graph that space-efficiently captures the structure of a string with respect to its q-grams, and show how to construct it from a grammar.