Algorithm to find the submatrix with the greatest sum of its elements?

Click For Summary
SUMMARY

The discussion centers on developing an algorithm to find the submatrix with the greatest sum of its elements in a real-valued matrix A. The proposed method utilizes Kadane's algorithm applied to each submatrix defined by pairs of left and right columns, achieving a time complexity of O(n^3). While the participants acknowledge the existence of a potentially faster algorithm, they confirm that the optimal solution remains between O(n^2) and O(n^3). The problem is closely related to the "Maximum subarray problem," which can be solved in O(n) time for one-dimensional arrays.

PREREQUISITES
  • Understanding of Kadane's algorithm for maximum subarray sums
  • Familiarity with dynamic programming concepts
  • Knowledge of matrix operations and indexing
  • Basic algorithmic complexity analysis
NEXT STEPS
  • Research advanced dynamic programming techniques for matrix problems
  • Explore the "Maximum subarray problem" and its applications
  • Investigate algorithms that achieve sub-O(n^2) complexity for submatrix sum problems
  • Learn about optimization techniques in algorithm design
USEFUL FOR

Computer scientists, algorithm developers, and software engineers focused on optimization problems in matrix computations.

Jamin2112
Messages
973
Reaction score
12
This is a challenge problem I thought of: Given a real-valued matrix A, develop an algorithm that finds the submatrix with the greatest sum of its element. (If there's a tie, just return an arbitrary submatrix that's tied for the win.)

Is there a way other than brute force?
 
Technology news on Phys.org
Sounds like an application for dynamic programming. Use Kadane's algorithm on each submatrix using right and left column pairs -

O(n^3). I believe there is a faster algorithm but I do not know it offhand.
 
I've seen this problem before -- Wikipedia calls the 1D problem the "Maximum subarray problem" and it can be solved in O(n). I spent some time trying to find a solution linear in the number of matrix elements, but never found one. I believe the best solution was more than O(n^2) but less than O(n^3) (see the references at the end of the wikipedia article).
 

Similar threads

Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 25 ·
Replies
25
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
1K
Replies
6
Views
5K