From the course: Advanced Algorithmic Thinking with Python
Introduction to dynamic programming - Python Tutorial
From the course: Advanced Algorithmic Thinking with Python
Introduction to dynamic programming
- [Instructor] We are now going to look at a powerful technique called dynamic programming. Dynamic Programming is used to solve optimization problems by breaking them down into simpler subproblems, which overlap. We store the previously calculated values in order to avoid repetitive work. So to use dynamic programming, we have to have overlapping subproblems and we have to have optimal substructure. Overlapping subproblems means that the problem can be broken down into subproblems which are then reused several times. An optimal substructure means that the optimal solution for a problem of a given size is based on the optimal solution for problems of a smaller size. There's two main methods you'll come across with dynamic programming. There's the bottom up approach, which is based on tabulation. And there's the top down approach which is based on memorization. We will look at examples of both of these techniques in this chapter. Some examples of applications of this powerful technique are shown on the slides.
Contents
-
-
-
-
-
-
Introduction to dynamic programming56s
-
(Locked)
Top-down dynamic programming example2m 26s
-
(Locked)
Bottom-up dynamic programming example47s
-
(Locked)
The knapsack problem: Theory5m 7s
-
(Locked)
The knapsack problem: Python implementation3m 54s
-
(Locked)
Challenge: The knapsack problem36s
-
(Locked)
Solution: The knapsack problem16s
-
-
-