The Traveling Salesman Problem D Moshkovitz Complexity 1
The Traveling Salesman Problem ©D. Moshkovitz Complexity 1
The Mission: A Tour Around the World ©D. Moshkovitz Complexity 2
The Problem: Traveling Costs Money 1795$ ©D. Moshkovitz Complexity 3
Introduction • Objectives: – To explore the Traveling Salesman Problem. • Overview: – – ©D. Moshkovitz Complexity TSP: Formal definition & Examples TSP is NP-hard Approximation algorithm for special cases Inapproximability result 4
TSP • Instance: a complete weighted undirected graph G=(V, E) (all weights are non-negative). • Problem: to find a Hamiltonian cycle of minimal cost. 3 1 3 4 2 10 5 ©D. Moshkovitz Complexity 5
Polynomial Algorithm for TSP? What about the greedy strategy: At any point, choose the closest vertex not explored yet? ©D. Moshkovitz Complexity 6
The Greedy $trategy Fails 10 2 5 12 3 1 ©D. Moshkovitz Complexity 0 7
The Greedy $trategy Fails 10 2 5 12 3 1 ©D. Moshkovitz Complexity 0 8
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 cycle whose cost is at most k. ©D. Moshkovitz Complexity 9
TSP is NP-hard verify! Theorem: HAM-CYCLE p TSP. Proof: By the straightforward efficient reduction illustrated below: 1 1 2 k=|V| 1 HAM-CYCLE ©D. Moshkovitz Complexity TSP 10
What Next? • We’ll show an approximation algorithm for TSP, • with approximation factor 2 • for cost functions that satisfy a certain property. ©D. Moshkovitz Complexity 11
The Triangle Inequality Definition: We’ll say the cost function c satisfies the triangle inequality, if u, v, w V : c(u, v)+c(v, w) c(u, w) ©D. Moshkovitz Complexity 12
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. ©D. Moshkovitz Complexity 13
Demonstration and Analysis The cost of a minimal Hamiltonian cycle the cost of a MST ©D. Moshkovitz Complexity 14
Demonstration and Analysis The cost of a preorder walk is twice the cost of the tree ©D. Moshkovitz Complexity 15
Demonstration and Analysis Due to the triangle inequality, the Hamiltonian cycle is not worse. ©D. Moshkovitz Complexity 16
The Bottom Line optimal HAM cycle ©D. Moshkovitz Complexity MST = ½· preorder walk ½· our HAM cycle 17
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. ©D. Moshkovitz Complexity 18
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|. ©D. Moshkovitz Complexity 19
Instances 1 1 1 min cost |V| 0 1 0 0 ©D. Moshkovitz Complexity +1 20
What Should an Algorithm for gap-TSP Return? YES! NO! |V| DON’T-CARE. . . min cost |V| gap ©D. Moshkovitz Complexity 21
gap-TSP & Approximation Observation: Efficient approximation of factor for TSP implies an efficient algorithm for gap-TSP[ ]. ©D. Moshkovitz Complexity 22
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. ©D. Moshkovitz Complexity 23
The Reduction Illustrated 1 1 |V|+1 1 HAM-CYCLE gap-TSP Verify (a) correctness (b) efficiency ©D. Moshkovitz Complexity 24
Approximating TSP is NPhard gap-TSP[ ] is NP-hard Approximating TSP within factor is NP-hard ©D. Moshkovitz Complexity 25
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. ©D. Moshkovitz Complexity 26
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. ©D. Moshkovitz Complexity 27
- Slides: 27