Complexity 15 1 Approximation Complexity Andrei Bulatov Complexity

Complexity 15 -1 Approximation Complexity Andrei Bulatov

Complexity 15 -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 a positive goodness m(x, y) • 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)

Complexity 15 -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

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 15 -4

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? 15 -5

Complexity 15 -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!

Complexity 15 -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?

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 15 -8

Complexity 15 -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

Complexity In a similar way we can compute It follows from Probability Theory that Therefore 15 -10 and

Complexity 15 -11 Algorithm Given CNF , let • for i = 1 to m do • compute • if set • otherwise set • be variables in return the assignment and then

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 15 -12
- Slides: 12