Algorithms for Locating Constrained Optimal Intervals

Abstract

In this work, we obtain the following new results. 1. Given a sequence D=((h1,s1), (h2,s2) ..., (hn,sn)) of number pairs, where si>0 for all i, and a number Lh, we propose an O(n)-time algorithm for finding an index interval [i,j] that maximizes Σk=ij hkΣk=ij sk subject to Σk=ij hk ≥ Lh. 2. Given a sequence D=((h1,s1), (h2,s2) ..., (hn,sn)) of number pairs, where si=1 for all i, and an integer Ls with 1≤ Ls≤ n, we propose an O(nT(Ls1/2)Ls1/2)-time algorithm for finding an index interval [i,j] that maximizes Σk=ij hkΣk=ij sk subject to Σk=ij sk ≥ Ls, where T(n') is the time required to solve the all-pairs shortest paths problem on a graph of n' nodes. By the latest result of Chan Chan, T(n')=O(n'3 ( n')3( n')2), so our algorithm runs in subquadratic time O(nLs( Ls)3( Ls)2).

0

Discussion (0)

Sign in to join the discussion.

Loading comments…