Learning objectives
After this class, you should be able to:
- Define the Knapsack problem.
- Define a fully polynomial time approximation scheme (FPTAS).
- Describe a pseudo-polynomial time algorithm for this problem.
Reading assignment
- AA: Chapter 8, up to (and including) section 8.1.
- AA: Page 68 (the first page of Chapter 8).
Exercises and review questions
- Questions on current lecture's material
- Find a solution to the following Knapsack example:
sizes {2, 2, 3}, profits: {5, 5, 8}, B = 4
.- AA: Exercise 8.1: Consider the following greedy algorithm for the Knapsack problem. Sort the objects by decreasing ratio of profit to size, and then greedily pick objects in this order. Show that this algorithm can be made to perform arbitrarily badly.
- The pseudo-polynomial time algorithm that we discussed for the Knapsack problem computes the cost of the optimal solution, and not the optimal solution itself. Modify this algorithm so that it computes the actual solution too, while maintaining the time and space complexity of the algorithm discussed.
- (Post your answer on the discussion board) Give an application for the Knapsack problem.
- Questions on next lecture's material
- What is the difference between a polynomial time approximation scheme and a fully polynomial time approximation scheme?