1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell (1872 - 1970)

Slides:



Advertisements
Similar presentations
Design and Analysis of Algorithms Approximation algorithms for NP-complete problems Haidong Xue Summer 2012, at GSU.
Advertisements

Great Theoretical Ideas in Computer Science for Some.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Approximation Algorithms for TSP
1 ©D.Moshkovitz Complexity The Traveling Salesman Problem.
End Topics Approximate Vertex Cover Approximate TSP Tour Computation of FFT P, NP, NP Complete, NP hard.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?
Combinatorial Algorithms
Minimum Spanning Trees Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
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.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
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.
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.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
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.
NP-Complete Problems Problems in Computer Science are classified into
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
1 Combinatorial Dominance Analysis Keywords: Combinatorial Optimization (CO) Approximation Algorithms (AA) Approximation Ratio (a.r) Combinatorial Dominance.
P, NP, and NP-Complete Suzan Köknar-Tezel.
An introduction to Approximation Algorithms Presented By Iman Sadeghi.
NP-complete and NP-hard problems. Decision problems vs. optimization problems The problems we are trying to solve are basically of two kinds. In decision.
Network Optimization Problems: Models and Algorithms
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
1 Approximation Algorithms. 2 Motivation By now we’ve seen many NP-Complete problems. We conjecture none of them has polynomial time algorithm.
Programming & Data Structures
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
The Traveling Salesperson Problem Algorithms and Networks.
The Traveling Salesman Problem Approximation
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
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
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Great Theoretical Ideas in Computer Science.
Approximation Algorithms
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
WK15. Vertex Cover and Approximation Algorithm By Lin, Jr-Shiun Choi, Jae Sung.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
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.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
David Luebke 1 2/18/2016 CS 332: Algorithms NP Completeness Continued: Reductions.
CSC 413/513: Intro to Algorithms
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Optimization problems such as
Lecture 2-2 NP Class.
An introduction to Approximation Algorithms Presented By Iman Sadeghi
Approximation Algorithms
Approximation Algorithms
Approximation Algorithms for TSP
Minimum Spanning Trees
Minimum Spanning Trees
Minimum Spanning Trees
Minimum Spanning Trees
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( ) * *TSP = Traveling Salesman Problem Based upon slides of Dana Moshkovitz

2 Approximation Algorithms A “good” algorithm is one whose running time is polynomial in the size of the input. Any hope of doing something in polynomial time for NP-Complete problems? Lets look at the Traveling Salesman Problem.

3 The Mission: A Tour Around the World

4 The Problem: Traveling Costs Money 1795$

5 Introduction Objectives: To explore the Traveling Salesman Problem. Overview: TSP: Formal definition & Examples TSP is NP-hard Approximation algorithm for special cases Hardness of Approximation in general.

6 TSP Given a weighted graph G=(V,E) V = Vertices = Cities E = Edges = Distances between cities Find the shortest tour that visits all cities

7 TSP Instance: A complete weighted undirected graph G=(V,E) (all weights are non-negative). Problem: To find a Hamiltonian cycle of minimal cost

8 Naïve Solution Try all possible tours and pick the minimum Dynamic Programming Definitely we need something better

9 What can we do? Give up on polynomial time algorithms? Try Heuristics by giving up on optimality? Try approximation algorithms?

10 Polynomial Algorithm for TSP? What about the greedy strategy: At any point, choose the closest vertex not explored yet?

11 The Greedy Strategy Fails   

12 The Greedy Strategy Fails   

13 Another Example Greedy strategy fails Even monkeys can do better than this !!!monkeys

14 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.

15 TSP is NP-hard Theorem: HAM-CYCLE  p TSP. Proof: By the straightforward efficient reduction illustrated below: HAM-CYCLETSP 1 cn n = k = |V| verify! cn

16 What Next? We will see what are approximation algorithms. We’ll show an approximation algorithm for TSP, with approximation factor 2 for cost functions that satisfy a certain property.

17 c -approximation algorithm The algorithm runs in polynomial time The algorithm always produces a solution which is within a factor of c of the value of the optimal solution c For all inputs x. OPT(x) here denotes the optimal value of the minimization problem

18 c -approximation algorithm The algorithm runs in polynomial time The algorithm always produces a solution which is within a factor of c of the value of the optimal solution c For all inputs x. OPT(x) here denotes the optimal value of the maximization problem

19 So why do we study Approximation Algorithms As algorithms to solve problems which need a solution As a mathematically rigorous way of studying heuristics Because they are fun! Because it tells us how hard problems are

20 TSP Is a minimization problem. We want a 2-approximation algorithm But only for the case when the cost function satisfies the triangle inequality.

21 The Triangle Inequality Cost Function: Let c(x,y) be the cost of going from city x to city y. Triangle Inequality: In most situations, going from x to y directly is no more expensive than going from x to y via an intermediate place z.

22 The Triangle Inequality Definition: We’ll say the cost function c satisfies the triangle inequality, if  x,y,z  V : c(x,z)+c(z,y)  c(x,y) x y z

23 Approximation Algorithm 1. Grow a Minimum Spanning Tree (MST) for G. 2. Return the cycle resulting from a preorder walk on that tree.

24 Demonstration and Analysis The cost of a minimal Hamiltonian cycle  the cost of a MST 

25 Demonstration and Analysis The cost of a preorder walk is twice the cost of the tree

26 Demonstration and Analysis Due to the triangle inequality, the Hamiltonian cycle is not worse.

27 The Bottom Line optimal HAM cycle MST preorder walk our HAM cycle  = ½·  ½·

28 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.

29 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|.

30 Instances min cost |V|  |V|    0  +1  0 0 1

31 What Should an Algorithm for gap-TSP Return? |V|  |V| YES!NO! min cost gap DON’T-CARE...

32 gap-TSP & Approximation Observation: Efficient approximation of factor  for TSP implies an efficient algorithm for gap-TSP[  ].

33 gap-TSP is NP-hard Theorem: For any constant  1, HAM-CYCLE  p gap-TSP[  ]. Proof Idea: Edges from G cost 1. Other edges cost much more.

34 The Reduction Illustrated HAM-CYCLEgap-TSP 1  |V| Verify (a) correctness (b) efficiency

35 Approximating TSP is NP- hard gap-TSP[  ] is NP-hard Approximating TSP within factor  is NP-hard

36 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. 

37 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. 