July 18, Approximation Algorithms (Travelling Salesman Problem)

Similar documents
Decision Problems TSP. Instance: A complete graph G with non-negative edge costs, and an integer

ABHELSINKI UNIVERSITY OF TECHNOLOGY

NP-Complete Problems and Approximation Algorithms

Tractable & Intractable Problems

Today s Outline. CS 362, Lecture 24. The Reduction. Hamiltonian Cycle. Reduction Wrapup Approximation algorithms for NP-Hard Problems

VIII. NP-completeness

ECS122A Handout on NP-Completeness March 12, 2018

Algorithms Design & Analysis. Approximation Algorithm

CS/COE

SAT, Coloring, Hamiltonian Cycle, TSP

Hamiltonian Cycle. Hamiltonian Cycle

NP and Computational Intractability

Graduate Algorithms CS F-21 NP & Approximation Algorithms

CS 561, Lecture 12. Jared Saia University of New Mexico

NP-Completeness. Until now we have been designing algorithms for specific problems

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

Bounds on the Traveling Salesman Problem

4. How to prove a problem is NPC

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

Week Cuts, Branch & Bound, and Lagrangean Relaxation

Combinatorial Optimization

Data Structures and Algorithms (CSCI 340)

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

2 Notation and Preliminaries

Chapter 34: NP-Completeness

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Algorithm Design Strategies V

Data Structures in Java

A New Approximation Algorithm for the Asymmetric TSP with Triangle Inequality By Markus Bläser

DAA Unit IV Complexity Theory Overview

ACO Comprehensive Exam October 14 and 15, 2013

Algorithms: COMP3121/3821/9101/9801

15.081J/6.251J Introduction to Mathematical Programming. Lecture 24: Discrete Optimization

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Polynomial-Time Reductions

CSL 356: Analysis and Design of Algorithms. Ragesh Jaiswal CSE, IIT Delhi

Lecture 6 January 21, 2013

Design and Analysis of Algorithms May 12, 2011 Massachusetts Institute of Technology. Practice Final Exam. Problem Title Points Parts Grade Initials

Travelling Salesman Problem

ON COST MATRICES WITH TWO AND THREE DISTINCT VALUES OF HAMILTONIAN PATHS AND CYCLES

8.3 Hamiltonian Paths and Circuits

Institute of Operating Systems and Computer Networks Algorithms Group. Network Algorithms. Tutorial 3: Shortest paths and other stuff

8.5 Sequencing Problems

NP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.

NP-completeness. Chapter 34. Sergey Bereg

CS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle

1. Introduction Recap

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

University of Washington March 21, 2013 Department of Computer Science and Engineering CSEP 521, Winter Exam Solution, Monday, March 18, 2013

Outline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm

NP Completeness and Approximation Algorithms

from notes written mostly by Dr. Matt Stallmann: All Rights Reserved

Discrete Optimization 2010 Lecture 8 Lagrangian Relaxation / P, N P and co-n P

1. (a) Explain the asymptotic notations used in algorithm analysis. (b) Prove that f(n)=0(h(n)) where f(n)=0(g(n)) and g(n)=0(h(n)).

CHAPTER 3 FUNDAMENTALS OF COMPUTATIONAL COMPLEXITY. E. Amaldi Foundations of Operations Research Politecnico di Milano 1

Lecture 4: NP and computational intractability

9.1 HW (3+3+8 points) (Knapsack decision problem NP-complete)

Relaxations and Bounds. 6.1 Optimality and Relaxations. Suppose that we are given an IP. z = max c T x : x X,

Algorithms and Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005

Who Has Heard of This Problem? Courtesy: Jeremy Kun

Approximating the minimum quadratic assignment problems

Graph Theory and Optimization Computational Complexity (in brief)

Today: NP-Completeness (con t.)

NP-Complete Problems. More reductions

New Integer Programming Formulations of the Generalized Travelling Salesman Problem

Traveling Salesman Problem

Lecture 15 - NP Completeness 1

NP-complete Problems

Nondeterministic Polynomial Time

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Polynomial-time Reductions

Check off these skills when you feel that you have mastered them. Write in your own words the definition of a Hamiltonian circuit.

Approximability of Connected Factors

2. A vertex in G is central if its greatest distance from any other vertex is as small as possible. This distance is the radius of G.

NP Complete Problems. COMP 215 Lecture 20

Recent Progress in Approximation Algorithms for the Traveling Salesman Problem

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

Scheduling and Optimization Course (MPRI)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Unit 1A: Computational Complexity

Evolutionary Trees. Evolutionary tree. To describe the evolutionary relationship among species A 3 A 2 A 4. R.C.T. Lee and Chin Lung Lu

Research Collection. Grid exploration. Master Thesis. ETH Library. Author(s): Wernli, Dino. Publication Date: 2012

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Multi-Criteria TSP: Min and Max Combined

1 Review of Vertex Cover

Polynomial-time reductions. We have seen several reductions:

Sublinear-Time Algorithms

Computational Intractability 2010/4/15. Lecture 2

NP-Completeness. NP-Completeness 1

Quantum Algorithms for Graph Traversals and Related Problems

Chapter 3: Discrete Optimization Integer Programming

Approximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs

Intro to Contemporary Math

NP-Complete Reductions 1

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

The traveling salesman problem

Transcription:

Approximation Algorithms (Travelling Salesman Problem) July 18, 2014

The travelling-salesman problem Problem: given complete, undirected graph G = (V, E) with non-negative integer cost c(u, v) for each edge, find cheapest Hamiltonian cycle of G. Consider two cases: with and without triangle inequality. c satisfies triangle inequality, if it is always cheapest to go directly from some u to some w; going by way of intermediate vertices can t be less expensive. Finding an optimal solution is NP-complete in both cases.

Suppose C is a cheapest hamiltonian cycle (tour). By removing one edge from C we obtain a path and this path is a spanning tree for G.

Suppose C is a cheapest hamiltonian cycle (tour). By removing one edge from C we obtain a path and this path is a spanning tree for G. Therefore the cost of C minus an edge is more than the cost of a minimum spanning tree (MST).

Suppose C is a cheapest hamiltonian cycle (tour). By removing one edge from C we obtain a path and this path is a spanning tree for G. Therefore the cost of C minus an edge is more than the cost of a minimum spanning tree (MST). Let T be a spanning tree of G then pre-order walk of T is a sequence of the vertices of T in DFS and its return.

Suppose C is a cheapest hamiltonian cycle (tour). By removing one edge from C we obtain a path and this path is a spanning tree for G. Therefore the cost of C minus an edge is more than the cost of a minimum spanning tree (MST). Let T be a spanning tree of G then pre-order walk of T is a sequence of the vertices of T in DFS and its return. a b f DFS : a, b, c, d, e, f, g c d g e Pre order walk : a, b, c, b, d, e, d, b, a, f, g, f, a

TSP with triangle inequality We compute a minimum spanning tree whose weight is lower bound for length of optimal TSP tour. We use function MSTPrim(G, c, r), which computes an MST for G and weight function c, given some arbitrary root r. Approx-TSP-Tour (G = (V, E), c : E R ) 1. Select arbitrary r V to be root 2. Compute MST T for G and c from root r using MSTPrim(G, c, r) 3. Let L be list of vertices visited in pre-order tree walk of T 4. Return the Hamiltonian cycle that visits the vertices in the order L

a a a a a Set of points, lie in grid MST, root a Pre order walk Resulting tour, cost ca. 19.1 Optimal tour, cost ca. 14.7 a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer.

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour.

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour. Let H denote an optimal tour for given set of vertices.

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour. Let H denote an optimal tour for given set of vertices. Deleting any edge from H gives a spanning tree.

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour. Let H denote an optimal tour for given set of vertices. Deleting any edge from H gives a spanning tree. Thus, weight of minimum spanning tree is lower bound on cost of optimal tour: c(t ) c(h )

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour. Let H denote an optimal tour for given set of vertices. Deleting any edge from H gives a spanning tree. Thus, weight of minimum spanning tree is lower bound on cost of optimal tour: c(t ) c(h ) A full walk of T lists vertices when they are first visited, and also when they are returned to, after visiting a subtree.

Theorem Approx-TSP-Tour is a polynomial time 2-approximation algorithm for the TSP problem with triangle inequality. Proof. Polynomial running time obvious, simple MSTPrim takes θ( V 2 ), computing pre-order walk takes no longer. Correctness obvious, pre-order walk is always a tour. Let H denote an optimal tour for given set of vertices. Deleting any edge from H gives a spanning tree. Thus, weight of minimum spanning tree is lower bound on cost of optimal tour: c(t ) c(h ) A full walk of T lists vertices when they are first visited, and also when they are returned to, after visiting a subtree. Example: a,b,c,b,h,b,a,d,e,f,e,g,e,d,a

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T )

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H )

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H ) Find a connection between cost of W and cost of our tour.

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H ) Find a connection between cost of W and cost of our tour. Problem: W is in general not a proper tour, since vertices may be visited more than once.

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H ) Find a connection between cost of W and cost of our tour. Problem: W is in general not a proper tour, since vertices may be visited more than once. But: using the triangle inequality, we can delete a visit to any vertex from W and cost does not increase.

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H ) Find a connection between cost of W and cost of our tour. Problem: W is in general not a proper tour, since vertices may be visited more than once. But: using the triangle inequality, we can delete a visit to any vertex from W and cost does not increase. Deleting a vertex v from walk W between visits to u and w means going from u directly to w, without visiting v.

Proof. Full walk W traverses every edge exactly twice, thus c(w ) = 2c(T ) Together with c(t ) c(h ), this gives c(w ) = 2c(T ) 2c(H ) Find a connection between cost of W and cost of our tour. Problem: W is in general not a proper tour, since vertices may be visited more than once. But: using the triangle inequality, we can delete a visit to any vertex from W and cost does not increase. Deleting a vertex v from walk W between visits to u and w means going from u directly to w, without visiting v. We can consecutively remove all multiple visits to any vertex. Example: full walk a,b,c,b,h,b,a,d,e,f,e,g,e,d,a becomes a,b,c,h,d,e,f,g.

Proof. This ordering (with multiple visits deleted) is identical to that obtained by pre-order walk of T (with each vertex visited only once).

Proof. This ordering (with multiple visits deleted) is identical to that obtained by pre-order walk of T (with each vertex visited only once). It certainly is a Hamiltonian cycle. Let s call it H.

Proof. This ordering (with multiple visits deleted) is identical to that obtained by pre-order walk of T (with each vertex visited only once). It certainly is a Hamiltonian cycle. Let s call it H. H is just what is computed by Approx-TSP-Tour.

Proof. This ordering (with multiple visits deleted) is identical to that obtained by pre-order walk of T (with each vertex visited only once). It certainly is a Hamiltonian cycle. Let s call it H. H is just what is computed by Approx-TSP-Tour. H is obtained by deleting vertices from W, thus c(h) c(w )

Proof. This ordering (with multiple visits deleted) is identical to that obtained by pre-order walk of T (with each vertex visited only once). It certainly is a Hamiltonian cycle. Let s call it H. H is just what is computed by Approx-TSP-Tour. H is obtained by deleting vertices from W, thus c(h) c(w ) Conclusion: c(h) c(w ) 2c(H ) (1)

Although factor 2 looks nice, there are better algorithms.

Although factor 2 looks nice, there are better algorithms. There s a 3/2 approximation algorithm by Christofedes (with triangle inequality).

Although factor 2 looks nice, there are better algorithms. There s a 3/2 approximation algorithm by Christofedes (with triangle inequality). In The general TSP Cost function c does not satisfy triangle inequality.

Although factor 2 looks nice, there are better algorithms. There s a 3/2 approximation algorithm by Christofedes (with triangle inequality). In The general TSP Cost function c does not satisfy triangle inequality. Theorem If P NP, then for any constant ρ 1, there is no polynomial time ρ-approximation algorithm for the general TSP.