Skip to main content

6. Dynamic Programming Made Simple

Chapter 6: Dynamic Programming Made Simple

📄️ 6.1 Algorithm Explanation

Here, we quote Wikipedia’s description: "Dynamic Programming (DP) is effective in finding the optimal solution for problems with many overlapping subproblems. It redefines the problem into subproblems. To avoid repeatedly solving these subproblems, their results are progressively computed and stored, starting from simpler problems until the entire problem is resolved. Therefore, dynamic programming saves the results of recursion and avoids spending time solving the same problems repeatedly. Dynamic programming can only be applied to problems with an optimal substructure. The optimal substructure means that the local optimal solution can determine the global optimal solution (this requirement is not always completely met for some problems, so certain approximations may be introduced). Simply put, the problem can be broken down into subproblems to solve."