Range LCP

In this paper, we define the Range LCP problem as follows. Preprocess a string S, of length n, to enable efficient solutions of the following query: Given $[i,j],\ \ 0 , compute max l, k∈{i,…,j}LCP(Sl, Sk), where LCP(Sl, Sk) is the length of the longest common prefix of the suffixes of S starting at locations l and k. This is a natural generalization of the classical LCP problem. Surprisingly, while it is known how to preprocess a string in linear time to enable LCP computation of two suffixes in constant time, this seems quite difficult in the Range LCP problem. It is trivial to answer such queries in time O(|j−i|2) after a linear-time preprocessing and easy to show an O(1) query algorithm after an O(|S|2) time preprocessing. We provide algorithms that solve the problem with the following complexities: 1 Preprocessing Time:O(|S|), Space:O(|S|), Query Time:O(|j−i|loglogn). Preprocessing Time: no preprocessing, Space:O(|j−i|log|j−i|), Query Time:O(|j−i|log|j−i|). However, the query just gives the pairs with the longest LCP, not the LCP itself. Preprocessing Time:O(|S|log2 |S|), Space:O(|S|log1+e |S|) for arbitrary small constant e, Query Time:O(loglog|S|).

[1]  Peter Sanders,et al.  Simple Linear Work Suffix Array Construction , 2003, ICALP.

[2]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.

[3]  Uzi Vishkin,et al.  Highly parallelizable problems , 1989, STOC '89.

[4]  Graham Cormode,et al.  Substring compression problems , 2005, SODA '05.

[5]  Martin Farach-Colton,et al.  Optimal Suffix Tree Construction with Large Alphabets , 1997, FOCS.

[6]  Lucian Ilie,et al.  Practical Algorithms for the Longest Common Extension Problem , 2009, SPIRE.

[7]  Timothy M. Chan,et al.  Orthogonal range searching on the RAM, revisited , 2011, SoCG '11.

[8]  Peter van Emde Boas,et al.  Design and implementation of an efficient priority queue , 1976, Mathematical systems theory.

[9]  Hiroki Arimura,et al.  Linear-Time Longest-Common-Prefix Computation in Suffix Arrays and Its Applications , 2001, CPM.

[10]  Edward M. McCreight,et al.  A Space-Economical Suffix Tree Construction Algorithm , 1976, JACM.

[11]  Mikhail J. Atallah,et al.  Data structures for range minimum queries in multidimensional arrays , 2010, SODA '10.

[12]  Gad M. Landau,et al.  Fast Parallel and Serial Approximate String Matching , 1989, J. Algorithms.

[13]  Gad M. Landau,et al.  Efficient string matching in the presence of errors , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[14]  Franco P. Preparata,et al.  Optimal Off-Line Detection of Repetitions in a String , 1983, Theor. Comput. Sci..

[15]  Abraham Lempel,et al.  On the Complexity of Finite Sequences , 1976, IEEE Trans. Inf. Theory.

[16]  Özgür Özkan,et al.  Mergeable Dictionaries , 2010, ICALP.

[17]  Peter Weiner,et al.  Linear Pattern Matching Algorithms , 1973, SWAT.

[18]  Esko Ukkonen,et al.  On-line construction of suffix trees , 1995, Algorithmica.

[19]  Robert E. Tarjan,et al.  Fast Algorithms for Finding Nearest Common Ancestors , 1984, SIAM J. Comput..

[20]  Michael A. Bender,et al.  The LCA Problem Revisited , 2000, LATIN.