## Theoretical and practical improvements on the RMQ-problem, with applications to LCA and LCE (2006)

### Cached

### Download Links

Venue: | PROC. CPM. VOLUME 4009 OF LNCS |

Citations: | 21 - 9 self |

### BibTeX

@INPROCEEDINGS{Fischer06theoreticaland,

author = {Johannes Fischer and Volker Heun},

title = { Theoretical and practical improvements on the RMQ-problem, with applications to LCA and LCE},

booktitle = { PROC. CPM. VOLUME 4009 OF LNCS},

year = {2006},

pages = {36--48},

publisher = {Springer}

}

### OpenURL

### Abstract

The Range-Minimum-Query-Problem is to preprocess an array such that the position of the minimum element between two specified indices can be obtained efficiently. We present a direct algorithm for the general RMQ-problem with linear preprocessing time and constant query time, without making use of any dynamic data structure. It consumes less than half of the space that is needed by the method by Berkman and Vishkin. We use our new algorithm for RMQ to improve on LCA-computation for binary trees, and further give a constant-time LCE-algorithm solely based on arrays. Both LCA and LCE have important applications, e.g., in computational biology. Experimental studies show that our new method is almost twice as fast in practice as previous approaches, and asymptotically slower variants of the constant-time algorithms perform even better for today’s common problem sizes.

### Citations

899 |
Algorithms on Strings, Trees, and Sequences
- Gusfield
- 1997
(Show Context)
Citation Context ... = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats [17,18], approximate tandem repeats [19], and inexact pattern matching [20,21]. The easiest solution =-=[22]-=- to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and preprocess it for LCA-queries. Then lce(i,j) is given by the height of node lca(vi,vj), where vi and vj ... |

644 | Suffix arrays: a new method for on-line string searches
- Manber, Myers
- 1990
(Show Context)
Citation Context ...he powerful but rather space-consuming suffix tree by alternative array-based data structures, most prominently the suffix array, discovered independently by Gonnet et al. [8] and by Manber and Myers =-=[9]-=-. While this data structure supports string searches in time almost as good as suffix trees, Kasai et al. [10]sand Abouelhoda et al. [11] went one step further and showed that the addition of another ... |

330 |
Fast algorithms for finding nearest common ancestors
- Harel, Tarjan
(Show Context)
Citation Context ...ous applications, most importantly in the area of string processing and computational biology, where LCA is often used in conjunction with suffix trees. There are several variants of the problem (see =-=[2]-=-), the most prominent being the one where the tree is static and known in advance, and there are several queries to be answered on-line. In this case it makes sense to spend some time on preprocessing... |

185 |
On finding lowest common ancestors: simplification and parallelization
- Schieber, Vishkin
- 1988
(Show Context)
Citation Context ...Tarjan showed that an intrinsic preprocessing in time linear in the size of the tree is sufficient to answer LCA-queries in constant time. Their algorithm was later simplified by Schieber and Vishkin =-=[3]-=-, but remained rather complicated. A major breakthrough in practicable constant-time LCA-computation was made by Berkman and Vishkin [4], and again, in a simplified presentation, by Bender et al. [5,6... |

183 | The LCA problem revisited - Bender, Farach-Colton |

176 |
Scaling and related techniques for geometry problems
- Gabow, Bentley, et al.
- 1984
(Show Context)
Citation Context ...an ancestor of both v and w. Again, we consider the variant where T is static and the queries are posed on-line. As mentioned in the introduction, the RMQ- and the LCA-problem are closely related. In =-=[7]-=-, it has been shown that an LCA-query on T basically corresponds to a ±1RMQ-query on the heights of the nodes visited during an Euler-Tour in T. Because the size of an Euler-Tour is exactly 2n − 1, th... |

127 |
Replacing suffix trees with enhanced suffix arrays
- MI, Kurtz, et al.
- 2004
(Show Context)
Citation Context ...ered independently by Gonnet et al. [8] and by Manber and Myers [9]. While this data structure supports string searches in time almost as good as suffix trees, Kasai et al. [10]sand Abouelhoda et al. =-=[11]-=- went one step further and showed that the addition of another array to the suffix array, namely the LCP-array, is sufficient to simulate full tree traversals of the suffix tree. It is thus possible t... |

95 |
An efficient parallel biconnectivity algorithm
- Tarjan, Vishkin
- 1985
(Show Context)
Citation Context ...2 The original description in [4] used a slightly more complicated algorithm, which is, however, equivalent to the one presented here. 3 The name “Euler Tour” is derived from the Euler Tour-technique =-=[14]-=-, and is not to be confused with a Eulerian circuit. 3srepresentative array R[1,n]. The Cartesian Tree is not needed anymore once the arrays E, H and R are filled, and can thus be deleted. The paper t... |

94 |
A unifying look at data structures
- Vuillemin
- 1980
(Show Context)
Citation Context ...ith preprocessing time p(n) and query time q(n) has complexity 〈p(n),q(n)〉. Thus, the naive method described above would be 〈O(1),O(n)〉, because it requires no preprocessing. The following definition =-=[13]-=- will be central for both our algorithm and that of [4]. 1 By the time of writing we were unaware of another direct algorithm for RMQ [12]. 2sDefinition 1. A Cartesian Tree of an array A[l,r] is a bin... |

79 | Linear-time longestcommon-prefix computation in suffix arrays and its applications
- Kasai, Lee, et al.
(Show Context)
Citation Context ...ly the suffix array, discovered independently by Gonnet et al. [8] and by Manber and Myers [9]. While this data structure supports string searches in time almost as good as suffix trees, Kasai et al. =-=[10]-=-sand Abouelhoda et al. [11] went one step further and showed that the addition of another array to the suffix array, namely the LCP-array, is sufficient to simulate full tree traversals of the suffix ... |

76 | Nearest common ancestors: A survey and a new algorithm for a distributed environment. Theory Comput
- Alstrup, Gavoille, et al.
- 2004
(Show Context)
Citation Context ...ecause it requires no preprocessing. The following definition [13] will be central for both our algorithm and that of [4]. 1 By the time of writing we were unaware of another direct algorithm for RMQ =-=[12]-=-. 2sDefinition 1. A Cartesian Tree of an array A[l,r] is a binary tree C(A) whose root is a minimum element of A, labeled with the position i of this minimum. The left child of the root is the Cartesi... |

75 | An algorithm for approximate tandem repeats
- Landau, Schmidt, et al.
(Show Context)
Citation Context ... starting at position i and j; i.e., lcet(i,j) = max{k : ti,...,k = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats [17,18], approximate tandem repeats =-=[19]-=-, and inexact pattern matching [20,21]. The easiest solution [22] to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and preprocess it for LCA-queries. Then lce... |

68 |
Recursive star-tree parallel data structure
- Berkman, Vishkin
- 1993
(Show Context)
Citation Context ...e. Their algorithm was later simplified by Schieber and Vishkin [3], but remained rather complicated. A major breakthrough in practicable constant-time LCA-computation was made by Berkman and Vishkin =-=[4]-=-, and again, in a simplified presentation, by Bender et al. [5,6]. The key idea for this algorithm is the connection between LCA-queries on trees and range minimum queries on arrays (RMQs). Basically,... |

63 |
An o(nd) difference algorithm and its variations. Algorithmica
- Myers
- 1986
(Show Context)
Citation Context ..., lcet(i,j) = max{k : ti,...,k = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats [17,18], approximate tandem repeats [19], and inexact pattern matching =-=[20,21]-=-. The easiest solution [22] to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and preprocess it for LCA-queries. Then lce(i,j) is given by the height of node l... |

61 |
On economic construction of the transitive closure of a directed graph (in russian). english translation in soviet math. dokl
- Arlazarov, Dinic, et al.
- 1975
(Show Context)
Citation Context ...les out-of-block queries (i.e., queries that span over several blocks) to be answered in O(1). It remains to show how in-block-queries are handled. This is done with the so-called Four-Russians-Trick =-=[15]-=- where one precomputes the answers to all possible queries when the number of possible instances is sufficiently small. The authors of [6] noted that due to the ±1-property there are only O( √ n ′ ) b... |

50 | Succinct representations of LCP information and improvements in the compressed suffix arrays - Sadakane - 2002 |

39 |
New indices for text
- Gonnet, Baeza-Yates, et al.
- 1992
(Show Context)
Citation Context ...dexing tries to substitute the powerful but rather space-consuming suffix tree by alternative array-based data structures, most prominently the suffix array, discovered independently by Gonnet et al. =-=[8]-=- and by Manber and Myers [9]. While this data structure supports string searches in time almost as good as suffix trees, Kasai et al. [10]sand Abouelhoda et al. [11] went one step further and showed t... |

38 |
Introducing efficient parallelism into approximate string matching and a new serial algorithm
- Landau, Vishkin
- 1986
(Show Context)
Citation Context ..., lcet(i,j) = max{k : ti,...,k = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats [17,18], approximate tandem repeats [19], and inexact pattern matching =-=[20,21]-=-. The easiest solution [22] to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and preprocess it for LCA-queries. Then lce(i,j) is given by the height of node l... |

35 | Lowest common ancestors in trees and directed acyclic graphs
- Bender, Farach-Colton, et al.
(Show Context)
Citation Context ... [3], but remained rather complicated. A major breakthrough in practicable constant-time LCA-computation was made by Berkman and Vishkin [4], and again, in a simplified presentation, by Bender et al. =-=[5,6]-=-. The key idea for this algorithm is the connection between LCA-queries on trees and range minimum queries on arrays (RMQs). Basically, an RMQ asks for the position of the minimum element between two ... |

34 | Linear time algorithms for finding and representing all the tandem repeats in a string
- Gusfield, Stoye
- 2004
(Show Context)
Citation Context ...ongest common prefix of t’s suffixes starting at position i and j; i.e., lcet(i,j) = max{k : ti,...,k = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats =-=[17,18]-=-, approximate tandem repeats [19], and inexact pattern matching [20,21]. The easiest solution [22] to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and prepro... |

31 | Two Space Saving Tricks for Linear Time LCP Array Computation
- Manzini
(Show Context)
Citation Context ...lengths on the query time (w/o preproc.). gives us all the ingredients we need for our new LCE-algorithm: compute SA and its inverse SA −1 for t. 6 Further, compute the LCP-array for t in linear time =-=[10,24]-=- and store it in LCP. (SA is not further needed at this point and can thus be deleted.) Then prepare LCP for RMQs as presented in Sect. 3. It is now easy to see that lce(i,j) = LCP[rmq LCP(SA −1 [i] +... |

23 |
On finding lowest common ancestors in trees
- Aho, Hopcroft, et al.
- 1973
(Show Context)
Citation Context ...mon problem sizes. 1 Introduction The problem of finding the lowest common ancestor (LCA) of a pair of nodes in a tree has attracted much attention in the past three decades, starting with Aho et al. =-=[1]-=-. It is not only algorithmically beautiful, but also has numerous applications, most importantly in the area of string processing and computational biology, where LCA is often used in conjunction with... |

15 |
An incomplex algorithm for fast suffix array construction
- Schurmann, Stoye
(Show Context)
Citation Context ...ause the latter does no preprocessing. As expected, the Berkman-Vishkin method is the slowest, which is 6 There are fast algorithms that construct SA and its inverse with only o(n) extra space, e.g., =-=[23]-=-. 7 While this has the consequence that the algorithms [17, 19–21] can be implemented without trees, it is not immediately obvious how to do this for [18] because it uses the tree structure also for r... |

9 |
The Art of Computer Programming. Volume 4, Fascicle 4. Generating all trees - History of combinatorial generation
- Knuth
- 2004
(Show Context)
Citation Context ...h a case both blocks share the same RMQs. The most naive way to calculate the type would be to actually construct the Cartesian Tree of each block, and then use an inverse enumeration of binary trees =-=[16]-=- to compute its type. This, however, would counteract our aim to avoid dynamic data structures. The algorithm 5sInput: block Bj of size s Output: type(Bj) 1 let rp be an array of size s + 1 2 rp[1] ← ... |

4 |
An O(nlog n) algorithm for finding all repetitions in a string
- Main, Lorentz
- 1984
(Show Context)
Citation Context ...ongest common prefix of t’s suffixes starting at position i and j; i.e., lcet(i,j) = max{k : ti,...,k = tj,...,k}. 5 The problem has numerous applications in string matching, e.g., for tandem repeats =-=[17,18]-=-, approximate tandem repeats [19], and inexact pattern matching [20,21]. The easiest solution [22] to LCE combines suffix trees with constant-time LCA-retrieval: build a suffix tree T for t and prepro... |