By dividing an optimization problem into smaller, more manageable subproblems and making use of the fact that the best solution to the larger problem depends on the best solution to each of its smaller subproblems, dynamic programming (DP), an algorithmic technique, can solve optimization problems.