1 An Introduction To Approximation Algorithms
1 An Introduction To Approximation Algorithms
February 4, 2000
Lecture 1
(1 + )-approximation algorithm which runs in time polynomial in the input size for
xed . For a maximization problem, we require that A is a (1 )-approximation
algorithm.
Some problems for which PTAS's exist are knapsack, Euclidean TSP (Arora 1996,
Mitchell 1996), and many scheduling problems. Other problems like MAX SAT, MAX
CUT and Metric TSP are harder. They all belong to the class of MAX SNP-hard
problems, which are characterized by the following theorem:
Theorem 1 (Arora, Lund, Motwani, Sudan, Szegedy 1992) There does not exist a
PTAS for any MAX SNP-hard problem unless P = NP .
There is a similar, but even more discouraging result with respect to MAX CLIQUE:
Theorem 2 (Hastad 1996) There does not exist a O(n ) approximation algorithm
for any > 0 for MAX CLIQUE unless NP RP .
What is MAX CLIQUE ? Given a graph G = (V; E ), nd the clique S V of
maximum size jS j. And what is a clique?
Denition 3 A clique S is a set of vertices for which each vertex pair has its corresponding edge included (that is, i 2 S , j 2 S implies (i; j ) 2 E ).
1
Note that there is a trivial approximation algorithm for MAX CLIQUE with
performance guarantee n = jV j. Simply take a single vertex; this is trivially a clique.
The size of any clique cannot be more than n, so the algorithm has a performance
guarantee of n=1 = n. Hastad's result tells us that we do not expect to do much
better than this trivial algorithm.
This brief survey is meant to convey that some NP-hard optimization problems
are much harder than others. While some problems are approximable to within
any factor you want, other problems are not approximable beyond a trivial amount.
1-2
The previous results about MAX CLIQUE and MAX SNP come from the theory of
probabilistically checkable proofs.
The theory of approximation algorithms is a set of positive results showing that
some problems are eciently approximable. The theory of probabilistically checkable
proofs (PCP) is a set of negative results showing that many problems cannot be
approximated better than a certain factor. Together the two form a complete theory
of NP-hard optimization problems. In this class we will only mention PCP results;
our focus will be on deriving approximation techniques. This will be done by studying
a central body of techniques, mostly from the 90's, that will enable you to go forth
and design your own approximation algorithms.
We now post two central theses of this course:
There is a central core of techniques for designing approximation algorithms.
Know these, and you know a lot.
Linear Programming and Integer Programming are central tools for designing
and analyzing approximation algorithms.
Both of these theses will be illustrated in our discussion of Set Cover, an NP-hard
optimization problem.
2 Set Cover
E.
Sets: 3 byte sequences in viral boot sectors not found in \good" code (about
21,000 of them).
Once a relevant set cover was found, the 3 byte sequences were used as \features" for
a neural classier that would determine when a boot sector virus was present or not.
Since many boot sector viruses are written by modifying previous ones it was hoped
that this would allow detection of previously unknown boot sector viruses. A small
set cover (much less than 150 sets) was desired in order to avoid overtting the data.
Using the greedy algorithm discussed later in the lecture, a set cover of 50 sets was
found (actually, the cover was such that each element was contained in four distinct
sets of the solution). The neural classier successfully found many unknown boot
sector viruses in practice.
A second reason to care about Set Cover is that it generalizes other problems.
Consider the following problem:
To see that VC is a special case of SC, consider the following identication:
Elements in SC: all edges in G (the VC edges).
Sets in SC: Si = fall edges incident to vertex ig.
Now we progress to the second thesis. Let's write Set Cover as an integer program.
Here, we create a variable xj for each subset Sj . If j 2 I , then xj = 1, otherwise
xj = 0.
Min
m
X
j =1
wj xj
subject to: X
xj 1
j :ei 2Sj
xj 2 f0; 1g
8ei 2 E
1-4
The inequality constraints just state that for each item in our ground set, we must
choose at least one set that covers that item. This can't be solved in polynomial time,
so we relax the integrality requirement. The resulting linear program (LP) can be
solved in polynomial time.
Min
m
X
j =1
wj xj
subject to: X
xj 1
8ei 2 E
j :ei 2Sj
xj 0
If you are not familiar with any of the myriad ways to solve LP's in polynoimal
time, don't worry. We will just be using polynomial time LP solvers as a black box.
We close our eyes and the LP solver returns a solution x.
Let OPT be the optimal objective value for the integer program, and let ZLP
OPT since the
be the optimal objective value for the linear program. Then ZLP
solution space for the integer program is a subset of the solution space of the linear
program. We can rewrite this as
m
X
j =1
wj xj OPT:
Suppose there is an element ei such that ei 2= Sj2I Sj . Then for each set
Sj of which ei is a member, we have xj < 1=f . So
X
xj < f1 jfj : ei 2 Sj gj
j ei 2Sj
1;
since jfj : ei 2 Sj gj f . But this violates the linear programming constraint for ei.
Proof:
1-5
X
j 2I
wj
n
X
j =1
= f
wj (f xj )
X
j
wj xj
f OPT:
The rst inequality follows since j 2 I only if xj f 1.
Now we consider a second rounding technique. If you are unfamiliar with duals,
the course handouts should help.
Another way to use the rounding method is to apply it to the dual solution. The dual
of the linear programming relaxation for set cover is:
X
Max
yi
i
subject to: X
yi wj
8Sj
i:ei 2Sj
yi 0
8ei 2 E:
by weak duality. Taking advantage of the fact that nding a dual solution is just
as easy as nding a primal solution, we present the following algorithm. This time,
we take all sets whose corresponding dual inequality is tight; that is, it is met with
equality. We let our solution I 0 be
X
I 0 = fj j
yi = wj g:
i;ei 2Sj
X
yi < wj ;
i:ei 2Sj
1-6
so we can increase yi by some positive amount and remain feasible, which contradicts
the optimality of y. Just to make the positive amount explicit, it's given by
= j min
fw
ei 2Sj j
:
k:ek 2Sj
ykg
j 2I
wj =
X X
yi
j 2I i:ei 2Sj
0
X
=
yi jfj 2 I 0 : ei 2 Sj gj
i
X
f yi
i
f OPT:
The following algorithm behaves much like Dual rounding above, except that it constructs its own dual solution, rather than nding the optimal dual LP solution. The
motivation for this is that we only needed three facts in our above analysis. We
needed that y was feasible, that every set included in our solution corresponded to
a tight dual constraint, and that our solution was a set cover.
In fact, Lemma 5 gives us exactly the idea we need on how to construct a dual
solution. Let I 0 contain all the indices of the sets whose dual inequality is currently
tight. Then the lemma shows that if I 0 is not a set cover, there is a way to improve
the overall value of the dual solution, and create a new tight constraint for some set
that contains an item not currently covered.
1-7
We formalize the algorithm below. In the following algorithm, let y~ represent the
dual solution that we iteratively construct. During the entire algorithm, we maintain
that y~ is a dual feasible solution.
Primal-Dual
I ;
y~i 0 8i
while 9ek : ek 2= Sj2I Snj
o
l = arg minPj ek 2Sj wj Pi ei2Sj y~i
l wl i ei2Sl y~i
y~k y~k + l
I I [ flg.
Note that the function arg min returns the argument (index, in this case) that
minimizes the expression. It is not hard to give this algorithm in words: at each
step, we look for an element ek that is not covered. For that element, we consider
all the sets that include the element ek , and their corresponding dual constraints.
Whichever dual constraint is closest to being tight, we increase the dual variable yk
until the constraint is tight (satises the inequality as an equality) and include the
same set (corresponding to the dual constraint) in our set cover. Now the analysis is
nearly identical to that for Dual-Rounding.
:
i:ei 2Sj
y~i = 0 wj 8j
For the inductive step, assume that upon entering an iteration of the while loop
we have
X
y~i wj 8j
i:ei 2Sj
The only dual variable value changed by the while loop is y~k , so the inequalities for
Sj where ek 2= Sj are unaected. If ek 2 Sj , then by our choice of l
X
X
X
y~i + l =
y~i + (wl
y~i)
i:ei 2Sj
i:ei 2Sj
y~i + (wj
i e 2S
wj :
: i
1-8
i:ei 2Sl
i:ei 2Sj
y~i)
The rest of the proof is essentially the same as Theorem 6 in the case of dual
rounding.
Proof:
X
j 2I
wj =
X X
y~i
j 2I i:ei 2Sj
n
X
y~ijfj : ei 2 Sj gj
i=1
X
f y~i
i
f OPT:
The rst equality follows from Lemma 9. The next inequality follows since each y~i
can appear in the double sum at most jfj : ei 2 Sj gj times. The next inequality
follows by the denition of f , and the last inequality follows from weak duality.
It is worth noting that the observation by Maria Minko no longer holds; since we
are not constructing an optimal dual solution, we cannot apply the complementary
slackness analysis.
So far every technique we have tried has led to the same result: an f -approximation
algorithm for set cover. In the case of set cover, using a natural greedy heuristic
yields an improved approximation algorithm.
The intuition here is straightforward. At each step choose the set that gives
the most \bang for the buck." That is, select the set that minimizes the cost per
additional element covered.
Before examining the algorithm, we dene two more quantities:
Hn 1 + 12 + 13 + : : : + n1 ln n
g max
jSj j:
j
1
although the date is before '82, this algorithm followed Hochbaum's work
1-9
Greedy
I ;
S~j SSj 8j
while j2I Sj 6= E w
l arg minj Sj 6 ; jSjjj
I I [ fl g
y~i jSlwjHl g 8ei 2 S~l (y)
S~j S~j Sl 8j
:~ =
Note: The y step has been added only to aid the proof and is not actually part of
the algorithm.
The last step is simply meant to explain how we update the universe to account
for our previous action. After we include a new set, we subtract out of the universe
all the elements covered by that set. We now make the following shocking claim.
wj = Hg
n
X
i=1
y~i Hg OPT:
The rst equality follows from the observation that when j is added to I ,
wj = Hg
i:ei 2S
~j
y~i
where S~j is the set Sj with all the elements that have been covered in previous steps
removed. This is simply by the denition of the dual variables as they are set in step
(y). The second inequality is just weak duality.
We now need to prove that the solution is dual feasible.
Proof:
i:ei 2Sj
y~i wj
+1
+1
X
i:ei 2Si
y~i =
=
l X
X
y~i
k=1 i:ei 2Ak
l
X
(ak ak+1) Hwaj
g k
k=1
wj Xl ak ak+1
Hg k=1 ak
!
wj Xl 1 + 1 + + 1
Hg k=1 ak ak 1
ak+1 + 1
a1 1
wj X
Hg i=1 i wj :
In the rst line, we simply note that the sum of all the y~i variables is the sum over
all iterations of the yi variables set in a particular iteration. In the second line, we
use our identity for the number of elements in Ak , and we also plug in our bound on
y~i. The rest is just algebraic manipulation.
The following complexity results give a sense of how good our approximation
algorithms are in relation to what is possible.
Theorem 14 (Lund, Yannkakis '92, Feige '96, Raz, Safra '97, Arora, Sudan '97)
Let n = jT j = the size of the ground set. Then:
If there exists a c ln n-approximation algorithm where c < 1 then NP DTIME (nO
1-11
(logk
n) )
There exists some 0 < c < 1 such that if there exists a c log n-approximation
algorithm for set cover, then P = NP .
So even for this extremely simple case we do not know everything there is to know.
1-12