Dynamic Programming
Dynamic Programming
Programming
Group 24
What is dynamic programming
Sub-problems are smaller versions of the original problem. Let’s see an example. With the
equation below:
Sub-problem 1: 1+2
Sub-problem 2: 3+4
● Once we solve these two smaller problems, we can add the solutions to these sub-
problems to find the solution to the overall problem.
● Notice how these sub-problems break down the original problem into components that
build up the solution.
Recursion in Dynamic Programming
F(0) = 0, F(1) = 1 AND
F(n) = F(n-1) + F(n -2)
Applications
The following computer problems can be solved using dynamic programming approach
● Fibonacci number series
● Knapsack problem
● Tower of Hanoi
● All pair shortest path by Floyd-Warshall
● Shortest path by Dijkstra
● Project scheduling
Comparison of Algorithmic Design
approaches
Greedy Divide and Conquer Backtracking Dynamic Programming
Optimisation problem
used to find the best
solution that can be
applied.
Enumeration problem
used to find the set of all
feasible solutions of the
Comparison of Algorithmic Design
approaches
Greedy Divide and Conquer Backtracking Dynamic Programming