Algorithm for K Disjoint Maximum Subarrays

  • Sung Eun Bae
  • Tadao Takaoka
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3991)


The maximum subarray problem is to find the array portion that maximizes the sum of array elements in it. For K disjoint maximum subarrays, Ruzzo and Tompa gave an O(n) time solution for one-dimension. This solution is, however, difficult to extend to two-dimensions. While a trivial solution of O(Kn 3) time is easily obtainable for two-dimensions, little study has been undertaken to better this. We first propose an O(n+Klog K) time solution for one-dimension. This is equivalent to Ruzzo and Tompa’s when order is considered. Based on this, we achieve O(n 3+Kn 2log n) time for two-dimensions. This is cubic time when Kn/log n.


Trivial Solution Time Solution Array Element Input Array Small Physical Size 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Bae, S.E., Takaoka, T.: Algorithms for the problem of K maximum sums and a VLSI algorithm for the K maximum subarrays problem. In: ISPAN 2004, Hong Kong, May 10-12, pp. 247–253. IEEE Comp.Soc. Press, Los Alamitos (2004)Google Scholar
  2. 2.
    Bae, S.E., Takaoka, T.: Improved algorithms for the K-maximum subarray problem for small K. In: Wang, L. (ed.) COCOON 2005. LNCS, vol. 3595, pp. 621–631. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Bengtsson, F., Chen, J.: Efficient algorithms for the k maximum sums. In: Fleischer, R., Trippen, G. (eds.) ISAAC 2004. LNCS, vol. 3341, pp. 137–148. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Bengtsson, F., Chen, J.: A note on ranking k maximum sums. research report 2005:08 (2005) Luleå University of TechnologyGoogle Scholar
  5. 5.
    Bentley, J.: Programming pearls: algorithm design techniques. Commun. ACM 27(9), 865–873 (1984)CrossRefMathSciNetGoogle Scholar
  6. 6.
    Bentley, J.: Programming pearls: perspective on performance. Commun. ACM 27(11), 1087–1092 (1984)CrossRefGoogle Scholar
  7. 7.
    Cheng, C.H., Chen, K.Y., Tien, W.C., Chao, K.M.: Improved algorithms for the k maximum sums problems. In: Deng, X., Du, D.-Z. (eds.) ISAAC 2005. LNCS, vol. 3827, pp. 799–808. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  8. 8.
    Ruzzo, W.L., Tompa, M.: A linear time algorithm for finding all maximal scoring subsequences. In: ISMB 1999, Heidelberg, Germany, August 6-10, pp. 234–241 (1999)Google Scholar
  9. 9.
    Takaoka, T.: Efficient algorithms for the maximum subarray problem by distance matrix multiplication. Elec. Notes in Theoretical Comp. Sci, vol. 61. Elsevier, Amsterdam (2002)Google Scholar
  10. 10.
    Tamaki, H., Tokuyama, T.: Algorithms for the maximum subarray problem based on matrix multiplication. In: SODA 1998, San Francisco, January 25-27, pp. 446–452 (1998)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Sung Eun Bae
    • 1
  • Tadao Takaoka
    • 1
  1. 1.Department of Computer Science and Software EngineeringUniversity of CanterburyChristchurchNew Zealand

Personalised recommendations