Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Polynomial-time reductions We have seen several reductions:
Vertex Cover Dominating Set These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the University of Maryland. The Copyright.
NP-Completeness: Reductions
1 ©D.Moshkovitz Complexity The Traveling Salesman Problem.
CSCI 256 Data Structures and Algorithm Analysis Lecture 22 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
Department of Computer Science & Engineering
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.
Combinatorial Algorithms
Complexity ©D.Moshkovits 1 Hardness of Approximation.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Computational problems, algorithms, runtime, hardness
Approximation Algorithms
1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
The Importance of Being Biased Irit Dinur S. Safra (some slides borrowed from Dana Moshkovitz) Irit Dinur S. Safra (some slides borrowed from Dana Moshkovitz)
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Complexity 1 Hardness of Approximation. Complexity 2 Introduction Objectives: –To show several approximation problems are NP-hard Overview: –Reminder:
An introduction to Approximation Algorithms Presented By Iman Sadeghi.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 Approximation Algorithms. 2 Motivation By now we’ve seen many NP-Complete problems. We conjecture none of them has polynomial time algorithm.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
MCS312: NP-completeness and Approximation Algorithms
Fixed Parameter Complexity Algorithms and Networks.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Approximation Algorithms for NP-hard Combinatorial Problems Magnús M. Halldórsson Reykjavik University
APPROXIMATION ALGORITHMS VERTEX COVER – MAX CUT PROBLEMS
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
Lecture 22 More NPC problems
Approximation Algorithms
Polynomial-time reductions We have seen several reductions:
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
CSCI 3160 Design and Analysis of Algorithms Chengyu Lin.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Introduction to NP Instructor: Neelima Gupta 1.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
MCS 312: NP Completeness and Approximation Algorithms Instructor Neelima Gupta
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Approximation Algorithms based on linear programming.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
The Set-covering Problem Problem statement –given a finite set X and a family F of subsets where every element of X is contained in one of the subsets.
The Theory of NP-Completeness
P & NP.
Approximating Set Cover
Coverage Approximation Algorithms
Presentation transcript:

Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?

Complexity ©D Moshkovitz 2 Motivation By now we’ve seen many NP-Complete problems. We conjecture none of them has polynomial time algorithm.

Complexity ©D Moshkovitz 3 Motivation Is this a dead-end? Should we give up altogether?

Complexity ©D Moshkovitz 4 Motivation Or maybe we can settle for good approximation algorithms?

Complexity ©D Moshkovitz 5 Introduction Objectives: –To formalize the notion of approximation. –To demonstrate several such algorithms. Overview: –Optimization and Approximation –VERTEX-COVER, SET-COVER

Complexity ©D Moshkovitz 6 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.

Complexity ©D Moshkovitz 7 Approximation An algorithm that 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).

Complexity ©D Moshkovitz 8 Network Power Say you have a network, with links between some components Each link requires power supply, hence, you need to supply power to a set of nodes that cover all links Obviously, you’d like to connect the smallest number of nodes

Complexity ©D Moshkovitz 9 VERTEX-COVER Instance: an undirected graph G=(V,E). Problem: find a set C  V of minimal size s.t. for any (u,v)  E, either u  C or v  C. Example:

Complexity ©D Moshkovitz 10 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, u  V’ or v  V’. This follows immediately from the following observation.

Complexity ©D Moshkovitz 11 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.

Complexity ©D Moshkovitz 12 VC - Approximation Algorithm C   E’  E while E’   –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. COR(B)

Complexity ©D Moshkovitz 13 Demo Compare this cover to the one from the example one from the example

Complexity ©D Moshkovitz 14 Polynomial Time C   E’  E while E’   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 O(n 2 ) O(1)O(n) O(n 2 )

Complexity ©D Moshkovitz 15 Correctness The set of vertices our algorithm returns is clearly a vertex-cover, since we iterate until every edge is covered.

Complexity ©D Moshkovitz 16 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 no common vertices!

Complexity ©D Moshkovitz 17 Mass Mailing Say you’d like to send some message to a large list of people (e.g. all campus) There are some available mailing- lists, however, the moderator of each list charges $1 for each message sent You’d like to find the smallest set of lists that covers all recipients

Complexity ©D Moshkovitz 18 SET-COVER Instance: a finite set X and a family F of subsets of X, such that Problem: to find a set C  F of minimal size which covers X, i.e -

Complexity ©D Moshkovitz 19 SET-COVER: Example

Complexity ©D Moshkovitz 20 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:

Complexity ©D Moshkovitz 21 VERTEX-COVER  p SET-COVER one set for every vertex, containing the edges it covers VC one element for every edge VC SC

Complexity ©D Moshkovitz 22 C   U  X while U   do –select S  F that maximizes |S  U| –C  C  {S} –U  U - S return C The Greedy Algorithm O(|F|·|X|) min{|X|, |F|} COR(B)

Complexity ©D Moshkovitz 23 Demonstration compare to the optimal coveroptimal cover

Complexity ©D Moshkovitz 24 Is Being Greedy Worthwhile? How Do We Proceed From Here? We can easily bound the approximation ratio by logn.We can easily bound the approximation ratio by logn. A more careful analysis yields a tight bound of lnn.A more careful analysis yields a tight bound of lnn.

Complexity ©D Moshkovitz 25 The Trick We’d like to compare the number of subsets returned by the greedy algorithm to the optimal The optimal is unknown, however, if it consists of k subsets, then any part of the universe can be covered by k subsets! Which is exactly what the next 3 distinct arguments take advantage of

Complexity ©D Moshkovitz 26 Loose Ratio-Bound Claim: If  cover of size k, then after k iterations the algorithm have covered at least ½ of the elements Suppose it doesn’t and observe the situation after k iterations: the n elements already covered >½

Complexity ©D Moshkovitz 27 the n elements Loose Ratio-Bound Claim: If  cover of size k, then after k iterations the algorithm have covered at least ½ of the elements Since this part  can also be covered by k sets... already covered >½

Complexity ©D Moshkovitz 28 the n elements Loose Ratio-Bound Claim: If  cover of size k, then after k iterations the algorithm have covered at least ½ of the elements there must be a set not chosen yet, whose size is at least ½n·1/k already covered >½

Complexity ©D Moshkovitz 29 the n elements already covered >½ Loose Ratio-Bound Claim: If  cover of size k, then after k iterations the algorithm have covered at least ½ of the elements Thus in each of the k iterations we’ve covered at least ½n·1/k new elements and the claim is proven!

Complexity ©D Moshkovitz 30 Loose Ratio-Bound Claim: If  cover of size k, then after k iterations the algorithm covered at least ½ of the elements. Therefore after klogn iterations (i.e - after choosing klogn sets) all the n elements must be covered, and the bound is proved.

Complexity ©D Moshkovitz 31 Better Ratio Bound Let S 1, …, S t be the sequence of sets outputted by the greedy algorithm. Let, for 0 ≤ i ≤ t Since, for every i, U i can be covered by k sets, it follows

Complexity ©D Moshkovitz 32 Better Ratio Bound Hence, for any 0 ≤ i < j ≤ t Which implies that for every i Therefore, t ≤ k ln(n) + 1

Complexity ©D Moshkovitz 33 Tight Ratio-Bound Claim: The greedy algorithm approximates the optimal set-cover to within a factor H(max{ |S|: S  F } ) Where H(d) is the d-th harmonic number:

Complexity ©D Moshkovitz 34 Tight Ratio-Bound

Complexity ©D Moshkovitz 35 Claim’s Proof Charge $1 for each set Split cost between covered elements Bound from above the total fees paid 0.2 each recipient pays the fractional cost for the first mailing-list it appears in

Complexity ©D Moshkovitz 36 Analysis Thus, every element x  X is charged Where S i is the first set that covers x. cxcx

Complexity ©D Moshkovitz 37 Lemma Lemma: For every S  F Proof: Fix an S  F. For any i, let  1  i  k : S i covers u i-1 -u i elements of S Let k be the smallest index, s.t. u k =0 number of members of S still uncovered after i iterations

Complexity ©D Moshkovitz 38 Lemma sum charges definition of u i-1 Telescopic sum H(u k )=H(0)=0 H(u 0 )=H(|S|) else greedy strategy would have taken S instead of S i

Complexity ©D Moshkovitz 39 Analysis Now we can finally complete our analysis:

Complexity ©D Moshkovitz 40 Summary As it turns out, we can sometimes find efficient approximation algorithms for NP-hard problems. We’ve seen two such algorithms: –for VERTEX-COVER (factor 2) –for SET-COVER (logarithmic factor). 

Complexity ©D Moshkovitz 41 What’s Next? But where can we draw the line? Does every NP-hard problem have an approximation? And to within which factor? Can approximation be NP-hard as well?! 