Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

The Traveling Salesman Problem

1
The Mission:
A Tour Around the World

2
The Problem:
Traveling Costs Money

1795$

3
Introduction

Objectives:

◦ To explore the Traveling Salesman Problem.


Overview:
◦ 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 2 10
3 4

5
5
Polynomial Algorithm for TSP?

What about the greedy strategy:


At any point, choose the closest vertex not
explored yet?

6
The Greedy $trategy Fails

10

 

12 5
2  3

1 0

7
The Greedy $trategy Fails

10

 

12 5
2  3

1 0

8
TSP as decision problem
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.

9
TSP is NP-hard
verify!
Theorem: HAM-CYCLE p TSP.
Proof: By the straightforward efficient reduction
illustrated below:
0
0 1
0 1 k=0

HAM-CYCLE TSP

10
What Next?

We’ll show an approximation


algorithm for TSP,
which yields a ratio-bound of 2
for cost functions which satisfy a
certain property.

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)

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

13
abcbhbadefegeda

a d T a d T a d
e e e
b f g b f g b f g
c h c h c h

optimal
T a d a d solution
e e
b f g b f g
c h H c h H*
abchdefga
Theorem 35.2. APPROX_TSP_TOUR is an approximation
algorithm with ratio bound of 2 for TSP with triangular
inequality.
Proof.
c(T )  c( H *)

c(W )  2c(T )  2c( H *)

c( H )  c(W )

 c( H )  2c( H *)
Demonstration and Analysis
C(T) ≤ C(H*)
The cost of a
minimal hamiltonian 
cycle  the cost of a
MST

16
Demonstration and Analysis

The cost of a C(W) = 2C(T) ≤2C(H*)

preorder walk is
twice the cost of
the tree

17
Demonstration and Analysis

Due to the triangle


inequality, the
hamiltonian cycle is
not worse.

C(H) ≤C(W) ≤2C(H*)


18
Reference
datasearch.ruc.edu.cn/course/
algorithm2010/slides/approximation.ppt

You might also like