250 likes | 264 Views
Lecture 25 Partition. Partition. Subsum. S=33333333333333333333 1111111111111111111111. 1. 1. Puzzle. Answer. Knapsack. Decision Version. Theorem. Proof. Theorem. Algorithm. Classify: for i < m, c i < a= c G , for i > m+1, c i > a. Sort For.
E N D
Puzzle Answer
Theorem Proof.
Algorithm • Classify: for i < m, ci< a= cG, for i > m+1, ci > a. • Sort • For
Fully PTAS • A problem has a fully PTAS if for any ε>0, it has (1+ε)-approximation running in time poly(n,1/ε).
Time • outside loop: O(n) • Inside loop: O(nM) where M=max ci • Core: O(n log (MS)) • Total O(n M log (MS)) • Since input size is O(n log (MS)), this is a pseudo-polynomial-time due to M=2 3 log M