Given an array of real numbers,, A[1..n,1..n]I want to find a sub-array
B = A[i..j,s..t]
with 1 <= i <= j <= n,and1 <= s <= t <= n
so the sum of the numbers from is Bmaximized. Can this be solved using dynamic programming? I spoke with one of the OR professors at Aarhus University, and he did not know how to do this, and said that it was difficult for him to understand how he could have the optimal quality of the substructure.
But is it possible? If so, how? If not, why?
I already know an algorithm that works at O(n^3)times, reducing it to n(n+1)/2subtasks of complexity O(n), but this seems a bit slow. I know that an optimal algorithm will work in Omega(n)time, but I hope that dynamic programming can be used to run it in O(n^2)time.
Original question summed up
I added this section because I felt that some people misinterpreted the essence of my question. Original question:
- Can dynamic programming be used to solve the above problem in
O(n^2)time? If so, how? If not, why not?
Additional questions:
I have added new questions here. More details can be added later:
- , , , ( ). ,
B = A[1..m,1..m] of A[1..n,1..n], m < n, B , A, , A. , , : A[1..i,1..i] A[1..i+1,1..i+1]?