6b58e47b57347ed7f431970d436dad9d.ppt
- Количество слайдов: 60
Review: Dynamic Programming
Review: Optimal Substructure of LCS
Review: Structure of Subproblems
Memoization
Review: Dynamic Programming
Review: Dynamic Programming
Overview
Greedy Strategy
Activity-Selection Problem
Activity-selection Problem
Optimal Substructure
Recursive Solution
Activity Selection: Repeated Subproblems
Greedy Choice Property
Greedy-choice Property
Recursive Algorithm
Typical Steps
Activity Selection: A Greedy Algorithm
Elements of Greedy Algorithms
The Knapsack Problem
0 -1 Knapsack problem
0 -1 Knapsack problem: a picture
The Knapsack Problem
0 -1 Knapsack problem
0 -1 Knapsack problem: bruteforce approach
0 -1 Knapsack problem: bruteforce approach
Defining a Subproblem
Defining a Subproblem
Defining a Subproblem (continued)
Recursive Formula for subproblems
Recursive Formula
The Knapsack Problem And Optimal Substructure
Solving The Knapsack Problem
The Knapsack Problem: Greedy Vs. Dynamic
0 -1 Knapsack Algorithm
Running time
Example
Example (2)
Example (3)
Example (4)
Example (5)
Example (6)
Example (7)
Example (8)
Example (9)
Example (10)
Example (11)
Example (12)
Example (13)
Example (14)
Example (15)
Example (15)
Example (16)
Example (17)
Comments
Dynamic Programming
6b58e47b57347ed7f431970d436dad9d.ppt