Approximating Set Cover
1
SET-COVER
2
SET-COVER: Example
3
The Greedy Algorithm
4
Demonstration
5
0
1
2
3
4
5
compare to the optimal cover
How Good of an Approximation?
6
Loose Ratio-Bound
Claim: If ∃ cover of size k, then after k iterations the algorithm covered at least ½ of the elements
7
Suppose it doesn’t and observe the situation after k iterations:
the n elements
already covered
>½n
Loose Ratio-Bound
Claim: If ∃ cover of size k, then after k iterations the algorithm have covered at least ½ of the elements
8
the n elements
Since this part → can also be covered by k sets...
already covered
>½n
Loose Ratio-Bound
Claim: If ∃ cover of size k, then after k iterations the algorithm have covered at least ½ of the elements
9
the n elements
there must be a set not chosen yet, whose size is at least ½n·1/k
already covered
>½n
Loose Ratio-Bound
Claim: If ∃ cover of size k, then after k iterations the algorithm have covered at least ½ of the elements
10
the n elements
already covered
>½
Thus in each of the first k iterations we’ve covered at least ½n·1/k new elements
and the claim is proven!
Loose Ratio-Bound
Claim: If ∃ cover of size k, then after k iterations the algorithm covered at least ½ of the elements.
11
Therefore after klogn iterations (i.e - after choosing klogn sets) all the n elements must be covered, and the bound is proven.
Better Ratio Bound
Let S1, …, St be the sequence of sets outputted by the greedy algorithm. Let, for 0 <= i <= t���
Since, for every i, Ui can be covered by k sets, it follows��
12
Better Ratio Bound
�
Hence, for any 0 <= i < j <= t��
Which implies that for every i���
Therefore, t <= k ln(n) + 1
13
Tight Ratio-Bound
Claim: The greedy algorithm approximates the optimal set-cover to within a factor
H(max{ |S|: S∈F } )
Where H(d) is the d-th harmonic number:
14
Claim’s Proof
Charge $1 for each set
Split cost between covered elements
Bound from above the total fees paid
15
0.2
0.2
0.2
0.2
0.2
each recipient pays the fractional cost for the first set it appears in
Analysis
��
16
Lemma
Lemma: For every S∈F��
Proof: Fix an S∈F. For any i, let��
∀1≤i≤k : Si covers ui-1-ui elements of S�
Let k be the smallest index, s.t. uk=0
17
number of members of S still uncovered after i iterations
Lemma
18
sum charges
definition of ui-1
Telescopic sum
H(uk)=H(0)=0�
H(u0)=H(|S|)
Si covers more than S or else the greedy strategy would have taken S instead of Si
Analysis
Now we can finally complete our analysis:
19