0% found this document useful (0 votes)
15 views8 pages

Approximate Algorithms

Approximation algorithms are used to tackle NP-completeness in optimization problems by providing solutions that are close to optimal within polynomial time. These algorithms are classified based on their approximation ratios, with k-approximation algorithms providing solutions within a factor of k of the optimal. Key types include absolute and relative approximations, as well as polynomial-time and fully polynomial-time approximation schemes (PTAS and FPTAS).

Uploaded by

ROHIT DADHWAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views8 pages

Approximate Algorithms

Approximation algorithms are used to tackle NP-completeness in optimization problems by providing solutions that are close to optimal within polynomial time. These algorithms are classified based on their approximation ratios, with k-approximation algorithms providing solutions within a factor of k of the optimal. Key types include absolute and relative approximations, as well as polynomial-time and fully polynomial-time approximation schemes (PTAS and FPTAS).

Uploaded by

ROHIT DADHWAL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Approximation Algorithms

Problems in Deterministic Algorithm

Given a computational problem, it may be difficult to formulate an algorithm with good

running time, or the exploitation of the running time of an algorithm for that problem with the
number of inputs.

Remedies

 Efficient heuristics,
 Approximation algorithms,
 Randomized algorithms

An Approximate Algorithm is a way of approaching NP-COMPLETENESS for the


optimization problem. This technique does not guarantee the best solution. The goal of an
approximation algorithm is to come as close as possible to the optimum value in a reasonable
amount of time which is at the most polynomial time. Such algorithms are called approximation
algorithms or heuristic algorithms.

An approximation algorithm returns a solution to a combinatorial optimization problem that is


probably close to optimal (as opposed to a heuristic that may or may not find a good solution).
Approximation algorithms are typically used when finding an optimal solution is intractable, but
can also be used in some situations where a near-optimal solution can be found quickly and an
exact solution is not needed.

o For the travelling salesperson problem, the optimization problem is to find the shortest
cycle, and the approximation problem is to find a short cycle.
o For the vertex cover problem, the optimization problem is to find the vertex cover with
the fewest vertices, and the approximation problem is to find the vertex cover with few
vertices.

The quality of an approximation

In any combinatorial optimization problem, there is some objective function we are supposed to
optimize. The approximation ratio (or approximation factor) of an algorithm is the ratio
between the result obtained by the algorithm and the optimal cost or profit. Typically this ratio is
taken in whichever direction makes it bigger than one; for example, an algorithm that solves for
a cost of $2 an instance of a problem that has an optimal cost of $1 has an approximation ratio 2;
but an algorithm that sells 10 aeroplane tickets (a profit of 10) when the optimum is 20 also has
approximation ratio 2.

An algorithm with approximation ratio k is called a k-approximation algorithm; both


algorithms above would be called 2-approximation algorithms.

If the problem at hand is a minimization then α > 1 and this definition implies that the solution
found by the algorithm is at most α times the optimum solution. If the problem is a
maximization, α < 1 and this definition guarantees that the approximate solution is at least α
times the optimum.

The main idea behind calculating the performance ratio of an


approximation algorithm, which is also called as an approximation
ratio, is to find how close the approximate solution is to the optimal
solution.
The approximate ratio is represented using ρ(n) where n is the
input size of the algorithm, C is the near-optimal solution obtained
by the algorithm, C* is the optimal solution for the problem. The
algorithm has an approximate ratio of ρ(n) if and only if −
max{C/ C* , C*/C}≤ρ(n)

Approximation Algorithms can be applied on two types of


optimization problems: minimization problems and maximization
problems. If the optimal solution of the problem is to find the
maximum cost, the problem is known as the maximization problem;
and if the optimal solution of the problem is to find the minimum
cost, then the problem is known as a minimization problem.

For maximization problems, the approximation ratio is calculated by


C*/C since 0 ≤ C ≤ C*. For minimization problems, the
approximation ratio is calculated by C/C* since 0 ≤ C* ≤ C.

Assuming that the costs of approximation algorithms are all positive,


the performance ratio is well defined and will not be less than 1. If
the value is 1, that means the approximate algorithm generates the
exact optimal solution.

Definition

Given an optimization problem P, an algorithm A is said to be an approximation algorithm for P,


if for any given instance I, it returns an approximate solution, that is a feasible solution.

Let P be a minimization problem, and I be an instance of P. Let A be an algorithm that finds


feasible solution to instances of P. Let A(I) is the cost of the solution returned by A for instance
I, and OP T(I) is the cost of the optimal solution (mimimum) for I.

Then, A is said to be an α-approximation algorithm for P if ∀I,


A (I )
OP T (I )
≤α where α ≥ 1.

Notice that since this is a minimum optimization problem A(I) ≥ OP T(I).

Therefore, 1-approximation algorithm produces an optimal solution, an approximation


algorithm with a large α may return a solution that is much worse than optimal. So the smaller α
is, the better quality of the approximation the algorithm produces.

Types of approximation
P --An optimization problem
A --An approximation algorithm
I --An instance of P
A∗ (I) Optimal value for the instance I
A(I) Value for the instance I generated by A
1. Absolute approximation
 A is an absolute approximation algorithm if there exists a constant k such that, for
every instance I of P, |A∗ (I) − A(I)| ≤ k.
2. Relative approximation
 A is an relative approximation algorithm if there exists a constant k such that, for every
A∗(I ) A (I )
instance I of P, max{ , }} ≤ k.
A(I ) A∗(I )
 Vertex cover.

Approximation Algorithms Types


ρ-approximation algorithm.
■ An algorithm A for problem P that runs in polynomial time.
■ For every problem instance, A outputs a feasible solution within ratio ρ of true optimum for
that instance.
Polynomial-time approximation scheme (PTAS).
■ A family of approximation algorithms {Aε : ε > 0} for a problem P.
■ Aε is a (1 + ε) - approximation algorithm for P.
■ Aε is runs in time polynomial in input size for a fixed ε.
Fully polynomial-time approximation scheme (FPTAS).
■ PTAS where Aε is runs in time polynomial in input size and 1 / ε .
Examples
1. Vertex Cover
2. Bin Packing

1. Vertex cover

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


Feasible Solution: A subset C ⊆ V such that at least one vertex of every edge of G belongs C.
Value: The value of the solution is the size of the cover, |C|, and the goal is to minimize it.

Algorithm 1: Approx-Vertex-Cover(G)

1 C←∅

2 while E 6= ∅

pick any {u, v} ∈ E

C ← C ∪ {u, v}

delete all eges incident to either u or v

return C

As it turns out, this is the best approximation algorithm known for vertex cover. It is an open
problem to either do better or prove that this is a lower bound.
Observation: The set of edges picked by this algorithm is a matching, no 2 edges touch each
other (edges disjoint). In fact, it is a maximal matching. We can then have the following
alternative description of the algorithm as follows.

Find a maximal matching M

Return the set of end-points of all edges ∈ M.

It is known that vertex cover is NP-hard, so we can't really hope to find a polynomial-time
algorithm for solving the problem exactly. Instead, here is a simple 2-approximation algorithm:

To show that this gives a 2-approximation, consider the set E' of all edges the algorithm chooses.
None of these edges share a vertex, so any vertex cover must include at least |E'| vertices. The
algorithm marks 2|E'| vertices.

2. Bin Packing Problem

Instance-- n items with sizes a1, a2, . . . , an (0 < ai ≤ 1).

Feasible Solution-- A packing in unit-sized bins.

Value-- The value of the solution is the number of bins used, and the goal is to minimize the
number.

You might also like