Approximation Algorithms
Approximation Algorithms
ION
ALGORITHM
S
/01
Introduction
and terminology
What are NP-
complete problems?
Are non deterministic polynomial time complex
problem ie we have solutions only with
exponential time complexity.
We try to find algorithms which can give near optimal solutions in polynomial time called as
approximation algorithms.
The main work is to find the goodness of the near-optimal solution ie how close it is to perfect
solution.
Ref. Cormen
The task for any approximation algorithm is to improve nearness of optimal solution by
decreasing value of approximation ratio.
/02
Vertex cover
problem
Problem statement
Vertex cover: a subset U of all vertices V, such that every edge E is covered
Covered Edge: If we choose a vertex all its edges come in the vertex cover set.
We want to find the set of minimum number of vertices such that we can cover all the edges.
Straightforward exponential
solution
We can make all the subset combinations starting from the empty set and increasing the size of
subset in each set and seeing if we cover all the edges or not. As we can check the answer in
polynomial time it won’t cause much problem.
N
Time complexity: O(2 )
Greedy approach
Choosing of different vertex when the degree is same gives different answer
Perfect solution for bipartite graph
In Graph theory, Konig’s theorem states that for a bipartite graph the problem of maximal
matching is equivalent to minimum vertex cover.
Maximal matching means a set of maximum edges such that no two edges share the same
vertex. If we take the endpoints of those edges we will get our solution.
/03
Important
techniques
Greedy approach
Dynamic Programming
Swarm intelligence
Simulated annealing
Random sampling
/04
Hashcode
problem
Greedy + Hill
climbing
First, we can create an order of tasks in
the most greedy way using basic sorting
for eg. p1,p2,p3,p4. Then we can do a
local search as for the swap of p2 and p4
if we get a positive reward we should
make it next near maxima and repeat the
step until we get as close to optimality.
<THANK
YOU>