Efficient BSP/CGM Algorithms for the Maximum Subarray Sum and Related Problems

  • Anderson C. LimaEmail author
  • Rodrigo G. Branco
  • Edson N. Cáceres
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9155)


Given an \(n \times n\) array A of integers, with at least one positive value, the maximum subarray sum problem consists in finding the maximum sum among the sums of all rectangular subarrays of A. The maximum subarray problem appears in several scientific applications, particularly in Computer Vision. The algorithms that solve this problem have been used to help the identification of the brightest regions of the images used in astronomy and medical diagnosis. The best known sequential algorithm that solves this problem has \({\text {O}}\bigl (n^{3}\bigr )\) time complexity. In this work we revisit the BSP/CGM parallel algorithm that solves this problem and we present BSP/CGM algorithms for the following related problems: the maximum largest subarray sum, the maximum smallest subarray sum, the number of subarrays of maximum sum, the selection of the subarray with k- maximum sum and the location of the subarray with the maximum relative density sum. To the best of our knowledge there are no parallel BSP/CGM algorithms for these related problems. Our algorithms use p processors and require \({\text {O}}\bigl (n^{3}/p\bigr )\) parallel time with a constant number of communication rounds. In order to show the applicability of our algorithms, we have implemented them on a cluster of computers using MPI and on a machine with GPGPU using CUDA and OpenMP. We have obtained good speedup results in both environments. We also tested the maximum relative density sum algorithm with a image of the cancer imaging archive.


Parallel algorithms BSP/CGM Computer vision GPGPU Maximum subarray sum 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alves, C.E.R., Cáceres, E.N., Song, S.W.: BSP/CGM algorithms for maximum subsequence and maximum subarray. In: Kranzlmüller, D., Kacsuk, P., Dongarra, J. (eds.) EuroPVM/MPI 2004. LNCS, vol. 3241, pp. 139–146. Springer, Heidelberg (2004) CrossRefGoogle Scholar
  2. 2.
    Bae, S.E.: Sequential and Parallel Algorithms for the Generalized Maximum Subarray Problem. PhD thesis, University of Canterbury, Christchurch, New Zealand (2007)Google Scholar
  3. 3.
    Bentley, J.: Programming pearls: Algorithm design techniques. Commun. ACM 27(9), 865–873 (1984)MathSciNetCrossRefGoogle Scholar
  4. 4.
    Dehne, F., Ferreira, A., Cáceres, E.N., Song, S.W., Roncato, A.: Efficient para- llel graph algorithms for coarse grained multicomputers and BSP. Algorithmica 33(2), 183–200 (2002)zbMATHMathSciNetCrossRefGoogle Scholar
  5. 5.
    Dehne, F., Fabri, A., Rau-chaplin, A.: Scalable parallel computational geometry for coarse grained multicomputers. International Journal on Computational Geometry 6, 298–307 (1994)Google Scholar
  6. 6.
    Ferreira, C.S., Camargo, R.Y., Song, S.W.: A parallel maximum subarray algorithm on GPUs. In: IEEE International Symposium on Computer Architecture and High Performance Computing Workshops, pp. 12–17, October 2014Google Scholar
  7. 7.
    Gotz, S.M.: Communication-Efficient Parallel Algoritms for Minimum Span- ning Tree Computation. PhD thesis, University of Paderborn, May 1998Google Scholar
  8. 8.
    National Cancer Institute: Cancer imaging archive (2015) (accessed 11- Jan-2014).
  9. 9.
    Perumalla, K., Deo, N.: Parallel algorithms for maximum subse- quence and maximum subarray. Parallel Processing Letters 5, 367–373 (1995)CrossRefGoogle Scholar
  10. 10.
    Qiu, K., Akl, S.G.: Parallel maximum sum algorithms on interconnection networks. Technical report, Queens University Dept. of Com., Ontario, Canada (1999)Google Scholar
  11. 11.
    Saleh, S., Abdellah, M., Raouf, A.A.A., Kadah, Y.M.: High performance cuda-based implementation for the 2d version of the maximum sub- array problem (msp). In: Cairo International Biomedical Engineering Conference (CIBEC) (2012)Google Scholar
  12. 12.
    ITU International Telecommunication Union. Recommendation ITU-R BT. 470–6,7. Conventional Analog Television Systems (1998) (accessed 03-January- 2015).
  13. 13.
    Wen, Z.: Fast parallel algorithms for the maximum sum problem. Parallel Computing 21(3), 461–466 (1995)zbMATHMathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Anderson C. Lima
    • 1
    Email author
  • Rodrigo G. Branco
    • 1
  • Edson N. Cáceres
    • 1
  1. 1.Faculdade de ComputaçãoUniversidade Federal de Mato Grosso do SulCampo GrandeBrazil

Personalised recommendations