SlideServe
Menu
Préférences
© SlideServe · v2026

Lecture 5 Dynamic Programming

inez avatar
33 diapositives · 529 Views · Aug 30, 2014

Lecture 5 Dynamic Programming. Dynamic Programming. Self-reducibility. Divide and Conquer. Divide the problem into subproblems. Conquer the subproblems by solving them recursively. Combine the solutions to subproblems into the solution for original problem. Dynamic Programming.

Lecture 5 Dynamic Programming - slide 1
01 / 33Lecture 5 Dynamic Programming
1 / 17

Télécharger la présentation

Lecture 5 Dynamic Programming
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Lecture 5 Dynamic Programming

  2. Dynamic Programming Self-reducibility

  3. Divide and Conquer • Divide the problem into subproblems. • Conquer the subproblems by solving them recursively. • Combine the solutions to subproblems into the solution for original problem.

  4. Dynamic Programming • Divide the problem into subproblems. • Conquer the subproblems by solving them recursively. • Combine the solutions to subproblems into the solution for original problem.

  5. Remark on Divide and Conquer Key Point: Divide-and-Conquer is a DP-type technique.

  6. Greedy Algorithms with Self-Reducibility Dynamic Programming Divide and Conquer Local Ratio

  7. Matrix-chain Multiplication

  8. Fully Parenthesize

  9. Scalar Multiplications

  10. e.g., # of scalar multiplications

  11. Step 1. Find recursive structure of optimal solution

  12. Step 2. Build recursive formula about optimal value

  13. Step 3. Computing optimal value

  14. Step 3. Computing optimal value

  15. Step 4. Constructing an optimalsolution

  16. 151 15,125 11,875 10,500 9,375 7,125 5,375 7,875 4,375 2,500 3,500 15,700 2,625 750 1,000 5,000 0 0 0 0 0 0

  17. 151 15,125 (3) 11,875 10,500 (3) (3) 9,375 7,125 5,375 (3) (3) (3) 7,875 4,375 2,500 3,500 (1) (3) (3) (5) 15,700 2,625 750 1,000 5,000 (1) (2) (3) (4) (5) 0 0 0 0 0 0 Optimal solution

  18. Running Time

  19. Running Time How many recursive calls? How many m[I,j] will be computed?

  20. # of Subproblems

  21. Running Time

  22. Remark on Running Time (1) Time for computing recursive formula. (2)The number of subproblems. (3) Multiplication of (1) and (2)

  23. Longest Common Subsequence

  24. Problem

  25. Recursive Formula

  26. More Examples

  27. A Rectangle with holes NP-Hard!!!

  28. Guillotine cut

  29. Guillotine Partition A sequence of guillotine cuts Canonical one: every cut passes a hole.

  30. Minimum length Guillotine Partition • Given a rectangle with holes, partition it into smaller rectangles without hole to minimize the total length of guillotine cuts.

  31. Minimum Guillotine Partition Dynamic programming In time O(n ): 5 Each cut has at most 2n choices. 4 There are O(n ) subproblems. Minimum guillotine partition can be a polynomial-time approximation.

  32. What we learnt in this lecture? • How to design dynamic programming. • Two ways to implement. • How to analyze running time.

  33. Puzzle