Optimal algorithms for the interval location problem with range constraints on length and average
Let A be a sequence of n real numbers, L(1) and L(2) be two integers such that L(1) <= L(2), and let R(1) and R(2) be two real numbers such that R(1) <= R(2). An interval of A is feasible if its length is between L(1) and L(2), and its average is between R(1) and R(2). In this paper, we study the following problems: finding all feasible intervals of A, counting all feasible intervals of A, finding a maximum cardinality set of nonoverlapping feasible intervals of A, locating a longest feasible interval of A, and locating a shortest feasible interval of A. The problems are motivated from the problem of locating CpG islands in biomolecular sequences. In this paper, we first show that all the problems have an Omega(n log n)-time lower bound in the comparison model. Then, we use geometric approaches to design optimal algorithms for the problems. All the presented algorithms run in an online manner and use O(n) space.
algorithms data structures analysis of algorithms geometrical problems and computations