APProximation Problem
APProximation Problem
APPROXIMATION ALGORITHMS
Greedy approach does not always lead to the best approximation algorithm.
Greedy Algorithm(1): Analysis
Unfortunately if we select the vertices in following order, then we will get worst solution for this
vertex cover problem-
First we might choose all the green vertices.
Then we might choose all the blue vertices.
And then we might choose all the orange vertices.
Solution=11;
Vertex Cover : Algorithm(2)
APPROX-VERTEX-COVER(G)
1: C ;
2: E E[G]
3: while E ; do
4: let (u, v) be an arbitrary edge of E
5: C C {(u, v)}
6: remove from E all edges incident on either u or v
7: end while
Algorithm(2): Example
1 2 3 8
4 5 6 7
Initially C = C= 1 2
1 2 3 8
4 5 6 7
C= 1 2 3 6
1 2 3
4 5 6 7
Size = 4
Algorithm(2): Example (Cont)
1 2 3
4 5 6 7
Size = 3
Given algorithm returns a vertex cover whose
size is guaranteed to be no more than twice
the size of an optimal vertex cover
TRAVELING SALESMAN PROBLEM
The Travelling Salesman Problem is a classic algorithmic problem
in the field of computer science.
It is focused on optimization. In this context better solution
often means a solution that is cheaper.
The Travelling Salesman Problem describes a salesman who must
travel between N cities.
The order in which he does so is something he does not care
about, as long as he visits each one during his trip, and finishes
where he was at first.
Each city is connected to other close by cities, or nodes, by
airplanes, or by road or railway.
Each of those links between the cities has one or more weights
(or the cost) attached. The cost describes how "difficult" it is to
traverse this edge on the graph, and may be given, for example,
by the cost of an airplane ticket or train ticket, or perhaps by
the length of the edge, or time required to complete the
traversal.
The salesman wants to keep both the travel costs, as well as the
distance he travels as low as possible.
Given a complete undirected graph G=(V, E) that
has nonnegative integer cost c(u, v) associated
with each edge (u, v) in E, the problem is to find
a hamiltonian cycle (tour) of G with minimum
cost.
Suppose c(A) denoted the total cost of the edges in the subset A
subset of E i.e.,
Then, use MST to build a tour whose cost is no more than twice
that of MST's weight as long as the cost function satisfies triangle
inequality.
Operation of APPROX-TSP-TOUR