Approximate Algorithms
Approximate Algorithms
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
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.
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.
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.
Definition
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.
1. Vertex cover
Algorithm 1: Approx-Vertex-Cover(G)
1 C←∅
2 while E 6= ∅
C ← C ∪ {u, 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.
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.
Value-- The value of the solution is the number of bins used, and the goal is to minimize the
number.