Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design Techniques for Approximation Algorithms and Approximation Classes.

Similar presentations


Presentation on theme: "Design Techniques for Approximation Algorithms and Approximation Classes."— Presentation transcript:

1 Design Techniques for Approximation Algorithms and Approximation Classes

2 Summary -Sequential algorithms -Greedy technique -Local search technique -Linear programming based algorithms -Relaxation and rounding -Primal-dual -Dynamic programming -Approximation classes -The NPO world

3 Performance ratio -Given an optimization problem P, an instance x and a feasible solution y, the performance ratio of y with respect to x is R(x,y) = max(m(x,y)/m*(x), m*(x)/m(x,y)) -An algorithm is said to be an r-approximation algorithm if, for any instance x, returns a solution whose performance ratio is at most r

4 MINIMUM BIN PACKING -INSTANCE: Finite set I of rational numbers {a 1,…,a n } with a i  (0,1] -SOLUTION: Partition {B 1,…,B k } of I into k bins such that the sum of the numbers in each bin is at most 1 -MEASURE: Cardinality of the partition, i.e., k

5 Sequential algorithm -Polynomial-time 2-approximation algorithm for MINIMUM BIN PACKING -Next Fit algorithm begin for each number a if a fits into the last open bin then assign a to this bin else open new bin and assign a to this bin return f end.

6 Proof -Number of bins used by the algorithm is at most 2A, where A is the sum of all numbers -For each pair of consecutive bins, the sum of the number included in these two bins is greater than 1 -Each feasible solution uses at least A bins -Best case each bin is full (i.e., the sum of its numbers is 1) -Performance ratio is at most 2 -Theorem: First Fit Decreasing computes solution whose measure is at most 1.5m*(x)+1

7 Tightness -Let I={1/2,1/2n,1/2,1/2n,…,1/2,1/2n} contain 4n items

8 Gavril’s algorithm for vertex cover -Theorem: Gavril’s algorithm is a polynomial-time 2- approximation algorithm begin U=ø; for any edge (u,v) do if (u is not in U) and (v is not in U) then insert u and v in U; return U end.

9 MINIMUM GRAPH COLORING -INSTANCE: Graph G=(V,E) -SOLUTION: A coloring of V, that is, function f such that, for any edge (u,v), f(u)  f(v) -MEASURE: Number of colors, i.e., cardinality of the range of f

10 Sequential algorithm: bad -Sequential algorithm for MINIMUM GRAPH COLORING begin order V with respect to the degree; for each node v do if there exists color not used by neighbors of v then assign this color to v else create new color and assign it to v end.

11 Example The performance ratio is 2 Generalizing, the performance ratio is n/2, where n is the number of nodes

12 Greedy technique: good -Polynomial-time 2-approximation algorithm for MAXIMUM SAT begin for any variable v begin p := number of clauses, which contain v; n := number of clauses, which contain not v; if p  n then f(v) := TRUE else f(v) := FALSE; simplify the formula; end; return f end.

13 Proof -By induction on the number n of variables, we prove that the algorithm satisfies at least half of the m clauses -n=1: trivial -Inductive step. Let v be the first variable to which a value has been assigned. Assume p  n (that is, f(v)=TRUE). By induction hypothesis at least p+(m-p-n)/2  m/2 clauses are satisfied

14 MAXIMUM INDEPENDENT SET -INSTANCE: Graph G=(V,E) -SOLUTION: A subset V’ of V such that, for any edge (u,v), either u is not in V’ or v is not in V’ -MEASURE: Cardinality of V’

15 Greedy technique: bad -Greedy algorithm for MAXIMUM INDEPENDENT SET begin V’:=ø; U:=V; while U is not empty do begin x := vertex of minimum degree in graph induced by U; insert x in V’; eliminate x and all its neighbors from U end; return V’ end.

16 Example The performance ratio is 2 Generalizing, the performance ratio is n/4, where n is the number of nodes

17 MAXIMUM CUT -INSTANCE: Graph G=(V,E) -SOLUTION: Partition of V into disjoint sets V 1 and V 2 -MEASURE: Cardinality of the cut, i.e., the number of edges with one endpoint in V 1 and one endpoint in V 2

18 Local search technique -Polynomial-time 2-approximation algorithm for MAXIMUM CUT begin V 1 :=ø; repeat if exchanging one node between V 1 and V 2 =V- V 1 improves the cut then perform the exchange; until a local optimum is reached; return f end.

19 Proof -We prove that any local optimum contains at least half of the m edges -Notation: -c= # of edges of the cut -i= # of edges inside V 1 -o= # of edges outside V 1 -m=c+i+o, that is, i+o=m-c -For any node v, -i(v)= # of edges between v and a node in V 1 -o(v)= # of edges between v and a node not in V 1

20 Proof (continued) -V 1 is a local optimum: for any v  V 1, i(v)-o(v)  0 and,for any v not in V 1,o(v)-i(v)  0 -Summing over all nodes in V 1, we have 2i-c  0 -Summing over all nodes not in V 1, we have 2o-c  0 -That is, i+o-c  0 -That is, m-2c  0 -That is, c  m/2

21 Relaxation and rounding technique -Polynomial-time 2-approximation algorithm for weighted version of MINIMUM VERTEX COVER -formulate the problem as linear integer programming -solve the relaxation -select nodes that have been chosen enough

22 ILP formulation

23 LP relaxation and rounding -Final solution: U = {i : x(i)  0.5}

24 Proof -The solution is feasible -Otherwise, one edge (i,j) is not filled (that is, x(i)+x(j)<1) -The solution has measure at most twice the optimum of LP relaxation -Each variable is at most doubled -The optimum of LP relaxationis at most equal to that of ILP -The set of feasible solutions is larger

25 Primal-dual technique -Classical approach for solving exactly combinatorial optimization problems -Weighted combinatorial problems are reduced to purely combinatorial, unweighted problems -Examples: Dijkstra (shortest path), Ford and Fulkerson (maximum flow), Edmonds (maximum matching) -Polynomial-time 2-approximation algorithm for weighted version of MINIMUM VERTEX COVER

26 LP formulation

27 Dual problem where N(i) denotes the neighborhood of i

28 begin y=0; U=Ø; while a not covered edge (i,j) exists increase y(i,j) until either i or j is filled if i (resp. j) is filled then put i (resp. j) in U end. 2-approximation algorithm -Simultaneously maintains a (possibly unfeasible) integer solution of LP formulation and a (not necessarily optimal) feasible solution of dual problem -At each step integer solution becomes more feasible and dual solution has better measure -Ends when integer solution becomes feasible

29 Proof -Feasibility: trivial -Performance ratio: -For any i  U, the ith constraint is tight. -Sum C of the weights of the nodes in U is equal to the sum P of the profit of the incident edges -P is at most twice the sum of the profit of all edges which is at most equal to the maximum profit -By duality, maximum profit is equal to minimum weight -Time complexity: -At most n iterations, where n is the number of nodes

30 MINIMUM PARTITION -INSTANCE: Finite set X of items, for each x i  X a positive integer weight a i -SOLUTION: A partition of X into disjoint sets Y 1 and Y 2 -MEASURE: Maximum between the sum of the weights of elements in V 1 and the sum of the weights of elements in V 2

31 Dynamic programming technique -Pseudo-polynomial time algorithm for MINIMUM PARTITION: -T: n x b-matrix (b=sum of the weights of all n elements) -T(i,j)=TRUE if a subset of {a 1,...,a i } exists whose sum is j -Construction of T: T(i+1,j)=T(i,j) or T(i,j-a i +1) -Final answer to the evaluation problem: -select true element of nth row of T that minimizes max(j,b-j) -Complexity: O(nb)=O(n 2 a max ), where a max is the maximum weight -Can be modified to obtain a feasible solution

32 The approximation algorithm -Ignore the last t digits of the numbers -Apply the pseudo-polynomial time algorithm -Return the corresponding solution in the original instance

33 Proof -Performance ratio: -m(x,y*(x’))-m*(x)  10 t n where y*(x’) denotes an optimal solution for scaled instance x’ -Performance ratio is at most 1+10 t n/m*(x) -m*(x)  a max -For any r, if we choose t=log 10 (a max (r-1) /n), then the performance ratio is at most r -Time complexity: -O(n 2 a’ max ) = O(n 3 /(r-1))

34 Class APX -NPO problems P that admit a polynomial-time r– approximation algorithm, for given constant r  1 -P is said to be r-approximable -Examples: MINIMUM BIN PACKING, MAXIMUM SAT, MAXIMUM CUT, MINIMUM VERTEX COVER

35 Class PTAS -NPO problems P that admit a polynomial-time r– approximation algorithm, for any r > 1 -Time must be polynomial in the length of the instance but not necessarily in 1/(r-1) -Time complexity O(n 1/(r-1) ) or O(2 1/(r-1) n 3 ) -P is said to admit a polynomial-time approximation scheme -Example: MINIMUM PARTITION

36 The NPO world NPO APX MINIMUM BIN PACKING MAXIMUM SAT MAXIMUM CUT MINIMUM VERTEX COVER PTAS MINIMUM PARTITION PO MINIMUM PATH


Download ppt "Design Techniques for Approximation Algorithms and Approximation Classes."

Similar presentations


Ads by Google