prev

next

of 36

View

221Download

1

Embed Size (px)

Design Techniques for Approximation Algorithmsand Approximation Classes

SummarySequential algorithmsGreedy techniqueLocal search techniqueLinear programming based algorithmsRelaxation and roundingPrimal-dualDynamic programmingApproximation classesThe NPO world

Performance ratioGiven 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

MINIMUM BIN PACKINGINSTANCE: Finite set I of rational numbers {a1,,an} with ai (0,1] SOLUTION: Partition {B1,,Bk} 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

Sequential algorithmPolynomial-time 2-approximation algorithm for MINIMUM BIN PACKINGNext Fit algorithmbegin for each number aif a fits into the last open bin then assign a to this binelse open new bin and assign a to this binreturn fend.

ProofNumber of bins used by the algorithm is at most 2A, where A is the sum of all numbersFor each pair of consecutive bins, the sum of the number included in these two bins is greater than 1Each feasible solution uses at least A binsBest 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

TightnessLet I={1/2,1/2n,1/2,1/2n,,1/2,1/2n} contain 4n items

Gavrils algorithm for vertex cover

Theorem: Gavrils algorithm is a polynomial-time 2-approximation algorithmbegin U=;for any edge (u,v) doif (u is not in U) and (v is not in U) theninsert u and v in U;return Uend.

MINIMUM GRAPH COLORINGINSTANCE: 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

Sequential algorithm: badSequential algorithm for MINIMUM GRAPH COLORINGbegin order V with respect to the degree; for each node v doif there exists color not used by neighbors of v then assign this color to velse create new color and assign it to vend.

ExampleThe performance ratio is 2

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

Greedy technique: goodPolynomial-time 2-approximation algorithm for MAXIMUM SATbegin for any variable v beginp := 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 fend.

ProofBy induction on the number n of variables, we prove that the algorithm satisfies at least half of the m clausesn=1: trivialInductive 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

MAXIMUM INDEPENDENT SETINSTANCE: 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

Greedy technique: badGreedy algorithm for MAXIMUM INDEPENDENT SETbegin V:=; U:=V; while U is not empty dobeginx := vertex of minimum degree in graph induced by U;insert x in V;eliminate x and all its neighbors from Uend;return Vend.

ExampleThe performance ratio is 2

Generalizing, the performance ratio is n/4, where n is the number of nodes

MAXIMUM CUTINSTANCE: Graph G=(V,E) SOLUTION: Partition of V into disjoint sets V1 and V2 MEASURE: Cardinality of the cut, i.e., the number of edges with one endpoint in V1 and one endpoint in V2

Local search techniquePolynomial-time 2-approximation algorithm for MAXIMUM CUTbeginV1:=; repeatif exchanging one node between V1 and V2 =V- V1 improves the cut thenperform the exchange;until a local optimum is reached;return fend.

ProofWe prove that any local optimum contains at least half of the m edgesNotation:c= # of edges of the cuti= # of edges inside V1o= # of edges outside V1m=c+i+o, that is, i+o=m-cFor any node v, i(v)= # of edges between v and a node in V1o(v)= # of edges between v and a node not in V1

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

Relaxation and rounding techniquePolynomial-time 2-approximation algorithm for weighted version of MINIMUM VERTEX COVER

formulate the problem as linear integer programmingsolve the relaxationselect nodes that have been chosen enough

ILP formulation

LP relaxation and roundingFinal solution: U = {i : x(i) 0.5}

- ProofThe solution is feasibleOtherwise, one edge (i,j) is not filled (that is, x(i)+x(j)
Primal-dual techniqueClassical approach for solving exactly combinatorial optimization problemsWeighted combinatorial problems are reduced to purely combinatorial, unweighted problemsExamples: Dijkstra (shortest path), Ford and Fulkerson (maximum flow), Edmonds (maximum matching)Polynomial-time 2-approximation algorithm for weighted version of MINIMUM VERTEX COVER

LP formulation

Dual problemwhere N(i) denotes the neighborhood of i

2-approximation algorithmSimultaneously maintains a (possibly unfeasible) integer solution of LP formulation and a (not necessarily optimal) feasible solution of dual problemAt each step integer solution becomes more feasible and dual solution has better measureEnds when integer solution becomes feasiblebeginy=0; U=;while a not covered edge (i,j) existsincrease y(i,j) until either i or j is filledif i (resp. j) is filled then put i (resp. j) in U end.

ProofFeasibility: trivialPerformance 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 edgesP is at most twice the sum of the profit of all edges which is at most equal to the maximum profitBy duality, maximum profit is equal to minimum weightTime complexity:At most n iterations, where n is the number of nodes

MINIMUM PARTITIONINSTANCE: Finite set X of items, for each xi X a positive integer weight ai SOLUTION: A partition of X into disjoint sets Y1 and Y2 MEASURE: Maximum between the sum of the weights of elements in V1 and the sum of the weights of elements in V2

Dynamic programming techniquePseudo-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 {a1,...,ai} exists whose sum is jConstruction of T: T(i+1,j)=T(i,j) or T(i,j-ai+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(n2amax), where amax is the maximum weightCan be modified to obtain a feasible solution

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

ProofPerformance ratio: m(x,y*(x))-m*(x) 10tn where y*(x) denotes an optimal solution for scaled instance xPerformance ratio is at most 1+10tn/m*(x)m*(x) amaxFor any r, if we choose t=log10(amax(r-1) /n), then the performance ratio is at most rTime complexity:O(n2amax) = O(n3/(r-1))

Class APXNPO problems P that admit a polynomial-time rapproximation algorithm, for given constant r 1P is said to be r-approximable

Examples: MINIMUM BIN PACKING, MAXIMUM SAT, MAXIMUM CUT, MINIMUM VERTEX COVER

Class PTASNPO problems P that admit a polynomial-time rapproximation algorithm, for any r > 1Time must be polynomial in the length of the instance but not necessarily in 1/(r-1)Time complexity O(n1/(r-1)) or O(21/(r-1)n3)P is said to admit a polynomial-time approximation scheme

Example: MINIMUM PARTITION

The NPO worldNPOAPXMINIMUM BIN PACKINGMAXIMUM SATMAXIMUM CUTMINIMUM VERTEX COVERPTASMINIMUM PARTITIONPOMINIMUM PATH