SlideShare a Scribd company logo
Approximation Algorithms
Introduction
Why Approximation Algorithms
 Problems that we cannot find an optimal
solution in a polynomial time
 Eg: Set Cover, Bin Packing
 Need to find a near-optimal solution:
 Heuristic
 Approximation algorithms:
 This gives us a guarantee approximation ratio
Introduction to Combinatorial
Optimization
Combinatorial Optimization
 The study of finding the “best” object from
within some finite space of objects, eg:
 Shortest path: Given a graph with edge costs and a
pair of nodes, find the shortest path (least costs)
between them
 Traveling salesman: Given a complete graph with
nonnegative edge costs, find a minimum cost cycle
visiting every vertex exactly once
 Maximum Network Lifetime: Given a wireless
sensor networks and a set of targets, find a schedule
of these sensors to maximize network lifetime
In P or not in P?
Informal Definitions:
 The class P consists of those problems that are
solvable in polynomial time, i.e. O(nk) for some
constant k where n is the size of the input.
 The class NP consists of those problems that
are “verifiable” in polynomial time:
 Given a certificate of a solution, then we can verify
that the certificate is correct in polynomial time
In P or not in P: Examples
 In P:
 Shortest path
 Minimum Spanning Tree
 Not in P (NP):
 Vertex Cover
 Traveling salesman
 Minimum Connected Dominating Set
NP-completeness (NPC)
 A problem is in the class NPC if it is in NP and
is as “hard” as any problem in NP
What is “hard”
 Decision Problems: Only consider YES-NO
 Decision version of TSP: Given n cities, is there a
TSP tour of length at most L?
 Why Decision Problem? What relation between
the optimization problem and its decision?
 Decision is not “harder” than that of its optimization
problem
 If the decision is “hard”,then the optimization
problem should be “hard”
NP-complete and NP-hard
A language L is NP-complete if:
1. L is in NP, and
2. For every L` in NP, L` can be polynomial-time
reducible to L
Approximation Algorithms
 An algorithm that returns near-optimal
solutions in polynomial time
 Approximation Ratio ρ(n):
 Define: C* as a optimal solution and C is the
solution produced by the approximation algorithm
 max (C/C*, C*/C) <= ρ(n)
 Maximization problem: 0 < C <= C*, thus C*/C
shows that C* is larger than C by ρ(n)
 Minimization problem: 0 < C* <= C, thus C/C*
shows that C is larger than C* by ρ(n)
Approximation Algorithms (cont)
 PTAS (Polynomial Time Approximation
Scheme): A (1 + ε)-approximation algorithm
for a NP-hard optimization П where its running
time is bounded by a polynomial in the size of
instance I
 FPTAS (Fully PTAS): The same as above +
time is bounded by a polynomial in both the
size of instance I and 1/ε
A Dilemma!
 We cannot find C*, how can we compare C to
C*?
 How can we design an algorithm so that we can
compare C to C*
It is the objective of this course!!!
Techniques
 A variety of techniques to design and analyze
many approximation algorithms for
computationally hard problems:
 Combinatorial algorithms:
 Greedy Techniques, Independent System, Submodular
Function
 Linear Programming based algorithms
 Semidefinite Programming based algorithms
Vertex Cover
 Definition:
 An Example
'atincidentendpointone
leastathas,edgeeveryforiffofcoververtexa
calledis'subseta,),(graphundirectedanGiven
V
eEeG
VVEVG
Vertex Cover Problem
 Definition:
 Given an undirected graph G=(V,E), find a vertex
cover with minimum size (has the least number of
vertices)
 This is sometimes called cardinality vertex cover
 More generalization:
 Given an undirected graph G=(V,E), and a cost
function on vertices c: V → Q+
 Find a minimum cost vertex cover
How to solve it
 Matching:
 A set M of edges in a graph G is called a matching
of G if no two edges in set M have an endpoint in
common
 Example:
How to solve it (cont)
 Maximum Matching:
 A matching of G with the greatest number of edges
 Maximal Matching:
 A matching which is not contained in any larger
matching
 Note: Any maximum matching is certainly
maximal, but not the reverse
Main Observation
 No vertex can cover two edges of a matching
 The size of every vertex cover is at least the
size of every matching: |M| ≤ |C|
 |M| = |C| indicates the optimality
 Possible Solution: Using Maximal matching to
find Minimum vertex cover
An Algorithm
 Alg 1: Find a maximal matching in G and output the
set of matched vertices
 Theorem: Alg 1 is a factor 2-approximation algorithm.
 Proof:
optC
MCoptM
Copt
2||Therefore,
||2||and||
:haveWe1.algorithmfromobtainedcoververtex
ofsetabeLetsolution.optimalanofsizeabeLet
Can Alg1 be improved?
 Q1: Can the approximation ratio of Alg 1 be
improved by a better analysis?
 Q2: Can we design a better approximation
algorithm using the similar technique (maximal
matching)?
 Q3: Is there any other lower bounding method
that can lead to a better approximation
algorithm?
Answers
 A1: No by considering the complete bipartite
graphs Kn,n
 A2: No by considering the complete graph Kn
where n is odd.
 |M| = (n-1)/2 whereas opt = n -1
Answers (cont)
 A3:
 Currently a central open problem
 Yes, we can obtain a better one by using the
semidefinite programming
 Generalization vertex Cover
 Can we still able to design a 2-approximation
algorithm?
 Homework assignment!
Set Cover
 Definition: Given a universe U of n elements, a
collection of subsets of U, S = {S1, …, Sm}, and a cost
function c: S → Q+, find a minimum cost
subcollection C of S that covers all elements of U.
 Example:
 U = {1, 2, 3, 4, 5}
 S1 = {1, 2, 3}, S2 = {2,3}, S3 = {4, 5}, S4 = {1, 2, 4}
 c1 = c2 = c3 = c4 = 1
 Solution C = {S1, S3}
 If the cost is uniform, then the set cover problem asks
us to find a subcollection covering all elements of U
with the minimum size.
An Example
INSTANCE: Given a universe U of n elements, a collection
of subsets of U, S = {S1, …, Sm}, and a positive integer b
QUESTION: Is there a , |C| ≤ b,
such that
(Note: The subcollection {Si | } satisfying the above
condition is called a set cover of U
NP-completeness
 Theorem: Set Cover (SC) is NP-complete
 Proof:
Proof (cont)
 First we need to show that SC is in NP. Given a
subcollection C, it is easy to verify that if |C| ≤
b and the union of all sets listed in C does
include all elements in U.
 To complete the proof, we need to show that
Vertex Cover (VC) ≤p Set Cover (SC)
Given an instance C of VC (an undirected graph
G=(V,E) and a positive integer j), we need to
construct an instance C’ of SC in polynomial
time such that C is satisfiable iff C’ is
satisfiable.
Proof (cont)
Construction: Let U = E. We will define n
elements of U and a collection S as follows:
Note: Each edge corresponds to each element in U and
each vertex corresponds to each set in S.
Label all vertices in V from 1 to n. Let Si be the set of all
edges that incident to vertex i. Finally, let b = j. This
construction is in poly-time with respect to the size of
VC instance.
VERTEX-COVER p SET-COVER
one set for every vertex,
containing the edges it covers
VC
one element
for every edge
VC SC
Proof (cont)
Now, we need to prove that C is satisfiable iff C’ is.
That is, we need to show that if the original instance
of VC is a yes instance iff the constructed instance of
SC is a yes instance.
 (→) Suppose G has a vertex cover of size at most j,
called C. By our construction, C corresponds to a
collection C’ of subsets of U. Since b = j, |C’| ≤ b. Plus,
C’ covers all elements in U since C “covers” all edges
in G. To see this, consider any element of U. Such an
element is an edge in G. Since C is a set cover, at least
one endpoint of this edge is in C.
 (←) Suppose there is a set cover C’ of size at
most b in our constructed instance. Since each
set in C’ is associated with a vertex in G, let C
be the set of these vertices. Then |C| = |C’| ≤ b =
j. Plus, C is a vertex cover of G since C’ is a set
cover. To see this, consider any edge e. Since e
is in U, C’ must contain at least one set that
includes e. By our construction, the only set
that include e correspond to nodes that are
endpoints of e. Thus C must contain at least one
endpoint of e.
Solutions
Algorithm 1: (in the case of uniform cost)
1: C = empty
2: while U is not empty
3: pick a set Si such that Si covers the most
elements in U
4: remove the new covered elements from U
5: C = C union Si
6: return C
Solutions (cont)
 In the case of non-uniform cost
 Similar method. At each iteration, instead of picking a
set Si such that Si covers the most uncovered elements,
we will pick a set Si whose cost-effectiveness α is
smallest, where α is defined as:
 Questions: Why choose smallest α? Why define α as
above
||/)( USSc ii
Solutions (cont)
Algorithm 2: (in the case of non-uniform cost)
1: C = empty
2: while U is not empty
3: pick a set Si such that Si has the smallest α
4: for each new covered elements e in U
5: set price(e) = α
6: remove the new covered elements from U
7: C = C union Si
8: return C
Approximation Ratio Analysis
Let ek, k = 1…n, be the elements of U in the order in which
they were covered by Alg 2. We have:
 Lemma 1:
 Proof: Let Uj denote remaining set U at iteration j. That
is, Uj contains all the uncovered elements at iteration j.
At any iteration, the leftover sets of the optimal solution
can cover the remaining elements at a cost of at most
opt. (Why?)
solutionoptimaltheofcosttheiswhere
)1/()(price},,...,1{eachFor
opt
knoptenk k
Proof of Lemma 1 (cont)
Thus, among these leftover sets, there must exist
one set where its α value is at most opt/|Uj|. Let
ek be the element covered at this iteration, |Uj| ≥
n – k + 1. Since ek was covered by the most
cost-effective set in this iteration, we have:
price(ek) ≤ opt/|Uj| ≤ opt/(n-k+1)
Approximation Ratio
 Theorem 1: The set cover obtained from Alg 2
(also Alg 1) has a factor of Hn where Hn is a
harmonic series Hn = 1 + 1/2 + … + 1/n
 Proof: It follows directly from Lemma 1
Examples of NP-complete problems
 Independent set
- independent set: a set of vertices in the graph with no
edges between each pair of nodes.
- given a graph G=(V,E), find the largest independent set
- reduction from vertex cover:
smallest vertex cover S
largest independent set
V/S
Independent Set
 Independent set
- if G has a vertex cover S, then V  S is an independentset
proof: considertwo nodes in V  S:
if there is an edge connectingthem, then one of them must be in
S, which means one of themis not in V  S
- if G has an independentset I, then V  I is a vertex cover
proof: consideroneedge in G:
if it is not covered by any nodein V  I, then its two end vertices
must be both in I, which means I is not an independent set
Summary of some NPc problems
SAT
3SAT
Vertex cover
Independent
set
Set
cover
Graph coloring
Maximum
clique size
Minimum
Steiner
tree
Hamiltonian
cycle
Maximum cut
find more NP-complete problems in
http://en.wikipedia.org/wiki/List_of_NP-complete_problems

More Related Content

What's hot

Branch and bound
Branch and boundBranch and bound
Branch and bound
Dr Shashikant Athawale
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
MdSajjadulislamBappi
 
Vertex cover Problem
Vertex cover ProblemVertex cover Problem
Vertex cover Problem
Gajanand Sharma
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
Dr Sandeep Kumar Poonia
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
Tajim Md. Niamat Ullah Akhund
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
Oye Tu
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
Kirti Verma
 
Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programing
rupali_2bonde
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
Md. Shafiuzzaman Hira
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
Christian Kehl
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
Ganesh Solanke
 
Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
Akshay Kamble
 
Graph coloring
Graph coloringGraph coloring
Graph coloring
Barani Tharan
 
Chap8 new
Chap8 newChap8 new
Chap8 new
Loc Tran
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa
Sampath Kumar S
 
Primality
PrimalityPrimality
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
Simplilearn
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
Zahid Parvez
 
Mergesort
MergesortMergesort
Mergesort
luzenith_g
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's Algorithm
Tanmay Baranwal
 

What's hot (20)

Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
Vertex cover Problem
Vertex cover ProblemVertex cover Problem
Vertex cover Problem
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programing
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
 
Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
 
Graph coloring
Graph coloringGraph coloring
Graph coloring
 
Chap8 new
Chap8 newChap8 new
Chap8 new
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa
 
Primality
PrimalityPrimality
Primality
 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 
Mergesort
MergesortMergesort
Mergesort
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's Algorithm
 

Viewers also liked

Algoritmos Gulosos - Troco Mínimo
Algoritmos Gulosos - Troco MínimoAlgoritmos Gulosos - Troco Mínimo
Algoritmos Gulosos - Troco Mínimo
Gabriel Albuquerque
 
Paa algoritmos gulosos
Paa  algoritmos gulososPaa  algoritmos gulosos
Paa algoritmos gulosos
Inael Rodrigues
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
Dr Sandeep Kumar Poonia
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Dr Sandeep Kumar Poonia
 
Splay tree
Splay treeSplay tree
Splay tree
Rajendran
 
RMABC
RMABCRMABC
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithm
Dr Sandeep Kumar Poonia
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithm
Dr Sandeep Kumar Poonia
 
Lecture24
Lecture24Lecture24
Lecture25
Lecture25Lecture25
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithm
Dr Sandeep Kumar Poonia
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithm
Dr Sandeep Kumar Poonia
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
Dr Sandeep Kumar Poonia
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithm
Dr Sandeep Kumar Poonia
 
Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)
nikhilarora2211
 
Splay Tree
Splay TreeSplay Tree
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Dr Sandeep Kumar Poonia
 
2-3 Tree
2-3 Tree2-3 Tree
Soft computing
Soft computingSoft computing
Soft computing
Dr Sandeep Kumar Poonia
 
AVL Tree
AVL TreeAVL Tree

Viewers also liked (20)

Algoritmos Gulosos - Troco Mínimo
Algoritmos Gulosos - Troco MínimoAlgoritmos Gulosos - Troco Mínimo
Algoritmos Gulosos - Troco Mínimo
 
Paa algoritmos gulosos
Paa  algoritmos gulososPaa  algoritmos gulosos
Paa algoritmos gulosos
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
 
Splay tree
Splay treeSplay tree
Splay tree
 
RMABC
RMABCRMABC
RMABC
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithm
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithm
 
Lecture24
Lecture24Lecture24
Lecture24
 
Lecture25
Lecture25Lecture25
Lecture25
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithm
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithm
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithm
 
Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)Splay trees by NIKHIL ARORA (www.internetnotes.in)
Splay trees by NIKHIL ARORA (www.internetnotes.in)
 
Splay Tree
Splay TreeSplay Tree
Splay Tree
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
 
2-3 Tree
2-3 Tree2-3 Tree
2-3 Tree
 
Soft computing
Soft computingSoft computing
Soft computing
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 

Similar to Lecture26

Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem
sumit gyawali
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
B.Kirron Reddi
 
Approx
ApproxApprox
Approx
guest0264d3b
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Nguyễn Công Hoàng
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
أحلام انصارى
 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy method
MaryJacob24
 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy Method
MaryJacob24
 
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdfUnit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
yashodamb
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
MaryJacob24
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam Help
Programming Exam Help
 
test pre
test pretest pre
test pre
farazch
 
Daa chapter 3
Daa chapter 3Daa chapter 3
Daa chapter 3
B.Kirron Reddi
 
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
Techglyphs
 
Approximation
ApproximationApproximation
Approximation
RiyaSingh235
 
Data structure
Data structureData structure
Data structure
kavitha muneeshwaran
 
Skiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiabilitySkiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiability
zukun
 
Dynamic programming1
Dynamic programming1Dynamic programming1
Dynamic programming1
debolina13
 
Unit 3
Unit 3Unit 3
Unit 3
Unit 3Unit 3
Unit 3
guna287176
 

Similar to Lecture26 (20)

Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Approx
ApproxApprox
Approx
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy method
 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy Method
 
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdfUnit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam Help
 
test pre
test pretest pre
test pre
 
Daa chapter 3
Daa chapter 3Daa chapter 3
Daa chapter 3
 
Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2Bt0080 fundamentals of algorithms2
Bt0080 fundamentals of algorithms2
 
Approximation
ApproximationApproximation
Approximation
 
Data structure
Data structureData structure
Data structure
 
Skiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiabilitySkiena algorithm 2007 lecture20 satisfiability
Skiena algorithm 2007 lecture20 satisfiability
 
Dynamic programming1
Dynamic programming1Dynamic programming1
Dynamic programming1
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 3
Unit 3Unit 3
Unit 3
 

More from Dr Sandeep Kumar Poonia

Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithm
Dr Sandeep Kumar Poonia
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm
Dr Sandeep Kumar Poonia
 
A new approach of program slicing
A new approach of program slicingA new approach of program slicing
A new approach of program slicing
Dr Sandeep Kumar Poonia
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...
Dr Sandeep Kumar Poonia
 
Enhanced abc algo for tsp
Enhanced abc algo for tspEnhanced abc algo for tsp
Enhanced abc algo for tsp
Dr Sandeep Kumar Poonia
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
Dr Sandeep Kumar Poonia
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...
Dr Sandeep Kumar Poonia
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture23
Lecture23Lecture23
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functions
Dr Sandeep Kumar Poonia
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
Dr Sandeep Kumar Poonia
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
Dr Sandeep Kumar Poonia
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
Dr Sandeep Kumar Poonia
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
Dr Sandeep Kumar Poonia
 
Topological Sort
Topological SortTopological Sort
Topological Sort
Dr Sandeep Kumar Poonia
 
Graph
GraphGraph

More from Dr Sandeep Kumar Poonia (16)

Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithm
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm
 
A new approach of program slicing
A new approach of program slicingA new approach of program slicing
A new approach of program slicing
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...
 
Enhanced abc algo for tsp
Enhanced abc algo for tspEnhanced abc algo for tsp
Enhanced abc algo for tsp
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 
Lecture23
Lecture23Lecture23
Lecture23
 
Problems in parallel computations of tree functions
Problems in parallel computations of tree functionsProblems in parallel computations of tree functions
Problems in parallel computations of tree functions
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Graph
GraphGraph
Graph
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

Lecture26

  • 2. Why Approximation Algorithms  Problems that we cannot find an optimal solution in a polynomial time  Eg: Set Cover, Bin Packing  Need to find a near-optimal solution:  Heuristic  Approximation algorithms:  This gives us a guarantee approximation ratio
  • 4. Combinatorial Optimization  The study of finding the “best” object from within some finite space of objects, eg:  Shortest path: Given a graph with edge costs and a pair of nodes, find the shortest path (least costs) between them  Traveling salesman: Given a complete graph with nonnegative edge costs, find a minimum cost cycle visiting every vertex exactly once  Maximum Network Lifetime: Given a wireless sensor networks and a set of targets, find a schedule of these sensors to maximize network lifetime
  • 5. In P or not in P? Informal Definitions:  The class P consists of those problems that are solvable in polynomial time, i.e. O(nk) for some constant k where n is the size of the input.  The class NP consists of those problems that are “verifiable” in polynomial time:  Given a certificate of a solution, then we can verify that the certificate is correct in polynomial time
  • 6. In P or not in P: Examples  In P:  Shortest path  Minimum Spanning Tree  Not in P (NP):  Vertex Cover  Traveling salesman  Minimum Connected Dominating Set
  • 7. NP-completeness (NPC)  A problem is in the class NPC if it is in NP and is as “hard” as any problem in NP
  • 8. What is “hard”  Decision Problems: Only consider YES-NO  Decision version of TSP: Given n cities, is there a TSP tour of length at most L?  Why Decision Problem? What relation between the optimization problem and its decision?  Decision is not “harder” than that of its optimization problem  If the decision is “hard”,then the optimization problem should be “hard”
  • 9. NP-complete and NP-hard A language L is NP-complete if: 1. L is in NP, and 2. For every L` in NP, L` can be polynomial-time reducible to L
  • 10. Approximation Algorithms  An algorithm that returns near-optimal solutions in polynomial time  Approximation Ratio ρ(n):  Define: C* as a optimal solution and C is the solution produced by the approximation algorithm  max (C/C*, C*/C) <= ρ(n)  Maximization problem: 0 < C <= C*, thus C*/C shows that C* is larger than C by ρ(n)  Minimization problem: 0 < C* <= C, thus C/C* shows that C is larger than C* by ρ(n)
  • 11. Approximation Algorithms (cont)  PTAS (Polynomial Time Approximation Scheme): A (1 + ε)-approximation algorithm for a NP-hard optimization П where its running time is bounded by a polynomial in the size of instance I  FPTAS (Fully PTAS): The same as above + time is bounded by a polynomial in both the size of instance I and 1/ε
  • 12. A Dilemma!  We cannot find C*, how can we compare C to C*?  How can we design an algorithm so that we can compare C to C* It is the objective of this course!!!
  • 13. Techniques  A variety of techniques to design and analyze many approximation algorithms for computationally hard problems:  Combinatorial algorithms:  Greedy Techniques, Independent System, Submodular Function  Linear Programming based algorithms  Semidefinite Programming based algorithms
  • 14. Vertex Cover  Definition:  An Example 'atincidentendpointone leastathas,edgeeveryforiffofcoververtexa calledis'subseta,),(graphundirectedanGiven V eEeG VVEVG
  • 15. Vertex Cover Problem  Definition:  Given an undirected graph G=(V,E), find a vertex cover with minimum size (has the least number of vertices)  This is sometimes called cardinality vertex cover  More generalization:  Given an undirected graph G=(V,E), and a cost function on vertices c: V → Q+  Find a minimum cost vertex cover
  • 16. How to solve it  Matching:  A set M of edges in a graph G is called a matching of G if no two edges in set M have an endpoint in common  Example:
  • 17. How to solve it (cont)  Maximum Matching:  A matching of G with the greatest number of edges  Maximal Matching:  A matching which is not contained in any larger matching  Note: Any maximum matching is certainly maximal, but not the reverse
  • 18. Main Observation  No vertex can cover two edges of a matching  The size of every vertex cover is at least the size of every matching: |M| ≤ |C|  |M| = |C| indicates the optimality  Possible Solution: Using Maximal matching to find Minimum vertex cover
  • 19. An Algorithm  Alg 1: Find a maximal matching in G and output the set of matched vertices  Theorem: Alg 1 is a factor 2-approximation algorithm.  Proof: optC MCoptM Copt 2||Therefore, ||2||and|| :haveWe1.algorithmfromobtainedcoververtex ofsetabeLetsolution.optimalanofsizeabeLet
  • 20. Can Alg1 be improved?  Q1: Can the approximation ratio of Alg 1 be improved by a better analysis?  Q2: Can we design a better approximation algorithm using the similar technique (maximal matching)?  Q3: Is there any other lower bounding method that can lead to a better approximation algorithm?
  • 21. Answers  A1: No by considering the complete bipartite graphs Kn,n  A2: No by considering the complete graph Kn where n is odd.  |M| = (n-1)/2 whereas opt = n -1
  • 22. Answers (cont)  A3:  Currently a central open problem  Yes, we can obtain a better one by using the semidefinite programming  Generalization vertex Cover  Can we still able to design a 2-approximation algorithm?  Homework assignment!
  • 23. Set Cover  Definition: Given a universe U of n elements, a collection of subsets of U, S = {S1, …, Sm}, and a cost function c: S → Q+, find a minimum cost subcollection C of S that covers all elements of U.  Example:  U = {1, 2, 3, 4, 5}  S1 = {1, 2, 3}, S2 = {2,3}, S3 = {4, 5}, S4 = {1, 2, 4}  c1 = c2 = c3 = c4 = 1  Solution C = {S1, S3}  If the cost is uniform, then the set cover problem asks us to find a subcollection covering all elements of U with the minimum size.
  • 25. INSTANCE: Given a universe U of n elements, a collection of subsets of U, S = {S1, …, Sm}, and a positive integer b QUESTION: Is there a , |C| ≤ b, such that (Note: The subcollection {Si | } satisfying the above condition is called a set cover of U NP-completeness  Theorem: Set Cover (SC) is NP-complete  Proof:
  • 26. Proof (cont)  First we need to show that SC is in NP. Given a subcollection C, it is easy to verify that if |C| ≤ b and the union of all sets listed in C does include all elements in U.  To complete the proof, we need to show that Vertex Cover (VC) ≤p Set Cover (SC) Given an instance C of VC (an undirected graph G=(V,E) and a positive integer j), we need to construct an instance C’ of SC in polynomial time such that C is satisfiable iff C’ is satisfiable.
  • 27. Proof (cont) Construction: Let U = E. We will define n elements of U and a collection S as follows: Note: Each edge corresponds to each element in U and each vertex corresponds to each set in S. Label all vertices in V from 1 to n. Let Si be the set of all edges that incident to vertex i. Finally, let b = j. This construction is in poly-time with respect to the size of VC instance.
  • 28. VERTEX-COVER p SET-COVER one set for every vertex, containing the edges it covers VC one element for every edge VC SC
  • 29. Proof (cont) Now, we need to prove that C is satisfiable iff C’ is. That is, we need to show that if the original instance of VC is a yes instance iff the constructed instance of SC is a yes instance.  (→) Suppose G has a vertex cover of size at most j, called C. By our construction, C corresponds to a collection C’ of subsets of U. Since b = j, |C’| ≤ b. Plus, C’ covers all elements in U since C “covers” all edges in G. To see this, consider any element of U. Such an element is an edge in G. Since C is a set cover, at least one endpoint of this edge is in C.
  • 30.  (←) Suppose there is a set cover C’ of size at most b in our constructed instance. Since each set in C’ is associated with a vertex in G, let C be the set of these vertices. Then |C| = |C’| ≤ b = j. Plus, C is a vertex cover of G since C’ is a set cover. To see this, consider any edge e. Since e is in U, C’ must contain at least one set that includes e. By our construction, the only set that include e correspond to nodes that are endpoints of e. Thus C must contain at least one endpoint of e.
  • 31. Solutions Algorithm 1: (in the case of uniform cost) 1: C = empty 2: while U is not empty 3: pick a set Si such that Si covers the most elements in U 4: remove the new covered elements from U 5: C = C union Si 6: return C
  • 32. Solutions (cont)  In the case of non-uniform cost  Similar method. At each iteration, instead of picking a set Si such that Si covers the most uncovered elements, we will pick a set Si whose cost-effectiveness α is smallest, where α is defined as:  Questions: Why choose smallest α? Why define α as above ||/)( USSc ii
  • 33. Solutions (cont) Algorithm 2: (in the case of non-uniform cost) 1: C = empty 2: while U is not empty 3: pick a set Si such that Si has the smallest α 4: for each new covered elements e in U 5: set price(e) = α 6: remove the new covered elements from U 7: C = C union Si 8: return C
  • 34. Approximation Ratio Analysis Let ek, k = 1…n, be the elements of U in the order in which they were covered by Alg 2. We have:  Lemma 1:  Proof: Let Uj denote remaining set U at iteration j. That is, Uj contains all the uncovered elements at iteration j. At any iteration, the leftover sets of the optimal solution can cover the remaining elements at a cost of at most opt. (Why?) solutionoptimaltheofcosttheiswhere )1/()(price},,...,1{eachFor opt knoptenk k
  • 35. Proof of Lemma 1 (cont) Thus, among these leftover sets, there must exist one set where its α value is at most opt/|Uj|. Let ek be the element covered at this iteration, |Uj| ≥ n – k + 1. Since ek was covered by the most cost-effective set in this iteration, we have: price(ek) ≤ opt/|Uj| ≤ opt/(n-k+1)
  • 36. Approximation Ratio  Theorem 1: The set cover obtained from Alg 2 (also Alg 1) has a factor of Hn where Hn is a harmonic series Hn = 1 + 1/2 + … + 1/n  Proof: It follows directly from Lemma 1
  • 37. Examples of NP-complete problems  Independent set - independent set: a set of vertices in the graph with no edges between each pair of nodes. - given a graph G=(V,E), find the largest independent set - reduction from vertex cover: smallest vertex cover S largest independent set V/S
  • 38. Independent Set  Independent set - if G has a vertex cover S, then V S is an independentset proof: considertwo nodes in V S: if there is an edge connectingthem, then one of them must be in S, which means one of themis not in V S - if G has an independentset I, then V I is a vertex cover proof: consideroneedge in G: if it is not covered by any nodein V I, then its two end vertices must be both in I, which means I is not an independent set
  • 39. Summary of some NPc problems SAT 3SAT Vertex cover Independent set Set cover Graph coloring Maximum clique size Minimum Steiner tree Hamiltonian cycle Maximum cut find more NP-complete problems in http://en.wikipedia.org/wiki/List_of_NP-complete_problems