Chapter

Algorithms and Computation

Volume 3827 of the series Lecture Notes in Computer Science pp 799-808

Improved Algorithms for the k Maximum-Sums Problems

  • Chih-Huai ChengAffiliated withDepartment of Computer Science and Information Engineering
  • , Kuan-Yu ChenAffiliated withDepartment of Computer Science and Information Engineering
  • , Wen-Chin TienAffiliated withDepartment of Computer Science and Information Engineering
  • , Kun-Mao ChaoAffiliated withDepartment of Computer Science and Information EngineeringGraduate Institute of Networking and Multimedia, National Taiwan University

* Final gross prices may vary according to local VAT.

Get Access

Abstract

Given a sequence of n real numbers and an integer k, \(1 \leq k \leq {1 \over 2}n(n - 1)\), the k maximum-sum segments problem is to locate the k segments whose sums are the k largest among all possible segment sums. Recently, Bengtsson and Chen gave an \(O({\rm min}\{k+n{\rm log}^{2}n,n\sqrt{k}\})\)-time algorithm for this problem. In this paper, we propose an O(n + k log(min{n, k}))-time algorithm for the same problem which is superior to Bengtsson and Chen’s when k is o(nlog n). We also give the first optimal algorithm for delivering the k maximum-sum segments in non-decreasing order if kn. Then we develop an O(n 2d − 1 + k logmin{n, k})–time algorithm for the d-dimensional version of the problem, where d>1 and each dimension, without loss of generality, is of the same size n. This improves the best previously known O(n 2d − 1 C)-time algorithm, also by Bengtsson and Chen, where \(C = {\rm min}\{k + n {\rm log}^{2} n, n{\sqrt{k}}\}\). It should be pointed out that, given a two-dimensional array of size m × n, our algorithm for finding the k maximum-sum subarrays is the first one achieving cubic time provided that k is \(O({{m^{2}n} \over {{\rm log} n }})\).