Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13981

Can this simpler case of the 2d maximum submatrix problem be solved more quickly?

$
0
0

Given an n by m matrix of integers, there is a well known problem of finding the submatrix with maximum sum. This can be solved with a 2d version of Kadane's algorithm. An explanation of an O(nm^2) time algorithm for the 2D version which is based on Kadane's algorithm can be found here.

I am interested in a simpler version where only submatrices that include the top left cell of the matrix are considered. Can this version be solved faster in O(nm) time? If so, how can you do it? I would also like to see what the optimal submatrix is, not just its sum.


Viewing all articles
Browse latest Browse all 13981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>