1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation.

Slides:



Advertisements
Similar presentations
Instructor Neelima Gupta Table of Contents Approximation Algorithms.
Advertisements

Polynomial-time reductions We have seen several reductions:
Approximation Algorithms for TSP
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
End Topics Approximate Vertex Cover Approximate TSP Tour Computation of FFT P, NP, NP Complete, NP hard.
Combinatorial Algorithms
Lecture 21 Approximation Algorithms Introduction.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Approximation Algorithms
Graphs 4/16/2017 8:41 PM NP-Completeness.
Approximation Algorithms1. 2 Outline and Reading Approximation Algorithms for NP-Complete Problems (§13.4) Approximation ratios Polynomial-Time Approximation.
Approximation Algorithms Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
Transitivity of  poly Theorem: Let ,  ’, and  ’’ be three decision problems such that   poly  ’ and  ’  poly  ’’. Then  poly  ’’. Proof:
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2006 Lecture 7 Monday, 4/3/06 Approximation Algorithms.
Optimization problems INSTANCE FEASIBLE SOLUTIONS COST.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 7 Tuesday, 4/7/09 Approximation Algorithms.
An introduction to Approximation Algorithms Presented By Iman Sadeghi.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Approximation Algorithms
Chapter 13 NP-Completeness
Spring 2007Approximation Algorithms1. Spring 2007Approximation Algorithms2 Outline and Reading Approximation Algorithms for NP-Complete Problems (§13.4)
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Traveling Salesman Problem Approximation
NP-Completeness x 1 x 3 x 2 x 1 x 4 x 3 x 2 x
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
1 Approximation Algorithm Instructor: yedeshi
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
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
Approximation Algorithms
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.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Algorithms for hard problems Introduction Juris Viksna, 2015.
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.
Steiner Tree Problem Given: A set S of points in the plane = terminals
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Spring 2007NP-Completeness1 x 1 x 3 x 2 x 1 x 4 x 3 x 2 x
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Approximation Algorithms Greedy Strategies. I hear, I forget. I learn, I remember. I do, I understand! 2 Max and Min  min f is equivalent to max –f.
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 7 Tuesday, 4/6/10 Approximation Algorithms 1.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Approximation Algorithms
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Approximation Algorithms
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Approximation Algorithms
Computability and Complexity
NP-Completeness Merge Sort 11/16/2018 2:30 AM Spring 2007
Approximation Algorithms for TSP
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
NP-Completeness NP-Completeness Graphs 12/6/2018 1:58 PM x x x x x x x
Richard Anderson Lecture 28 NP-Completeness
Approximation Algorithms
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

1 Approximation Algorithms CSC401 – Analysis of Algorithms Lecture Notes 18 Approximation Algorithms Objectives: Typical NP-complete problems Approximation Algorithms for NP- Complete Problems –Approximation ratios –Polynomial-Time Approximation Schemes –2-Approximation for Vertex Cover –2-Approximation for TSP special case –Log n-Approximation for Set Cover

2 Some NP-complete Problems Summarization –CIRCUIT-SAT -- Cook-Levin theorem –SAT -- reduced from CIRCUIT-SAT –CNF-SAT – reduced from SAT –3SAT -- reduced from CIRCUIT-SAT –VERTEX-COVER – reduced from 3SAT –CLIQUE – reduced from VERTEX-COVER SET-COVER: Given a collection of m sets, are there K of these sets whose union is the same as the whole collection of m sets? –NP-complete by reduction from VERTEX- COVER

3 Some Other NP-Complete Problems SUBSET-SUM: Given a set of integers and a distinguished integer K, is there a subset of the integers that sums to K? –NP-complete by reduction from VERTEX-COVER 0/1 Knapsack: Given a collection of items with weights and benefits, is there a subset of weight at most W and benefit at least K? –NP-complete by reduction from SUBSET-SUM Hamiltonian-Cycle: Given an graph G, is there a cycle in G that visits each vertex exactly once? –NP-complete by reduction from VERTEX-COVER Traveling Saleperson Tour: Given a complete weighted graph G, is there a cycle that visits each vertex and has total cost at most K? –NP-complete by reduction from Hamiltonian- Cycle.

4 NP-complete Problems INDEPENDENT-SET: Given a graph G and an integer k, asks if G contains an independent set of vertices of size k. That is, G contains a set I of vertices of size k such that, for any v and w in I, there is no edge (v, w) in G. –NP-complete by reduction from CLIQUE or VERTEX-COVER PARTITION: Given a set S of numbers and asks if there is a partition of S into two subsets that sum to the same value. –NP-complete by reduction from SUBSET-SUM

5 Approximation Ratios Optimization Problems –We have some problem instance x that has many feasible “solutions”. –We are trying to minimize (or maximize) some cost function c(S) for a “solution” S to x. For example, Finding a minimum spanning tree of a graph Finding a smallest vertex cover of a graph Finding a smallest traveling salesperson tour in a graph An approximation produces a solution T –T is a k-approximation to the optimal solution OPT if c(T)/c(OPT) < k (a maximization approximation would be the reverse)

6 Polynomial-Time Approximation Schemes A problem L has a polynomial-time approximation scheme (PTAS) if it has a polynomial-time (1+)- approximation algorithm, for any fixed  >0 (this value can appear in the running time). 0/1 Knapsack has a PTAS, with a running time that is O(n 3 / ).

7 Vertex Cover A vertex cover of graph G=(V,E) is a subset W of V, such that, for every (a,b) in E, a is in W or b is in W. OPT-VERTEX-COVER: Given an graph G, find a vertex cover of G with smallest size. OPT-VERTEX-COVER is NP-hard.

8 A 2-Approximation for Vertex Cover Every chosen edge e has both ends in C But e must be covered by an optimal cover; hence, one end of e must be in OPT Thus, there is at most twice as many vertices in C as in OPT. That is, C is a 2-approx. of OPT Running time: O(m) Algorithm VertexCoverApprox(G) Input graph G Output a vertex cover C for G C  empty set H  G while H has edges e  H.removeEdge(H.anEdge()) v  H.origin(e) w  H.destination(e) C.add(v) C.add(w) for each f incident to v or w H.removeEdge(f) return C

9 Special Case of the Traveling Salesperson Problem OPT-TSP: Given a complete, weighted graph, find a cycle of minimum cost that visits each vertex. –OPT-TSP is NP-hard –Special case: edge weights satisfy the triangle inequality (which is common in many applications): w(a,b) + w(b,c) > w(a,c) a b c 5 4 7

10 A 2-Approximation for TSP Special Case Output tour T Euler tour Pof MSTM Algorithm TSPApprox(G) Input weighted complete graph G, satisfying the triangle inequality Output a TSP tour T for G M  a minimum spanning tree for G P  an Euler tour traversal of M, starting at some vertex s T  empty list for each vertex v in P (in traversal order) if this is v’s first appearance in P then T.insertLast(v) T.insertLast(s) return T

11 A 2-Approximation for TSP Special Case - Proof Euler tour Pof MSTMOutput tour TOptimal tour OPT (twice the cost ofM)(at least the cost of MSTM)(at most the cost ofP) The optimal tour is a spanning tour; hence |M|<|OPT|. The Euler tour P visits each edge of M twice; hence |P|=2|M| Each time we shortcut a vertex in the Euler Tour we will not increase the total length, by the triangle inequality (w(a,b) + w(b,c) > w(a,c)); hence, |T|<|P|. Therefore, |T|<|P|=2|M|<2|OPT|

12 Set Cover OPT-SET-COVER: Given a collection of m sets, find the smallest number of them whose union is the same as the whole collection of m sets? –OPT-SET-COVER is NP-hard Greedy approach produces an O(log n)- approximation algorithm. Algorithm SetCoverApprox(G) Input a collection of sets S 1 …S m Output a subcollection C with same union F  {S 1,S 2,…,S m } C  empty set U  union of S 1 …S m while U is not empty S i  set in F with most elements in U F.remove(S i ) C.add(S i ) Remove all elements in S i from U return C