Computability and Complexity 24 1 Approximation Computability and
Computability and Complexity 24 -1 Approximation Computability and Complexity Andrei Bulatov
Computability and Complexity 24 -2 Optimization Problems In an optimization problem, for every possible instance x we have • a set S(x) of feasible solutions • for every solution y S(x), we have a positive goodness m(x • optimization parameter opt {min, max} To solve an optimization problem we must find for any given x I, a solution y S(x) such that The optimal value will be denoted OPT(x)
Computability and Complexity 24 -3 Relative Error Sometimes it is sufficient to find an approximate solution Definition The relative error of a solution y (with respect to an instance x) is • In a maximization problem m(x, y) is always smaller than OPT( so the relative error lies between 0 and 1 • In a minimization problem the relative error can be arbitrarily lar
Computability and Complexity Approximation Algorithms Definition An algorithm A is an -approximating algorithm for an optimization problem if, for any instance x, A computes a feasible solution with relative error less than in a time which is polynomial in |x| Definition A problem is approximable if it has an approximating algorithm for some 24 -4
Computability and Complexity Example Consider the following naive algorithm for solving Minimal Vertex Cover on the graph (V, E) • Set M = • While E do - Pick any edge e and add both endpoints to M - Remove e from E, and also remove all incident edges from E Is this an -approximating algorithm? 24 -5
Computability and Complexity 24 -6 The naive algorithm is a 1 -approximating algorithm for Minimal Vertex Cover • The cover chosen contains disjoint edges • Hence any cover must contain at least • Hence the relative error is at most 1 vertices Surprisingly, this is the best approximation algorithm possible!
Computability and Complexity 24 -7 Example Consider the following greedy algorithm for solving Minimal Vertex Cover on the graph (V, E) • Set M = • While E do - Pick a vertex with the highest degree and add it to M - Remove this vertex from V, and also remove all inciden edges from E Is this an -approximating algorithm?
Computability and Complexity Max-SAT Instance: A formula in CNF. Objective: Find an assignment for that satisfies the maximal number of clauses Theorem There is a 1/2 -approximating algorithm for Max. SAT 24 -8
Computability and Complexity 24 -9 Satisfying Clauses We present an algorithm which, given a formula , computes a solution with relative error at most where k is the minimal number of literals in a clause of Let and has literals The probability that a random assignment to the variables of satisfies is Therefore, the expected number of clauses satisfied by a random as
Computability and Complexity In a similar way we can compute It follows from Probability Theory that Therefore 24 -10 and
Computability and Complexity 24 -11 Algorithm Given CNF , let • for i = 1 to n do • compute • if set • otherwise set • be variables in return the assignment and then
Computability and Complexity Analysis The algorithm builds a sequence of formulas such that Consider formula therefore . It contains no variables, is the number of satisfied clauses Compute the relative error. Since OPT( ) n 24 -12
- Slides: 12