Module 2 DAA
Module 2 DAA
Dynamic Programming:
Dynamic programming is a mathematical optimization method and an algorithmic paradigm that
was developed by Richard Bellman in the 1950s. It has found applications in numerous fields,
from aerospace engineering to economics.
Dynamic Programming is an algorithmic paradigm that solves a given complex problem by
breaking it into subproblems using recursion and storing the results of subproblems to avoid
computing the same results again.
Following are the two main properties of a problem that suggest that the given problem can be
solved using dynamic programming.
1. Overlapping Subproblems
2. Optimal Substructure
Given a bag with maximum weight capacity of W and a set of items, each having a weight and a
value associated with it. Decide the number of each item to take in a collection such that the
total weight is less than the capacity and the total value is maximized.
The 0/1 knapsack problem has not an The fractional knapsack problem has an
2.
optimal structure. optimal structure.
0/1 knapsack problem, finds a most In the fractional knapsack problem, finds
4. valuable subset item with a total value a most valuable subset item with a total
less than equal to weight. value equal to the weight.
Greedy Algorithms
Amortized Analysis