L17-PTAS - Polynom tim ial e approxim ation sche e m...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Polynomial time Polynomial time approximation scheme approximation scheme Lecture 17: Mar 13
Background image of page 1

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

View Full DocumentRight Arrow Icon
Polynomial Time Approximation Scheme (PTAS) Polynomial Time Approximation Scheme (PTAS) We have seen the definition of a constant factor approximation algorithm. The following is something even better. An algorithm A A is an approximation scheme if for every є > 0, A runs in polynomial time (which may depend on є ) and return a solution: SOL (1+ є )OPT for a minimization problem SOL (1- ≥ є )OPT for a maximization problem For example, A A may run in time n 100/ є . There is a time-accuracy tradeoff.
Background image of page 2
Knapsack Problem Knapsack Problem A set of items, each has different size and different value. We only have one knapsack. Goal: to pick a subset which can fit into the knapsack and maximize the value of this subset.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Knapsack Problem Knapsack Problem (The Knapsack Problem) Given a set S = {a 1 , …, a n } of objects, with specified sizes and profits, size(a i ) and profit(a i ), and a knapsack capacity B, find a subset of objects whose total size is bounded by B and total profit is maximized. Assume size(a i ), profit(a i ), and B are all integers. We’ll design an approximation scheme for the knapsack problem.
Background image of page 4
Greedy Methods Greedy Methods Sort by object size in non-decreasing order: General greedy method : Sort the objects by some rule, and then put the objects into the knapsack according to this order. Sort by profit in non-increasing order: Sort by profit/object size in non-increasing order: Greedy won’t work.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Exhaustive Search Exhaustive Search n objects, total 2 n possibilities, view it as a search tree. choose object 1 not choose object 1 choose object 2 not choose object 2 choose object 2 not choose object 2 At the bottom we could calculate the total size and total profit, and choose the optimal subset.
Background image of page 6
Exhaustive Search Exhaustive Search size(a1)=2, profit(a1)=4 size(a2)=3, profit(a2)=5 size(a3)=2, profit(a3)=3 size(a4)=1, profit(a4)=2 (0,0) (Total size, total profit) choose object 1 not choose object 1 (2,4) (0,0) (0,0) (0,0) (5,9) (2,4) (2,4) (4,7) (5,9) (7,12) (3,5) (3,5) (5,8) (2,3) There are many redundancies.
Background image of page 7

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

View Full DocumentRight Arrow Icon
Exhaustive Search Exhaustive Search size(a1)=2, profit(a1)=4 size(a2)=3, profit(a2)=5 size(a3)=2, profit(a3)=3 size(a4)=1, profit(a4)=2 (0,0) (Total size, total profit) choose object 1 not choose object 1 (2,4) (0,0) (0,0) (0,0) (5,9) (2,4) (2,4) (4,7) (5,9) (7,12) (3,5) (3,5) (5,8) (2,3) There are many redundancies. (4,7) (5,9) (5,9) (6,11) (4,7) (3,5)
Background image of page 8
Exhaustive Search size(a1)=2, profit(a1)=4 size(a2)=3, profit(a2)=5 size(a3)=2, profit(a3)=3 size(a4)=1, profit(a4)=2 (0,0) (Total size, total profit) choose object 1 not choose object 1 (2,4) (0,0) (0,0) (0,0) (5,9) (2,4) (2,4) (4,7) (5,9) (7,12) (3,5) (3,5) (5,8) (2,3) There are many redundancies. (4,7)
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 39

L17-PTAS - Polynom tim ial e approxim ation sche e m...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online