Random Access to Grammar-Compressed Strings

被引:0
作者
Bille, Philip [1 ]
Landau, Gad M. [2 ,3 ,4 ,5 ,6 ,7 ]
Raman, Rajeev [8 ]
Sadakane, Kunihiko [9 ]
Satti, Srinivasa Rao [10 ]
Weimann, Oren [11 ]
机构
[1] Tech Univ Denmark, DTU Informat, Lyngby, Denmark
[2] Univ Haifa, Dept Comp Sci, Haifa, Israel
[3] NYU Poly, Dept Comp Sci & Engn, Brooklyn, NY 11201 USA
[4] Natl Sci Fdn, Arlington, VA 22230 USA
[5] Israel Sci Fdn, Jerusalem, Israel
[6] Israel Korea Scientif Res Cooperat, Seongnam 13558, South Korea
[7] US Israel Binatl Sci Fdn, Jerusalem, Israel
[8] Univ Leicester, Dept Comp Sci, Leicester LE1 7RH, Leics, England
[9] Natl Inst Informat, Tokyo, Japan
[10] Seoul Natl Univ, Sch Comp Sci & Engn, Seoul 151, South Korea
[11] Weizmann Inst Sci, Dept Comp Sci & Appl Math, IL-76100 Rehovot, Israel
来源
PROCEEDINGS OF THE TWENTY-SECOND ANNUAL ACM-SIAM SYMPOSIUM ON DISCRETE ALGORITHMS | 2011年
基金
以色列科学基金会; 美国国家科学基金会;
关键词
ALGORITHMS;
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Let S be a string of length N compressed into a context-free grammar S of size n. We present two representations of S achieving O(log N) random access time, and either O(n . alpha(k)(n)) construction time and space on the pointer machine model, or O(n) construction time and space on the RAM. Here, alpha(k)(n) is the inverse of the k(th) row of Ackermann's function. Our representations also efficiently support decompression of any substring in S: we can decompress any substring of length m in the same complexity as a single random access query and additional O(m) time. Combining these results with fast algorithms for uncompressed approximate string matching leads to several efficient algorithms for approximate string matching on grammar-compressed strings without decompression. For instance, we can find all approximate occurrences of a pattern P with at most k errors in time O(n(min{|P|k, k(4) + |P|} + log N) + occ), where occ is the number of occurrences of P in S. Finally, we are able to generalize our results to navigation and other operations on grammar-compressed trees. All of the above bounds significantly improve the currently best known results. To achieve these bounds, we introduce several new techniques and data structures of independent interest, including a predecessor data structure, two "biased" weighted ancestor data structures, and a compact representation of heavy-paths in grammars.
引用
收藏
页码:373 / 389
页数:17
相关论文
共 61 条
[1]  
Alon N., 1987, TR7187 TEL AV U I CO
[2]   Marked ancestor problems [J].
Alstrup, S ;
Husfeldt, T ;
Rauhe, T .
39TH ANNUAL SYMPOSIUM ON FOUNDATIONS OF COMPUTER SCIENCE, PROCEEDINGS, 1998, :534-543
[3]   Faster algorithms for string matching with k mismatches [J].
Amir, A ;
Lewenstein, M ;
Porat, E .
JOURNAL OF ALGORITHMS-COGNITION INFORMATICS AND LOGIC, 2004, 50 (02) :257-275
[4]  
Amir A, 2003, SIAM PROC S, P853
[5]   Let sleeping files lie: Pattern matching in Z-compressed files [J].
Amir, A ;
Benson, G ;
Farach, M .
JOURNAL OF COMPUTER AND SYSTEM SCIENCES, 1996, 52 (02) :299-307
[6]  
[Anonymous], 1983, Data structures and network algorithms
[7]  
Apostolico A., 2000, Proceedings DCC 2000. Data Compression Conference, P143, DOI 10.1109/DCC.2000.838154
[8]   Off-line compression by greedy textual substitution [J].
Apostolico, A ;
Lonardi, S .
PROCEEDINGS OF THE IEEE, 2000, 88 (11) :1733-1744
[9]   Some theory and practice of greedy off-line textual substitution [J].
Apostolico, A ;
Lonardi, S .
DCC '98 - DATA COMPRESSION CONFERENCE, 1998, :119-128
[10]   Edit distance of run-length encoded strings [J].
Arbell, O ;
Landau, GM ;
Mitchell, JSB .
INFORMATION PROCESSING LETTERS, 2002, 83 (06) :307-314