We study the non-overlapping indexing problem: Given a text T, preprocess it so that you can answer queries of the form: given a pattern P, report the maximal set of non-overlapping occurrences of P in T. A generalization of this problem is the range non-overlapping indexing where in addition we are given two indexes i,j to report the maximal set of non-overlapping occurrences between these two indexes. We suggest new solutions for these problems. For the non-overlapping problem our solution uses O(n) space with query time of O(m + occ_ NO ). For the range non-overlapping problem we propose a solution with O(n ^ n) space for some 0< <1 and O(m + n + occ_ ij,NO ) query time.
We present two natural variants of the indexing problem: In the range non-overlapping indexing problem, we preprocess a given text to answer queries in which we are given a pattern, and wish to find a maximal-length sequence of occurrences of the pattern in the text, such that the occurrences do not overlap with one another. While efficiently solving this problem, our algorithm even enables us to efficiently perform so in substrings of the text, denoted by given start and end locations. The methods we supply thus generalize the string statistics problem [4,5], in which we are asked to report merely the number of non-overlapping occurrences in the entire text, by reporting the occurrences themselves, even only for substrings of the text. In the related successive list indexing problem, during query-time we are given a pattern and a list of locations in the preprocessed text. We then wish to find a list of occurrences of the pattern, such that the ith occurrence is the leftmost occurrence of the pattern which starts to the right of the ith location given by the input list. Both problems are solved by using tools from computational geometry, specifically a variation of the range searching for minimum problem of Lenhof and Smid [12], here considered over a grid, in what appears to be the first utilization of range searching for minimum in an indexing-related context.