


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



UC Berkeley—CS 170: Efficient Algorithms and Intractable Problems Handout 24 Lecturer: Satish Rao December 2, 2003
What does it mean to approximate the solution of an NP-complete problem, when we have so far been considering only questions with yes/no answers? Actually, many of the problems we have looked at are most naturally stated as optimization problems, which we can approximate. For example, in TSP the yes/no question is whether there is a cycle visiting each node once of length at most K; the optimization problem is to find the shortest cycle; and the approximation problem is to find a short cycle, i.e., one whose length is as short as one can afford to compute. Similarly, for Vertex Cover the yes/no question is whether there is subset of vertices touching each edge, of cardinality at most k; the optimization problem is to find the vertex cover with the fewest vertices; and the approximation problem is to find a vertex cover with few vertices, i.e., one whose cardinality is as small as one can afford to compute. To measure how good an approximation we compute, we need a measure of error. Suppose c > 0 is an approximation to the exact value c∗^ > 0. (For Vertex Cover, c is the size of a vertex cover found by an approximate algorithm, and c∗^ is the true minimum vertex cover size.) Then the ratio bound (or performance ratio or approximation ratio) of c is ρ where
max
{ c c∗^
c∗ c
} ≤ ρ.
Note that ρ ≥ 1, and ρ = 1 exactly when c = c∗. If the size of the problem whose answer is c∗^ is n, we may also write ρ(n) to indicate that the error may depend on n. For example, ρ(n) = 2, means that the computed result c never differs from c∗^ by more than a factor of 2. We will characterize our approximation algorithms by the value of ρ that they guarantee. It turns out that some NP-complete problems let us compute approximations for small ρ in polynomial time, but for other NP-complete problems computing any approximation with bounded ρ is still NP-complete.
Recall that a vertex cover C is a subset C ⊂ V of the set of vertices of a graph G = (V, E) with the property that every edge in E has a vertex in C as an end point. The vertex cover optimization problem is to find the vertex cover of smallest cardinality c∗. It turns out that the following simple greedy algorithm never finds a cover more than twice too large, i.e., c ≤ 2 c∗, or ρ = 2.
C = ∅ // initialize an empty vertex cover for all (u, v) ∈ E if u 6 ∈ C and v 6 ∈ C then C := C ∪ {u, v} return C
The set C can be represented using a Boolean vector of size |V |, so that checking membership in C can be done in constant time. The running time is obviously O(|E|+|V |), since we use O(|V |) time to initialize the representation of C and then we do a constant amount of work for every edge.
Theorem 1 The above algorithm satisfies ρ ≤ 2 , i.e., if C is the cover computed by the algorithm and C∗^ is an optimal cover, then |C| ≤ 2 |C∗|.
Proof: First of all, it should be clear that the algorithm returns a vertex cover. Every time an edge is found that is not covered by the current set C, then both endpoints are added to C, thus guaranteeing that the edge is covered. For the approximation, let M be the set of edges (u, v) such that when (u, v) is considered in the for loop, the vertices u, v are added to C. By construction, |C| = 2|M |. Furthermore, M is a matching, and so each edge of M must be covered by a distinct vertex; even if C∗ is an optimum cover, we must have |C∗| ≥ |M |, and so |C| ≤ 2 |C∗|. 2
Let us now consider another way of achieving an approximation within a factor of 2. Given a graph G = (V, E), write a linear program having a variable xv for each vertex v, and structured as follows:
min
∑ v xv s.t. xu + xv ≥ 1 (for each (u, v) ∈ E) xv ≥ 0 (for each v ∈ V )
Now, let C be a vertex cover, and consider the solution defined by setting xv = 0 if v 6 ∈ C, and xv = 1 if v ∈ C. Then the solution is feasible, because all values are ≥ 0, and each (u, v) is covered by C, so that xu + xv is equal to either one or two (and so is at least one). Furthermore, the cost of the solution is equal to the cardinality of C. This implies that the cost of the optimum of the linear program is at most the cost of an optimum solution for the vertex cover problem. Let’s now solve optimally the linear program, and get the optimal values x∗ v. By the above reasoning,
∑ x x ∗ v ≤^ c ∗. Let us then define a vertex cover C, as follows: a vertex v
belongs to C if and only if x∗ v ≥ 1 /2. We observe that:
∑ v x ∗ v ≤^2 c ∗ (^) where c∗ is the cardinality of an optimum vertex cover.
So, again, we have a 2-approximate algorithm. No algorithm achieving an approximation better than 2 is known. If P 6 =NP, then there is no polynomial time algorithm that achieves an approximation better than 7/6 (proved by H˚astad in 1997).
Finally, take an optimal tour C, and remove an edge from it. Then what we get is a spanning tree, whose cost must be at least cost(T ). Therefore, the cost the optimal tour is at least the cost of the minimum spanning tree; our algorithm finds a tour of cost at most twice the cost of the minimum spanning tree and so the solution is 2-approximate. This algorithm has never been published and is of uncertain attribution. An algorithm achieving a 3/2-approximation was published in 1976, based on similar principles. There has been no improvement since then, but there are reasons to believe that a 4/3-approximation is possible. In 2000 it has been shown that, if P 6 =NP, then there is no polynomial time algorithm achieving an approximation of about 1.01 for metric TSP. If points are in the plane, and the distance is the standard geometric distance, then any approximation ratio bigger than one can be achieved in polynomial time (the algorithm is by Arora, 1996). This remains true even in geometries with more than two dimensions, but not if the number of dimensions grows at least logarithmically with the number of cities.
H˚astad proved in 1996 that there can be no algorithm for Max Clique achieving an approx- imation ratio ρ(n) = n.^99 , unless NP has polynomial time probabilistic algorithms (which is almost but not quite the same as P=NP). In fact, any constant smaller than one can be replaced in the exponent, and the result is still true. Notice that the algorithm that returns a single vertex is an n-approximation: a vertex is certainly a clique of size 1, and no clique can be bigger than n. We will see a (n/ log n)-approximation. In light of H˚astad’s result we cannot hope for much more.^2 Given a graph G = (V, E), the algorithm divides the set of vertices in k = n/logn blocks B 1 ,... , Bk, each block containing log n vertices. (It’s not important how the blocks are chosen, as long as they all have size log n.) Then, for each block Bi, the algorithm finds the largest subset Ki ⊆ Bi that is a clique in G. This can be done in time O(n(log n)^2 ) time, because there are n possible subset, and checking that a set is a clique can be done in quadratic time (in the size of the set). Finally, the algorithm returns the largest of the cliques found in this way. Let K∗^ be the largest clique in the graph. Clearly, there must be one block Bi that contains at least |K∗|/k vertices of K∗, and when the algorithm considers Bi it will find a clique with at least |K∗|/k vertices. Possibly, the algorithm might find a bigger clique in other blocks. In any case, the size of the clique given in output by the algorithm is at least 1 /k = log n/n times the size of K∗.
(^2) There is reason to believe that the right result is that a n/ 2 √log n-approximation is possible in polynomial time, but not better. So far, the best known approximation algorithm has roughly ρ(n) = n/(log n)^2 , while a result by Khot shows that, under strong assumption, ρ(n) = n/ 2 (log^ n)^1 −o(1) is not achievable in polynomial time.