The dynamic programming is applied in optimization problems. It could have a lot of possible solutions but we want to find an optimal solution.
The development of an algorithm through the dynamic programming has basically 3 steps:
- Characterize the structure of an optimal solution;
- Recursively define the optimal solution value;
- Construct an optimal solution through the calculated informations.
By the way, if the subject is optimization the tool to do this is Python. We worry only about apply the concepts and forgets the sintax common issues while programming.