Applicability
The divide and conquer optimization applies when the dynamic programming recurrence is approximately of the form
dp[k][i]=j<imin{dp[k−1][j]+C[i][j]},
where A[k][i]≤A[k][i+1]. Here A[k][i] is the smallest index j⋆<i that minimizes dp[k−1][j⋆]+C[i][j⋆], i.e.
A[k][i]=argminj<i{dp[k−1][j]+C[i][j]}.
A sufficient (but not necessary) condition for A[k][i]≤A[k][i+1] to hold is that C[a][c] + C[b][d]≤C[a][d] + C[b][c] where a < b < c < d
The naive way of computing this recurrence with dynamic programming takes O(kn2) time, but only takes O(knlogn) time with the divide and conquer optimization.
Problems
See also
External links