1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.

Slides:



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

Approximation Algorithms for TSP
1 ©D.Moshkovitz Complexity The Traveling Salesman Problem.
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
1 Traveling Salesman Problem (TSP) Given n £ n positive distance matrix (d ij ) find permutation  on {0,1,2,..,n-1} minimizing  i=0 n-1 d  (i),  (i+1.
The Theory of NP-Completeness
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2006 Lecture 7 Monday, 4/3/06 Approximation Algorithms.
Time Complexity.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 7 Tuesday, 4/7/09 Approximation Algorithms.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
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
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.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
Computer Science Day 2013, May Distinguished Lecture: Andy Yao, Tsinghua University Welcome and the 'Lecturer of the Year' award.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Unit 9: Coping with NP-Completeness
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Non-Approximability Results. Summary -Gap technique -Examples: MINIMUM GRAPH COLORING, MINIMUM TSP, MINIMUM BIN PACKING -The PCP theorem -Application:
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
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 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
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 7 Tuesday, 4/6/10 Approximation Algorithms 1.
Approximation algorithms
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
The Theory of NP-Completeness
EMIS 8373: Integer Programming
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
Approximation algorithms
NP-Completeness Yin Tat Lee
Computability and Complexity
Approximation Algorithms for TSP
Richard Anderson Lecture 25 NP-Completeness
Approximation Algorithms
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
Approximation Algorithms
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial time algorithm (unless P=NP). But we have to solve these problems anyway – what do we do?

2 What to do… Worst case exponential time algorithms behaving well in practice. –Branch and bound –Branch and cut –Branch and ….. Focus on special cases (e.g., special structure, pseudopolynomial algorithms, parameterized complexity) Approximation algorithms (5th question on the exam) and approximation heuristics (essentially 6th question on the exam).

3 Approximation algorithms Given minimization problem (e.g. min vertex cover, TSP,…) and an efficient algorithm that always returns some feasible solution. The algorithm is said to have approximation ratio  if for all instances, cost(sol. found)/cost(optimal sol.) · 

4 Min vertex cover (node cover) Given an undirected graph G=(V,E), find the smallest subset C µ V that covers E.

5

6 Approximation Ratio Approx-Vertex-Cover has approximation ratio 2. Proof Let M be the set of edges chosen. M is a matching. |M| · size of optimal cover |C| = 2|M| |C| · 2 ¢ size of optimal cover.

7 General design/analysis trick We do not directly compare our solution to the optimal one – this would be difficult as we typically have no clue about the optimal solution. Instead, we compare our solution to some lower bound (for minimization problems) for the optimal solution. Our approximation algorithm often works by constructing some relaxation providing such a lower bound and turning the relaxed solution into a feasible solution without increasing the cost too much.

8 Traveling Salesman Problem (TSP) Given n £ n positive distance matrix (d ij ) find permutation  on {0,1,2,..,n-1} minimizing  i=0 n-1 d  (i),  (i+1 mod n) The special case of d ij being actual distances on a map is called the Euclidean TSP. The special case of d ij satistying the triangle inequality is called Metric TSP. We shall construct an approximation algorithm for the metric case.

9 Lower bound/relaxation What are suitable relaxations of traveling salesman tours? Ideas from branch and bound: Cycle covers and minimum spanning trees. We can turn a minimum spanning tree into a traveling salesman tour without increasing the cost too much.

10

11

12 Approximation Ratio Approx-TSP-Tour has approximation ratio 2. Proof Let w be the weight of the spanning tree. w · length of optimal tour Length of tour found · 2w Length of tour found · 2 ¢ length of optimal tour

13 Improvements Best known algorithm for metric TSP (Christofides algorithm) has approximation factor 3/2. Also uses minimum spanning tree, but gets a better tour from it than the preorder walk. Why do we only consider metric case?

14 Appoximating general TSP is NP- hard If there is an efficient approximation algorithm for TSP with any approximation factor  then P=NP. Proof: We use a modification of the reduction of hamiltonian cycle to TSP.

15 Reduction Given instance (V,E) of hamiltonian cycle, construct TSP instance (V,d) as follows: d(u,v) = 1 if (u,v) 2 E d(u,v) =  |V| + 1 otherwise. Suppose we have an efficient approximation algorithm for TSP with approximation ratio . Run it on instance (V,d). (V,E) has a hamiltonian cycle if and only if the returned solution has length at most  |V|.

16 Remarks The reduction we constructed is called a gap creating reduction. Gap creating reductions have been constructed for many NP-hard optimization problems, proving a limit to their approximability by efficient algorithms. For instance, it is known that min vertex cover does not have an algorithm with approximation ratio better than This reduction and most gap creating reductions are much harder to construct that the TSP reduction. Constructing them has been a major theme for complexity theory in the 1990’s.

17 Approximation algorithms Given maximization problem (e.g. MAXSAT, MAXCUT) and an efficient algorithm that always returns some feasible solution. The algorithm is said to have approximation ratio  if for all instances, cost(optimal sol.)/cost(sol. found) · 

18 General design/analysis trick Our approximation algorithm often works by constructing some relaxation providing a lower bound and turning the relaxed solution into a feasible solution without increasing the cost too much. The LP relaxation of the ILP formulation of the problem is a natural choice. We may then round the optimal LP solution.

19 Not obvious that it will work….

20 Min weight vertex cover Given an undirected graph G=(V,E) with non- negative weights w(v), find the minimum weight subset C µ V that covers E. Min vertex cover is the case of w(v)=1 for all v.

21 ILP formulation Find (x v ) v 2 V minimizing  w v x v so that x v 2 Z 0 · x v · 1 For all (u,v) 2 E, x u + x v ¸ 1.

22 LP relaxation Find (x v ) v 2 V minimizing  w v x v so that x v 2 R 0 · x v · 1 For all (u,v) 2 E, x u + x v ¸ 1.

23 Relaxation and Rounding Solve LP relaxation. Round the optimal solution x* to an integer solution x: x v = 1 iff x* v ¸ ½. The rounded solution is a cover: If (u,v) 2 E, then x* u + x* v ¸ 1 and hence at least one of x u and x v is set to 1.

24 Quality of solution found Let z* =  w v x v * be cost of optimal LP solution.  w v x v · 2  w v x v *, as we only round up if x v * is bigger than ½. Since z* · cost of optimal ILP solution, our algorithm has approximation ratio 2.

25 Relaxation and Rounding Relaxation and rounding is a very powerful scheme for getting approximate solutions to many NP-hard optimization problems. In addition to often giving non-trivial approximation ratios, it is known to be a very good heuristic, especially the randomized rounding version. Randomized rounding of x 2 [0,1]: Round to 1 with probability x and 0 with probability 1-x.

26 MAX-3-CNF Given Boolean formula in CNF form with exactly three distinct literals per clause find an assignment satisfying as many clauses as possible.

27 Randomized algorithm Flip a fair coin for each variable. Assign the truth value of the variable according to the coin toss. Claim: The expected number of clauses satisfied is at least 7/8 m where m is the total number of clauses. We say that the algorithm has an expected approximation ratio of 8/7.

28 Analysis Let Y i be a random variable which is 1 if the i’th clause gets satisfied and 0 if not. Let Y be the total number of clauses satisfied. Pr[Y i =1] = 1 if the i’th clause contains some variable and its negation. Pr[Y i = 1] = 1 – (1/2) 3 = 7/8 if the i’th clause does not include a variable and its negation. E[Y i ] = Pr[Y i = 1] ¸ 7/8. E[Y] = E[  Y i ] =  E[Y i ] ¸ (7/8) m

29 Remarks It is possible to derandomize the algorithm, achieving a deterministic approximation algorithm with approximation ratio 8/7. Approximation ratio 8/7 -  is not possible for any constant  > 0 unless P=NP. Very hard to show (shown in 1997).