Approximation Algorithms. Motivation. By now we’ve seen many NP-Complete problems. We conjecture none of them has polynomial time algorithm. Motivation. Is this a dead-end? Should we give up altogether?. ?. Motivation. Or maybe we can settle for good approximation algorithms?.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Motivation • By now we’ve seen many NP-Complete problems. • We conjecture none of them has polynomial time algorithm.
Motivation • Is this a dead-end? Should we give up altogether? ?
Motivation • Or maybe we can settle for good approximation algorithms?
Introduction • Objectives: • To formalize the notion of approximation. • To demonstrate several such algorithms. • Overview: • Optimization and Approximation • VERTEX-COVER, SET-COVER
Optimization • Many of the problems we’ve encountered so far are really optimization problems. • I.e - the task can be naturally rephrased as finding a maximal/minimal solution. • For example: finding a maximal clique in a graph.
Approximation • An algorithm which returns an answer C which is “close” to the optimal solution C* is called an approximation algorithm. • “Closeness” is usually measured by the ratio bound (n) the algorithm produces. • Which is a function that satisfies, for any input size n, max{C/C*,C*/C}(n).
VERTEX-COVER • Instance: an undirected graph G=(V,E). • Problem: find a set CV of minimal size s.t. for any (u,v)E, either uC or vC. Example:
Minimum VC NP-hard Proof: It is enough to show the decision problem below is NP-Complete: • Instance: an undirected graph G=(V,E) and a number k. • Problem: to decide if there exists a set V’V of size k s.t for any (u,v)E, uV’ or vV’. This follows immediately from the following observation.
Minimum VC NP-hard Observation: Let G=(V,E) be an undirected graph. The complement V\C of a vertex-cover C is an independent-set of G. Proof: Two vertices outside a vertex-cover cannot be connected by an edge.
COR(B) 523-524 VC - Approximation Algorithm • C • E’ E • whileE’ • do let (u,v) be an arbitrary edge of E’ • C C {u,v} • remove from E’ every edge incident to either u or v. • return C.
Demo Compare this cover to theone from the example
O(n2) O(1) O(n2) O(n) Polynomial Time • C • E’ E • whileE’ do • let (u,v) be an arbitrary edge of E’ • C C {u,v} • remove from E’ every edge incident to either u or v • return C
Correctness The set of vertices our algorithm returns is clearly a vertex-cover, since we iterate until every edge is covered.
no common vertices! How Good an Approximation is it? Observe the set of edges our algorithm chooses any VC contains 1 in each our VC contains both, hence at most twice as large
TSP is NP-hard The corresponding decision problem: • Instance: a complete weighted undirected graph G=(V,E) and a number k. • Problem: to find a Hamiltonian path whose cost is at most k.
TSP is NP-hard verify! Theorem:HAM-CYCLE p TSP. Proof: By the straightforward efficient reduction illustrated below: 0 1 0 0 1 k=0 0 HAM-CYCLE TSP
What Next? • We’ll show an approximation algorithm for TSP, • which yields a ratio-bound of 2 • for cost functions which satisfy a certain property.
The Triangle Inequality Definition: We’ll say the cost function c satisfies the triangle inequality, if u,v,wV : c(u,v)+c(v,w)c(u,w)
COR(B) 525-527 Approximation Algorithm 1. Grow a Minimum Spanning Tree(MST) for G. 2. Return the cycle resulting from a preorder walk on that tree.
COR(B) 528 What About the General Case? • We’ll show TSP cannot be approximated within any constant factor 1 • By showing the corresponding gap version is NP-hard.
gap-TSP[] • Instance: a complete weighted undirected graph G=(V,E). • Problem: to distinguish between the following two cases: There exists a hamiltonian cycle, whose cost is at most |V|. The cost of every hamiltonian cycle is more than |V|. YES NO
Summary • We’ve studied the Traveling Salesman Problem (TSP). • We’ve seen it is NP-hard. • Nevertheless, when the cost function satisfies the triangle inequality, there exists an approximation algorithm with ratio-bound 2.
Summary • For the general case we’ve proven there is probably no efficient approximation algorithm for TSP. • Moreover, we’ve demonstrated a generic method for showing approximation problems are NP-hard.
SET-COVER • Instance: a finite setX and a family F of subsets of X, such that • Problem: to find a set CF of minimal size which coversX, i.e -
SET-COVER is NP-Hard Proof: Observe the corresponding decision problem. • Clearly, it’s in NP(Check!). • We’ll sketch a reduction from (decision) VERTEX-COVER to it:
SC VC VERTEX-COVER p SET-COVER one element for every edge one set for every vertex, containing the edges it covers
O(|F|·|X|) min{|X|,|F|} COR(B) 530-533 Greedy Algorithm • C • U X • whileU do • select SF that maximizes |SU| • C C {S} • U U - S • return C
the n elements >½ what we covered Loose Ratio-Bound Claim: If cover of size k, then after k iterations the algorithm covered at least ½ of the elements. Suppose it doesn’t and observe the situation after k iterations:
the n elements Loose Ratio-Bound Claim: If cover of size k, then after k iterations the algorithm covered at least ½ of the elements. Since this part can also be covered by k sets... >½ what we covered
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.