Suppose you have an N × N matrix where each row has exactly one nonzero element and each column has exactly one nonzero element (the nonzero elements can be either positive or negative). We want to find the maximum-sum submatrix. How efficiently can we do so?
The matrix has dimension N × N and only N non-zero elements. N is so big, so I can't use an O(N3) algorithm. Does anyone know how to solve this in time O(N2), O(N log N), or some other time complexity like this?
Thanks!