Approximation Algorithm
Approximation Algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential time in the worst case. It is too time-consuming. To reduce the time required for solving a problem, we can relax the problem, and obtain a feasible solution “close” to an optimal solution One compromise is to use heuristic solutions.
Approximation ratio bound
(1+)-approximation algorithm
Vertex Cover Problem Let G=(V, E). The subset S of V that meets every edge of E is called the vertex cover. The Vertex Cover problem is to find a vertex cover of minimum size. It is the optimization version of an NP-Complete decision problem.
Examples of vertex cover
C*: optimal solution C: approximate solution No two edges in A share a common endpoint due to step 6.
Bin Packing Problem Given n items a1, a2, …, an, 0 ai 1 for 1 i n, which have to be placed in bins of unit capability, the bin packing problem is to determine the minimum number of bins to accommodate all items. If we regard the items of different sizes to be the lengths of time of executing different jobs on a standard processor, the problem becomes to use minimum number of processors which can finish all of the jobs within a fixed time.
Example of Bin Packing Problem E.g. Given n = 5, {0.3, 0.5, 0.8, 0.2 0.4}, the optimal solution is 3 bins. The bin packing problem is NP-hard.
An approximation algorithm for the bin packing problem An approximation algorithm: (first-fit) place ai into the lowest-indexed bin which can accommodate ai. S(ai): the size of ai OPT(I): the size of an optimal solution of an instance I FF(I): the size of bins in the first-fit algorithm C(Bi): the sum of the sizes of aj’s packed in bin Bi in the first-fit algorithm
An approximation algorithm for the bin packing problem Problem Instance I OPT(I) , ceiling of sum of sizes of all items C(Bi) + C(Bi+1) 1 (a)(Otherwise, the items in Bi+1 will be put in Bi.) C(B1) + C(Bm) 1 (b)(Otherwise, the items in Bm will be put in B1. ) For m nonempty bins, C(B1)+C(B2)+…+C(Bm)m/2, (a)+(b)for i=1,..,m FF(I) = m < 2 = 2 2 OPT(I) FF(I) < 2 OPT(I) C(Bi): the sum of sizes of aj’s packed in bin Bi