Approximation Algorithms (3)
Subset-Sum Problem
Subset-Sum Proble/m
- An instance of the subset-sum problem is a pair (S,t)
- S is a positive integer set {X1,X2,…,Xn}
- t is a positive integer
- Whether there exists a subset of S that adds up exactly to the target value t
- e.g.)
- S={1,2,7,14,49,54},t=58
- The subset S′={2,7,49} is a solution
Exponential Time Exact Algorithm
Preliminary
- Given a integer set S and a integer x
- S+x={s+x:s∈S}
- e.g.) S={0,1,5,9},S+2={2,3,7,11}
- Pi denote the set of all possible summation values by selecting a subset of {x1,x2,…,xi}
- e.g.) S={1,4,5},P1={0,1},P2={0,1,4,5},P3={0,1,4,5,6,9,10}
- Pi=Pi−1∪(Pi−1+xi)
- Li denote a sorted list containing every element of Pi whose value is not more than t
- MERGE−LISTS(L,L′) returns the sorted list that is merge of its two sorted input lists with duplicate values removed
- Runs in time O(∣L∣+∣L′∣)
Algorithm
Approximation
Fully Polynomial Time Approximation Scheme
- Polynomial in 1/ϵ as well as in the size of the input
Trimming
- If two values in L are close, maintain only one value
- To trim a list L by δ(0<δ<1) means
- For every removed element y, there is an element z still in trimming result L′ satisfying 1+δy≤z≤y
- e.g.)
- δ=0.1
- L=<10,11,12,15,20,21,22,23,24,29>
- L′=<10,12,15,20,23,29>
- 11 is represented by 10(11/1.1≤10≤11)
- 21,22 are represented by 20
- 24 is represented by 23
- Scan L in monotonically increasing order
- If it is the first element of L or
if it cannot be represented by the most recent number placed into L′
APPROX-SUBSET-SUM
- Given input S, a target integer t and an approximation parameter ϵ
- Return a value z whose value is within a 1+ϵ factor of the optimal solution


Fully polynomial time approximation scheme
- Proof
- Every element of Li is a memeber of Pi
- Therefore, the value z∗ is the sum of some subset of S
- y∗∈Pn denote an optimal solution
- z∗≤y∗
- Need to show
1. z∗y∗≤1+ϵ
2. Running time is polynomial in both 1/ϵ and the size of the input