You are on page 1of 10

University of Lahore

Gujrat Campus
Approximation Algorithms
(Chapter-35 Cormen)

Compiled by

Prof. Dr. Ahsan Abdullah

Advance Algo-Fall 2019


1

Background
Heuristic techniques for solving optimization
problems in an approximate way have always been
used throughout the history of computing.

Nevertheless, no precise notion of approximation had


been proposed until the late sixties and early
seventies.

Approximation Algorithms have guaranteed


performance ratio, characterizing those situations in
which the approximate solution is provably close to an
optimum one.

Advance Algo-Fall 2019


2

1
Background
Some problems:

1. Able to devise algorithms that could provide


approximate solutions that were arbitrarily close to
the optimum e.g. HEURISTICS

1(a), in many cases the quality of the approximation


was very poor (allowing, for example, a relative error
of 50%) and it was not clear why?

2. Some problems resisting to any type of solution


and even very weak approximate solutions seemed to
be impervious e.g. DECISION problems

Advance Algo-Fall 2019


3

Definition

An “algorithm” to solve an optimization


problem that runs in polynomial time in the
length of the input and outputs a solution
that is guaranteed to be close to the
optimal solution. "Close" has some well-
defined sense called the performance
guarantee.

Advance Algo-Fall 2019


4

2
Introduction
An algorithm which solves a problem approximately.

Another way to deal with NP-Complete problems.

This is one of the most active areas for research


currently in theoretical computer science.

Can be a heuristic method as well. Required when:

❑ The problem size is too big

❑ Solution becomes computationally expensive

❑ Looking for quick and provable quality solutions


rather than accurate ones.
Advance Algo-Fall 2019
5

Introduction
For an NP-hard problem, an algorithm could be 2 of:

❑ Works on all instances.


❑ In polynomial time.
❑ Is optimal

Here, we drop the third of these, and give


algorithms that do work in polynomial time on
all instances, but which don’t give the optimal
answer.

Advance Algo-Fall 2019


6

3
Introduction
Suppose we have a problem P (likely -hard, though not
necessarily so).

An algorithm for P is an approximation algorithm if for


all instances, it returns a solution whose maximum
“non-optimality” is provable.

(Hard to give a good informal definition. Basic idea: for


all instances, P gives a solution whose value is most a
given factor away from the value of the optimal
solution.)

Advance Algo-Fall 2019


7

Performance
Performance of these algorithms are measured:

❑ By how close to the actual optimum can be reached

❑ By the gain in order (running time).

A -Approximation Algorithm is a polynomial-time


algorithm that always finds a solution of objective
function value within a factor  of optimal;

 is also referred to as the performance guarantee of


the algorithm or competitive ratio. Ideally  is 5%

Advance Algo-Fall 2019


8

4
Performance
s-optimum solution

And approximation algorithms has an absolute


performance guarantee or bounded error ε, if it
has been proven that

Dominance number guarantee: How many solutions for


the problem is not better than the solution provided by
solution of the analyzed approximation algorithm?
Advance Algo-Fall 2019
9

Performance

Global Maximum

<1

>1

Global Minimum

Advance Algo-Fall 2019


10

10

5
Performance?

Most people not impressed by:

❑ Scheme which provably will require less than


twenty times the money that is minimally needed.

❑ An approximation algorithm with the polynomial


running time quite bad, like O(n 2000).

Advance Algo-Fall 2019


11

11

Examples
◼ Vertex Cover
◼ Maximum clique (impossible to approximate to
a constant factor)
◼ Bin Packing (approximated by arbitrary
factor)
Maximum Satisfiability (Does not applies)
◼ Steiner Tree and TSP
◼ Feedback Vertex Set
◼ Shortest Superstring
◼ Knapsack
◼ Euclidean TSP
Advance Algo-Fall 2019
12

12

6
VERTEX-COVER

◼ Instance: an undirected graph G=(V,E).


◼ Problem: to find a set CV of minimal size s.t.
for any (u,v)E, either uC or vC.
Example:

Advance Algo-Fall 2019


13

13

VC Approximation Algorithm

◼ C
◼ E’  E
◼ while E’  
◼ do let (u,v) be an arbitrary edge of E’
◼ C  C  {u,v}
◼ remove from E’ every edge incident
to either u or v.
◼ return C.

Advance Algo-Fall 2019


14

14

7
VC Approximation Algorithm: Demo

Advance Algo-Fall 2019


15

15

VC Approximation Algorithm: Correctness

The set of vertices our algorithm returns is


clearly a vertex-cover, since we iterate until
every edge is covered.

Advance Algo-Fall 2019


16

16

8
VC Approximation Algorithm: Goodness?
Observe the set of edges our algorithm chooses

No mutual vertices!

Advance Algo-Fall 2019


17

17

VC Approximation Algorithm: Goodness?


Thus every VC must contain at least that many vertices

Advance Algo-Fall 2019


18

18

9
VC Approximation Algorithm: Goodness?
Where the size of our VC is only twice as big

Advance Algo-Fall 2019


19

19

VC Approximation Algorithm: How well!!

Upper bound
◼ A little better (w/hard work) : 2-o(1)

Hardness results
◼ Previously: 7/6

◼ Theorem: NP-hard to approximate to within


105-21 = 1.36067… (> 4/3)

◼ Conjecture: NP-hard to within 2-  >0

Advance Algo-Fall 2019


20

20

10

You might also like