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

Similar documents
July 18, Approximation Algorithms (Travelling Salesman Problem)

VIII. NP-completeness

ABHELSINKI UNIVERSITY OF TECHNOLOGY

NP-Complete Problems and Approximation Algorithms

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

Tractable & Intractable Problems

ECS122A Handout on NP-Completeness March 12, 2018

Graduate Algorithms CS F-21 NP & Approximation Algorithms

NP-Complete Reductions 2

NP and Computational Intractability

Bounds on the Traveling Salesman Problem

Lecturer: Shuchi Chawla Topic: Inapproximability Date: 4/27/2007

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

More on NP and Reductions

NP Completeness and Approximation Algorithms

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

Lecture 6 January 21, 2013

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time

ACO Comprehensive Exam October 14 and 15, 2013

Lecture 4: NP and computational intractability

CS/COE

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam

NP-Complete Reductions 1

DAA Unit IV Complexity Theory Overview

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

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

SAT, Coloring, Hamiltonian Cycle, TSP

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

8.5 Sequencing Problems

Problem Complexity Classes

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

A Randomized Rounding Approach to the Traveling Salesman Problem

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

NP Complete Problems. COMP 215 Lecture 20

P,NP, NP-Hard and NP-Complete

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

On the Complexity of Budgeted Maximum Path Coverage on Trees

Week Cuts, Branch & Bound, and Lagrangean Relaxation

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

Classes of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:

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

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

BCCS: Computational methods for complex systems Wednesday, 16 June Lecture 3

Data Structures in Java

CS Fall 2011 P and NP Carola Wenk

2 Notation and Preliminaries

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

CSCI3390-Lecture 17: A sampler of NP-complete problems

Algorithms Design & Analysis. Approximation Algorithm

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

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

Traveling Salesman Problem

Algorithms: COMP3121/3821/9101/9801

Limitations of Algorithm Power

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Correctness of Dijkstra s algorithm

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

Polynomial-Time Reductions

ACO Comprehensive Exam October 18 and 19, Analysis of Algorithms

Topics in Complexity Theory

Lecture 4. 1 FPTAS - Fully Polynomial Time Approximation Scheme

Complexity, P and NP

Hamiltonian Cycle. Hamiltonian Cycle

Complexity of conditional colorability of graphs

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

Combinatorial Optimization

Data Structures and Algorithms (CSCI 340)

NP-complete Problems

Approximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs

1 Maximum Budgeted Allocation

REVISION SHEET DECISION MATHS 2 DECISION ANALYSIS

Nondeterministic Polynomial Time

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

Part III: Traveling salesman problems

The Greedy Algorithm for the Symmetric TSP

Approximation Algorithms for Re-optimization

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

Discrete Mathematics, Spring 2004 Homework 9 Sample Solutions

Lecture 13, Fall 04/05

Differential approximation results for the traveling salesman problem with distances 1 and 2

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.

Discrete Optimization 2010 Lecture 12 TSP, SAT & Outlook

Lecture 10 September 27, 2016

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

P vs. NP. Data Structures and Algorithms CSE AU 1

Branch-and-Bound. Leo Liberti. LIX, École Polytechnique, France. INF , Lecture p. 1

5 Flows and cuts in digraphs

P versus NP. Math 40210, Fall November 10, Math (Fall 2015) P versus NP November 10, / 9

Lecture 24: How to become Famous with P and NP

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

Notes for Lecture 21

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm

More Approximation Algorithms

Fractal Dimension and Lower Bounds for Geometric Problems

Independent sets and repeated degrees

Inner Product Spaces 6.1 Length and Dot Product in R n

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

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

AC64/AT64/ AC115/AT115 DESIGN & ANALYSIS OF ALGORITHMS

Transcription:

Decision Problems The theory of NP-completeness deals only with decision problems. Why? Because if a decision problem is hard, then the corresponding optimization problem must be hard too. For example, consider the following variants of the travelling salesperson problem. TSP Instance: A complete graph G with non-negative edge costs, and an integer B. Question: Does G have a Hamiltonian cycle of cost at most B? 1

TSP-OPT Instance: A complete graph G with non-negative costs on the edges. A minimum-cost Hamilto- Output: nian cycle. TSP is known to be NP-complete. Therefore, TSP-OPT is NP-hard, since if TSP-OPT can be solved in polynomial time, then TSP can also be solved in polynomial time using the obvious algorithm: 1. Find the min-cost Hamiltonian cycle. 2. Evaluate its cost. 3. See if the cost is B. 2

Approximability Some optimization problems (like TSP-OPT) are minimization problems, and some are maximization problems. We will deal only with minimization problems in this class the other case is very similar. An optimization problem is called ɛ-approximable if there exists a polynomial time algorithm that outputs a solution of cost C, when the optimal cost is C,andC/C ɛ. 3

TSP with Triangle Inequality For example, the travelling salesperson problem with the triangle inequality is 2-approximable. This means that there is a polynomial time algorithm that will find a Hamiltonian cycle that is only twice as expensive as the best one. The triangle inequality requires that for all vertices u, v, w, c(u, w) c(u, v) +c(v, w). An example of the travelling salesperson problem with the triangle inequality is to take the vertices to be dots on a page, and the cost to be Euclidean distance. 4

First of all, is TSP with the triangle inequality still NP-hard? It looks easier than TSP on general graphs, but that can be deceiving. Proof: We will reduce TSP-OPT to TSP with the triangle inequality. Let G be a complete graph with n vertices, and edge cost c(e) foralle =(u, v) V V. Define N = e E c(e). Replace each edge of cost c with a new edge of cost c + N. Firstly, we claim that the triangle inequality holds for the new graph. For all vertices u, v, w c(u, w) < 2N (since c<n) c(u, v)+c(v, w) 2N. Hence, c(u, w) c(u, v) +c(v, w) andthetriangle inequality is enforced. 5

Secondly, we claim that the min-cost Hamiltonian cycle is the same in both graphs. This reduction adds nn to the cost of each Hamiltonian cycle, and therefore preserves the relative cost of all tours. Therefore the cheapest Hamiltonian cycle in the original graph is the cheapest Hamiltonian cycle in the new graph. Therefore TSP-OPT is reducible in polynomial time to TSP with the triangle inequality. Since TSP-OPT is NP-hard, this implies that TSP with the triangle inequality is also NPhard. 6

The travelling salesperson problem with the triangle inequality is 2-approximable. Proof: The approximation algorithm proceeds as follows. Suppose we are given a graph G =(V,E). 1. Construct a min-cost spanning tree T for G. 2. Select any vertex as the root r. 3. List the vertices of T in preorder, starting at the root r. The preorder list is clearly a Hamiltonian cycle of G. Our algorithm runs in polynomial time since a min-cost spanning tree can be found by Prim s algorithm in time O(n 2 log n), and a preorder list of vertices can be found in time O(n). 7

8

Let c(c) be the cost of the optimal Hamiltonian cycle C, and c(t ) be the cost of our min-cost spanning tree, T. Since deleting an edge from a Hamiltonian cycle results in a spanning tree S for G, c(t ) c(s) c(c). We claim that the Hamiltonian cycle output by our algorithm has cost at most 2c(T ), which by the previous sentence is at most 2c(C), that is, twice the cost of the optimum tour. This follows because the preorder traversal of T uses each edge twice and hence has cost 2c(T ), whereas the tour defined by the preorder list of vertices must, by the triangle inequality, have smaller cost 9

The same, unfortunately, is not true of TSP in general. For all ɛ 1, TSP is not ɛ- approximable unless P=NP. Proof: Suppose P NP. We will use the fact that the Hamiltonian cycle problem (given a graph, does it have a Hamiltonian cycle) is NP-complete. For a contradiction, suppose that TSP is ɛ- approximable. We will show that this implies P = NP by constructing a polynomial time algorithm for the Hamiltonian cycle problem. Given a graph G =(V,E), construct a complete graph G =(V,E ), where E = V V, where for all u, v V, c(u, v) = { 1 if (u, v) E ɛn + 1 otherwise. 10

If G has a Hamiltonian cycle, then G has a TSP tour of cost n. Conversely, if G has no Hamiltonian cycle, then all Hamiltonian cycles in G must use at least one edge of cost ɛn+1, and hence must cost at least (ɛn +1)+(n 1) = ɛn + n>ɛn. Run the polynomial time ɛ-approximation algorithm for TSP on input G. If it returns a cost of at most ɛn, theng has a Hamiltonian cycle. If it returns a cost greater than ɛn, then G does not have a Hamiltonian cycle. 11