Approximation slides Slides on Approximation algorithms, part : Basic approximation algorithms Guy Kortsarz
Approximation slides Finding a lower bound; the TSP example The optimum TSP cycle P is an edge plus a spanning tree. Thus, the minimum cost spanning tree T has cost c(t ) c(p ) We use the idea of shortcuts If we are given a (not necessarily simple) a to b path P, replacing the path P by (a,b) can not increase the cost (because of triangle inequality). Claim: Given an Euler cycle (a cycle that crosses all edges once) of cost c there exists a TSP path of cost at most c Pf: Shortcut
Approximation slides 3 TSP, Cont. Getting an Euler cycle: double every edge in MST T Gives an Euler cycle (all degrees are even) T * a 4 a 4 b 3 c 4 d b 3 3 c d e f e f c a b a c d c f c e c c a b d f e
Approximation slides 4 Steiner tree Input: A graph G(V,E) a weight function w : E + and a subset S V of terminals Required: A subtree T of G that contains all of S and has minimum cost It is easy to see that we may assume that w is complete: add/replace e = (u,v) by the cost of the shortest u to v path. If an edge (u,v) is used and does not belong to G replace it by the edges of the shortest path. The cost does not increase. Thus, if we restrict ourself to G(S) spanned by S and find a minimum spanning tree on G(S) a ratio approximation results. The reason: The Euler path that result the optimum (by doubling edges) can first be shortcut to contain S vertices only and then shortcut to an Hamiltonian path which in particular is some spanning tree
Approximation slides 5 Improving the ratio to 3/ Idea due to Christophedes Any TSP solution is a Hamilton path; A simple path that contains all vertices. Any TSP tour of even length decomposes into two perfect matchings
Approximation slides 6. Find MST T(V,E ) The algorithm. Let X V be the vertices of odd degree in T 3. Compute the graph G X = (X,X X). Find a minimum cost perfect matching M in G X 4. Find an Euler cycle in T M 5. Shortcut Analysis: First, shortcut the tour to X Let M,M be the two perfect matchings of P on X c(p) = c(m )+C(M ) c(m) Thus c(t M) 3opt/ Hence 3/ ratio
Approximation slides 7 Finding lower bound: The Unweighted vertex-cover example Figure : VC M The size of any matching lower bounds the minimum VC A maximal matching gives a size M vertex-cover Hence, ratio.
Approximation slides 8 A lower bound is not always required: certificate of failure Say that for input I we want to find a feasible solution minimizing some integral function µ(i). Let opt be opt = mini µ(i). For an integer x say that we have a procedure P(I,x) that has one of the following inputs:. Either it determines that x < opt and then returns F alse. Or, it returns a solution S(I) False of cost at most µ(i) ρ x P(I, x) called a certificate of failure procedure (Hochbaum and Shmoys). Claim: The above procedure can be used as an oracle to produce a ρ approximation algorithm.
Approximation slides 9 Binary search Assume the costs are integral. lb min, ub max /* lb,ub some lower and upper bounds over minimum and maximum possible value of µ(i) */. 3. While max min > do (a) x (lb+up)/ (b) If P(I,lb) is false, then lb x (c) Else, ub x 4. Return ub Since opt > lb and opt integer, opt ub. So, ρ ratio
Approximation slides 0 Running time Claim: If, P(I,x) is polynomial in I and ub lb always O(exp( I )) then polynomial We now use this to give ratio approximation for the k center problem The input a complete graph on the vertices {,...,n}. A bound k on the number of centers. Every i,j have distance d ij. We assume the triangle inequality (otherwise, no approximation possible).
Approximation slides A approximation for undirected k center The algorithm. It is a certificate of failure algorithm with (I,x). Due to Hochbaum and Shmoys.. S. V V 3. While S is not a legal solution, do (a) Add to S and arbitrary vertex i V (b) Delete from V all vertices j so that l ij x 4. If S > k return False 5. Else, return S
Approximation slides The two properties x x x x Figure : An illustration of the algorithm in the special case of points in the plane. The distance between any two centers is more than x All centers have pairwise distance larger than x. Consider our centers that are non-centers in OPT
Approximation slides 3 Analysis cont. Let j and p be two centers in our algoritm but not in OPT If q OPT covers both j and p and opt x then by triangle inequality: d j,p d j,q +d p,q x. This is a contradiction. If j e.g. computed before p then p is removed So, since S > k the optimum would have more than k, contradiction. Thus S > k implies that there could not be a k subset that covers all of S. In other words, x < opt. This proves that the failure certificate is correct. Remark: It can be that x < opt but the procedure succeeds
Approximation slides 4 The two properties. Continued If returns a solution then by construction the solution has radios x. Hence ρ = We can use binary search, as opt max distance. Thus, approximation Also better than is as hard as solving: The dominating set problem: Input: G(V,E) and k Question: Is there a dominating set of size at most k, namely, a subset U V, U k so that U N(U) = V? This problem is NPC.
Approximation slides 5 Why a ratio better than is not possible Give edges of G length and non-edges in V V \E length This implies the triangle inequality holds There is a dominating set of size k if and only if there is a k center solution of size k Approximating within ǫ implies in the case of a yes instance an optimal solution... Figure 3: Edges are given length. Non-edges are gives length. Not all non-edges are shown