tags:


See Skiena

Elements of DP #

Problems solvable by DP have two characteristics:

  1. Optimal substructure - optimal solutions to a problem incorporate optimal solutions to related subproblems, which we may solve Independently.
  2. Overlapping subproblems - two different problems share some common subproblems (i.e. params are identical). This is where storage helps.

Note:

DnC vs DP #

To compare them, think of a problem being solved recursively, and a total of n subproblems are generated. The number of generated subproblems are the same in both solution approaches, DnC and DP.

The difference is that all subproblems in the DnC case are distinct. But in the DP case some are the exact same, so memoization is possible.

DP problems list #