















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!
















Sometimes it is sufficient to find an approximate solution Definition The relative error of a solution y (with respect to an instance x) is |OPT(x) − m(x, y)| OPT(x)
In a maximisation problem m(x, y) is always not greater than OPT(x), so the relative error lies between 0 and 1 In a minimisation problem the relative error can be arbitrarily large.
To investigate the approximability of TRAVELLING SALESMAN (O) Instance : A finite set of cities {c 1 , c 2 ,... , cn}, a positive integer distance d(i, j) between each pair {ci , cj } Goal : Find a permutation π of { 1 , · · · , n} that minimises ( ∑n− 1 i= 1 d(π(i), π(i^ +^1 )) +^ d(π(n), π(^1 )). we consider the gap version of the problem: gap-TSP[ρ] Instance : A finite set of cities {c 1 , c 2 ,... , cn}, a positive integer distance d(i, j) between each pair {ci , cj } Goal : To distinguish between YES There exists a tour of the cities of distance at most n NO The distance of every tour is more than ρn
An algorithm for gap-TSP[ρ] returns either Yes or No — for instances with minimum distance tours of at most n it must return Yes. — for instances with minimum distance tours of more than ρn it must return No. — for instances with minimum distance tours of more than n and at most ρn, we don’t care what it returns. What do we know if the algorithm returns Yes (or No)?
Theorem gap-TSP[ρ] is NP -hard for any ρ > 1 Proof. Use reduction from HAMILTONIAN CYCLE. Let G = (V , E) be an instance of HAMILTONIAN CYCLE where V = {v 1 ,... , vn}. Let c 1 ,... , cn be an instance of gap-TSP[ρ] where the distance between ci and cj is 1 if (vi , vj ) is an edge in G, and ρn if (vi , vj ) is not an edge in G, and Clearly there is a tour of distance at most n if and only if G has a Hamiltonian cycle; otherwise every tour has length at least ρn. Thus a polynomial algorithm for gap-TSP[ρ] would provide a polynomial algorithm for HAMILTONIAN CYCLE
A generic [A, B]-gap version of a maximisation problem:
Max Problem Instance :... Goal : To distinguish between YES The optimal solution is > B NO The optimal solution is ≤ A
Theorem If the [A, B]-gap version of a maximisation problem is NP -hard, then that problem is NP-hard to approximate within a factor of B/A (that is, with relative error of less than 1 − A/B).
We must show that if we have an algorithm that can approximate within a factor of B/A, then we can use it to the solve the [A, B]-gap version of the problem. Let APPROX be such an algorithm. On instance x, it outputs m(x) where OPT (x)/m(x) ≤ B/A. To use APPROX on the gap version for instance x: — If m(x) > A return YES — Otherwise return NO Does this give the correct answer? — If OPT (x) > B, then m(x) ≥ OPT (x).A/B > BA/B = A and we answer YES as required. — If OPT (x) ≤ A, then m(x) ≤ OPT (x) ≤ A and we answer NO as required.
We must show that if we have an algorithm that can approximate within a factor of B/A, then we can use it to the solve the [A, B]-gap version of the problem. Let APPROX be such an algorithm. On instance x, it outputs m(x) where OPT (x)/m(x) ≤ B/A. To use APPROX on the gap version for instance x: — If m(x) > A return YES — Otherwise return NO Does this give the correct answer? — If OPT (x) > B, then m(x) ≥ OPT (x).A/B > BA/B = A and we answer YES as required. — If OPT (x) ≤ A, then m(x) ≤ OPT (x) ≤ A and we answer NO as required.
We showed decision problems were NP-hard by reductions from SAT. We want to prove gap problems are NP-hard. So why don’t we prove one problem is NP-hard and then reduce from it. We need a first problem, and we need to describe how to construct reductions involving gap problems.
We showed decision problems were NP-hard by reductions from SAT. We want to prove gap problems are NP-hard. So why don’t we prove one problem is NP-hard and then reduce from it. We need a first problem, and we need to describe how to construct reductions involving gap problems.
gap-3SAT[] Instance : A CNF formula f Goal : To distinguish between YES There exists an assignment that satisfies all clauses NO No assignment can satisfy more than 7/ 8 + of the clauses
Theorem For any > 0 , gap-3SAT[] is NP-hard.
gap-3SAT[] Instance : A CNF formula f Goal : To distinguish between YES There exists an assignment that satisfies all clauses NO No assignment can satisfy more than 7/ 8 + of the clauses
Theorem For any > 0 , gap-3SAT[] is NP-hard.
Are the reductions we used for decision problems gap-preserving? Let’s revisit the reduction of CLIQUE from SAT (see Lecture 6). — Given a formula f with clauses C 1 , C 2 ,... , Ck I (^) For each literal x in clause Cj create a vertex I (^) Put an edge between every pair of vertices from distinct clauses, unless they are incompatible (i.e. x and ¬x)