{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

10 - Knapsack

# 10 - Knapsack - Part III Dynamic Programming Lecture 10 The...

This preview shows pages 1–7. Sign up to view the full content.

Part III: Dynamic Programming Lecture 10: The 0-1 Knapsack Problem Lecture 10: The 0-1 Knapsack Problem Part III: Dynamic Programming

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Part III What is dynamic programming? A technique for solving optimization problems. What are optimization problems? Problems with many possible solutions. Each solution has a value. Objective: Find a solution with the optimal value . Lecture 10: The 0-1 Knapsack Problem Part III: Dynamic Programming
Introduction to Part III How to develop a dynamic programming? Four steps 1 Structure : Analyze structure of an optimal solution, and thereby choose a space of subproblems. 2 Recursion : Establish relationship between the optimal value the problem and those of some subproblems 3 Bottom-up computation : Compute the optimal values of the smallest subproblems first, save them in the table, Then compute optimal values of larger subproblems, and so on, until the optimal value of the original problem is computed. 4 Construction of optimal solution : Assemble optimal solution by tracing the computation at the previous step. Notes: Steps 1 and 2 are related. Step 4 is not always necessary: we sometimes need only the optimal value. Lecture 10: The 0-1 Knapsack Problem Part III: Dynamic Programming

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Part III Dynamic programming (DP) vs Divide-and-Conquer (DC) Commonalities: 1 Partition the problem into particular subproblems. 2 Solve the subproblems. 3 Combine the solutions to solve the original one. Differences: DC: Efficient when the subproblems are independent. Not efficient when subproblems share subsubproblems. Some subproblems might be solved many times. DP: Suitable when subproblems share subsubproblems. Some each subproblem only once. The result is stored in a table in case it is needed elsewhere. DP trades space for time . Lecture 10: The 0-1 Knapsack Problem Part III: Dynamic Programming
Introduction to Part III We will study three examples of Dynamic programming: The 0-1 Knapsack Problem Chain Matrix Multiplication All Pairs Shortest Path Lecture 10: The 0-1 Knapsack Problem Part III: Dynamic Programming

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Outline of Lecture 10 The 0-1 Knapsack Problem. Developing a DP algorithm.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern