Halving The Decision Range

Divide and conquer DP optimization: what condition, what recurrence shape, what bound?

A

For dp(i,j)=min⁡k≤j{dp(i−1,k−1)+C(k,j)}dp(i,j) = \min_{k \le j} { dp(i-1, k-1) + C(k,j) } with no condition beyond an O(1)O(1) evaluation of CC, solving the middle jj first bounds the decision range of both halves, giving O(mnlog⁡n)O(mn \log n) instead of O(mn2)O(mn^2).

B

For dp(i,j)=min⁡k≤j{dp(i−1,k−1)+C(k,j)}dp(i,j) = \min_{k \le j} { dp(i-1, k-1) + C(k,j) } with opt(i,j)≤opt(i,j+1)opt(i,j) \le opt(i,j+1), solving the middle jj first bounds the decision range of both halves, giving O(mnlog⁡n)O(mn \log n) instead of O(mn2)O(mn^2).

C

For dp(i,j)=min⁡k≤j{dp(i−1,k−1)+C(k,j)}dp(i,j) = \min_{k \le j} { dp(i-1, k-1) + C(k,j) } with opt(i,j)≥opt(i,j+1)opt(i,j) \ge opt(i,j+1), solving the middle jj first bounds the decision range of both halves, giving O(mnlog⁡n)O(mn \log n) instead of O(mn2)O(mn^2).

D

For dp(i,j)=min⁡k≤j{dp(i−1,k−1)+C(k,j)}dp(i,j) = \min_{k \le j} { dp(i-1, k-1) + C(k,j) } with CC convex in kk, ternary searching each jj for its minimum bounds the decision range directly, giving O(mnlog⁡n)O(mn \log n) instead of O(mn2)O(mn^2).