Efficient algorithms for the sum selection problem and k maximum sums problem

  • Authors:
  • Tien-Ching Lin;D. T. Lee

  • Affiliations:
  • Department of Computer Science and Information Engineering, National Taiwan University, Taipei, Taiwan;Department of Computer Science and Information Engineering, National Taiwan University, Taipei, Taiwan

  • Venue:
  • ISAAC'06 Proceedings of the 17th international conference on Algorithms and Computation
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given a sequence of n real numbers A = a1, a2,..., an and a positive integer k, the Sum Selection Problem is to find the segment A(i,j) = ai , ai+1,..., aj such that the rank of the sum s(i, j) = ∑t=ijat is k over all $\frac{n(n-1)}{2}$ segments. We present a deterministic algorithm for this problem that runs in O(n logn) time. The previously best known randomized algorithm for this problem runs in expected O(n logn) time. Applying this algorithm we can obtain a deterministic algorithm for the k Maximum Sums Problem, i.e., the problem of enumerating the k largest sum segments, that runs in O(n logn + k) time. The previously best known randomized and deterministic algorithms for the k Maximum Sums Problem run respectively in expected O(n logn + k) and O(n log2n + k) time in the worst case.