Dynamic Programming21 sections · 916 units
Open in Course

What's Next

Preview of Convex Hull Trick

D&C and Knuth improve by exploiting monotonicity of optimal splits. But what if the structure is different? Convex Hull Trick optimizes DP transitions that have a linear form: dp[i]=min(mjxi+bj)dp[i] = \min (m_j \cdot x_i + b_j). It's geometry-based.

Instead of bounding split points, CHT maintains a hull of lines. Each transition is a point-line query. These are all tools in the DP improvement toolkit. Each applies to a specific structural pattern.