VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem...

141
VI. Approximation Algorithms: Travelling Salesman Problem Thomas Sauerwald Easter 2015

Transcript of VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem...

Page 1: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

VI. Approximation Algorithms: TravellingSalesman ProblemThomas Sauerwald

Easter 2015

Page 2: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Outline

Introduction

General TSP

Metric TSP

VI. Travelling Salesman Problem Introduction 2

Page 3: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 92 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 4: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 92 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 5: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 92 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 6: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 92 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 7: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 92 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 8: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 9: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 10: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 11: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 12: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special Instances

Even this version isNP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 13: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special Instances

Even this version isNP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 14: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special Instances

Even this version isNP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 15: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Traveling Salesman Problem (TSP)

Given a set of cities along with the cost of travel between them, findthe cheapest route visiting all cities and returning to your starting point.

Given: A complete undirected graph G = (V ,E) withnonnegative integer cost c(u, v) for each edge (u, v) ∈ E

Goal: Find a hamiltonian cycle of G with minimum cost.

Formal Definition

Solution space consists of n! possible tours!

Actually the right number is (n − 1)!/2

3

1

2 1

4

3

3 + 2 + 1 + 3 = 9

2 + 4 + 1 + 1 = 8

Metric TSP: costs satisfy triangle inequality:

∀u, v ,w ∈ V : c(u,w) ≤ c(u, v) + c(v ,w).

Euclidean TSP: cities are points in the Euclidean space, costs areequal to their Euclidean distance

Special InstancesEven this version is

NP hard (Ex. 35.2-2)

VI. Travelling Salesman Problem Introduction 3

Page 16: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

History of the TSP problem (1954)

Dantzig, Fulkerson and Johnson found an optimal tour through 42 cities.

http://www.math.uwaterloo.ca/tsp/history/img/dantzig_big.html

VI. Travelling Salesman Problem Introduction 4

Page 17: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )

2. Solve the linear program. If the solution is integral and forms a tour, stop.Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 18: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 19: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 20: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 21: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)

(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 22: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)

(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 23: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)

(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 24: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)

(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 25: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)

(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 26: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The Dantzig-Fulkerson-Johnson Method

1. Create a linear program (variable x(u, v) = 1 iff tour goes between u and v )2. Solve the linear program. If the solution is integral and forms a tour, stop.

Otherwise find a new constraint to add (cutting plane)

0 1 2 3 4 5 6 7 8 9

1

2

3

4

5

max 13 x + y

4x1 + 9x2 ≤ 36

2x1 − 9x2 ≤ −27

x1

x2

x2 ≤ 3

Additional constraint to cutthe solution space of the LP

(3.3, 1.5)(2.25, 3)

(2, 3)

More cuts are needed to find integral solution

VI. Travelling Salesman Problem Introduction 5

Page 27: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Outline

Introduction

General TSP

Metric TSP

VI. Travelling Salesman Problem General TSP 6

Page 28: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 29: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof:

Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 30: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 31: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problem

Let G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 32: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problem

Let G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 33: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 34: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 35: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 36: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 37: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 38: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 39: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 40: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |

If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 41: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |

If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 42: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |

If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 43: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |

If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 44: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 45: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1

�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 46: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 47: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 48: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 49: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 50: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1)

= (ρ+ 1)|V |.Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 51: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1) = (ρ+ 1)|V |.

Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 52: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1) = (ρ+ 1)|V |.Gap of ρ+ 1 between tours which are using only edges in G and those which don’t

ρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 53: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1) = (ρ+ 1)|V |.Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 54: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Hardness of Approximation

If P 6= NP, then for any constant ρ ≥ 1, there is no polynomial-time ap-proximation algorithm with approximation ratio ρ for the general TSP.

Theorem 35.3

Proof: Idea: Reduction from the hamiltonian-cycle problem.

Let G = (V ,E) be an instance of the hamiltonian-cycle problemLet G′ = (V ,E ′) be a complete graph with costs for each (u, v) ∈ E ′:

c(u, v) =

{1 if (u, v) ∈ E ,ρ|V |+ 1 otherwise.

If G has a hamiltonian cycle H, then (G′, c) contains a tour of cost |V |If G does not have a hamiltonian cycle, then any tour T must use some edge 6∈ E ,

⇒ c(T ) ≥ (ρ|V |+ 1) + (|V | − 1) = (ρ+ 1)|V |.Gap of ρ+ 1 between tours which are using only edges in G and those which don’tρ-Approximation of TSP in G′ computes hamiltonian cycle in G (if one exists)

Large weight will renderthis edge useless!

Can create representations of G′ andc in time polynomial in |V | and |E |!

G = (V ,E)

Reduction

G′ = (V ,E ′)

1

1

1

1ρ · 4 + 1

1�1

ρ · 4 + 1

VI. Travelling Salesman Problem General TSP 7

Page 55: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 56: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 57: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 58: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 59: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 60: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 61: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of Theorem 35.3 from a higher perspective

x

y

f (x)

f (y)

f

f

instances of Hamilton instances of TSP

All instances with ahamiltonian cycle

All instanceswith cost ≤ k

All instanceswith cost ≥ ρ · k

General Method to prove inapproximability results!

VI. Travelling Salesman Problem General TSP 8

Page 62: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Outline

Introduction

General TSP

Metric TSP

VI. Travelling Salesman Problem Metric TSP 9

Page 63: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The TSP Problem with the Triangle Inequality

Idea: First compute an MST, and then create a tour based on the tree.

1112 Chapter 35 Approximation Algorithms

c.A/ DX

.u;!/2A

c.u; !/ :

In many practical situations, the least costly way to go from a place u to a place wis to go directly, with no intermediate steps. Put another way, cutting out an inter-mediate stop never increases the cost. We formalize this notion by saying that thecost function c satisfies the triangle inequality if, for all vertices u; !; w 2 V ,c.u; w/ ! c.u; !/C c.!; w/ :

The triangle inequality seems as though it should naturally hold, and it is au-tomatically satisfied in several applications. For example, if the vertices of thegraph are points in the plane and the cost of traveling between two vertices is theordinary euclidean distance between them, then the triangle inequality is satisfied.Furthermore, many cost functions other than euclidean distance satisfy the triangleinequality.

As Exercise 35.2-2 shows, the traveling-salesman problem is NP-complete evenif we require that the cost function satisfy the triangle inequality. Thus, we shouldnot expect to find a polynomial-time algorithm for solving this problem exactly.Instead, we look for good approximation algorithms.

In Section 35.2.1, we examine a 2-approximation algorithm for the traveling-salesman problem with the triangle inequality. In Section 35.2.2, we show thatwithout the triangle inequality, a polynomial-time approximation algorithm with aconstant approximation ratio does not exist unless P D NP.

35.2.1 The traveling-salesman problem with the triangle inequalityApplying the methodology of the previous section, we shall first compute a struc-ture—a minimum spanning tree—whose weight gives a lower bound on the lengthof an optimal traveling-salesman tour. We shall then use the minimum spanningtree to create a tour whose cost is no more than twice that of the minimum spanningtree’s weight, as long as the cost function satisfies the triangle inequality. The fol-lowing algorithm implements this approach, calling the minimum-spanning-treealgorithm MST-PRIM from Section 23.2 as a subroutine. The parameter G is acomplete undirected graph, and the cost function c satisfies the triangle inequality.APPROX-TSP-TOUR.G; c/

1 select a vertex r 2 G:V to be a “root” vertex2 compute a minimum spanning tree T for G from root r

using MST-PRIM.G; c; r/3 let H be a list of vertices, ordered according to when they are first visited

in a preorder tree walk of T4 return the hamiltonian cycle H

Runtime is dominated by MST-PRIM, which is Θ(V 2).

VI. Travelling Salesman Problem Metric TSP 10

Page 64: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The TSP Problem with the Triangle Inequality

Idea: First compute an MST, and then create a tour based on the tree.

1112 Chapter 35 Approximation Algorithms

c.A/ DX

.u;!/2A

c.u; !/ :

In many practical situations, the least costly way to go from a place u to a place wis to go directly, with no intermediate steps. Put another way, cutting out an inter-mediate stop never increases the cost. We formalize this notion by saying that thecost function c satisfies the triangle inequality if, for all vertices u; !; w 2 V ,c.u; w/ ! c.u; !/C c.!; w/ :

The triangle inequality seems as though it should naturally hold, and it is au-tomatically satisfied in several applications. For example, if the vertices of thegraph are points in the plane and the cost of traveling between two vertices is theordinary euclidean distance between them, then the triangle inequality is satisfied.Furthermore, many cost functions other than euclidean distance satisfy the triangleinequality.

As Exercise 35.2-2 shows, the traveling-salesman problem is NP-complete evenif we require that the cost function satisfy the triangle inequality. Thus, we shouldnot expect to find a polynomial-time algorithm for solving this problem exactly.Instead, we look for good approximation algorithms.

In Section 35.2.1, we examine a 2-approximation algorithm for the traveling-salesman problem with the triangle inequality. In Section 35.2.2, we show thatwithout the triangle inequality, a polynomial-time approximation algorithm with aconstant approximation ratio does not exist unless P D NP.

35.2.1 The traveling-salesman problem with the triangle inequalityApplying the methodology of the previous section, we shall first compute a struc-ture—a minimum spanning tree—whose weight gives a lower bound on the lengthof an optimal traveling-salesman tour. We shall then use the minimum spanningtree to create a tour whose cost is no more than twice that of the minimum spanningtree’s weight, as long as the cost function satisfies the triangle inequality. The fol-lowing algorithm implements this approach, calling the minimum-spanning-treealgorithm MST-PRIM from Section 23.2 as a subroutine. The parameter G is acomplete undirected graph, and the cost function c satisfies the triangle inequality.APPROX-TSP-TOUR.G; c/

1 select a vertex r 2 G:V to be a “root” vertex2 compute a minimum spanning tree T for G from root r

using MST-PRIM.G; c; r/3 let H be a list of vertices, ordered according to when they are first visited

in a preorder tree walk of T4 return the hamiltonian cycle H

Runtime is dominated by MST-PRIM, which is Θ(V 2).

VI. Travelling Salesman Problem Metric TSP 10

Page 65: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

The TSP Problem with the Triangle Inequality

Idea: First compute an MST, and then create a tour based on the tree.

1112 Chapter 35 Approximation Algorithms

c.A/ DX

.u;!/2A

c.u; !/ :

In many practical situations, the least costly way to go from a place u to a place wis to go directly, with no intermediate steps. Put another way, cutting out an inter-mediate stop never increases the cost. We formalize this notion by saying that thecost function c satisfies the triangle inequality if, for all vertices u; !; w 2 V ,c.u; w/ ! c.u; !/C c.!; w/ :

The triangle inequality seems as though it should naturally hold, and it is au-tomatically satisfied in several applications. For example, if the vertices of thegraph are points in the plane and the cost of traveling between two vertices is theordinary euclidean distance between them, then the triangle inequality is satisfied.Furthermore, many cost functions other than euclidean distance satisfy the triangleinequality.

As Exercise 35.2-2 shows, the traveling-salesman problem is NP-complete evenif we require that the cost function satisfy the triangle inequality. Thus, we shouldnot expect to find a polynomial-time algorithm for solving this problem exactly.Instead, we look for good approximation algorithms.

In Section 35.2.1, we examine a 2-approximation algorithm for the traveling-salesman problem with the triangle inequality. In Section 35.2.2, we show thatwithout the triangle inequality, a polynomial-time approximation algorithm with aconstant approximation ratio does not exist unless P D NP.

35.2.1 The traveling-salesman problem with the triangle inequalityApplying the methodology of the previous section, we shall first compute a struc-ture—a minimum spanning tree—whose weight gives a lower bound on the lengthof an optimal traveling-salesman tour. We shall then use the minimum spanningtree to create a tour whose cost is no more than twice that of the minimum spanningtree’s weight, as long as the cost function satisfies the triangle inequality. The fol-lowing algorithm implements this approach, calling the minimum-spanning-treealgorithm MST-PRIM from Section 23.2 as a subroutine. The parameter G is acomplete undirected graph, and the cost function c satisfies the triangle inequality.APPROX-TSP-TOUR.G; c/

1 select a vertex r 2 G:V to be a “root” vertex2 compute a minimum spanning tree T for G from root r

using MST-PRIM.G; c; r/3 let H be a list of vertices, ordered according to when they are first visited

in a preorder tree walk of T4 return the hamiltonian cycle H

Runtime is dominated by MST-PRIM, which is Θ(V 2).

VI. Travelling Salesman Problem Metric TSP 10

Page 66: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST

X

2. Perform preorder walk on MST

X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 67: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST

X

2. Perform preorder walk on MST

X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 68: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST

X

2. Perform preorder walk on MST

X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 69: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST

X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 70: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST

X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 71: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 72: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 73: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 74: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 75: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 76: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 77: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 78: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 79: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk

X

VI. Travelling Salesman Problem Metric TSP 11

Page 80: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 81: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!

Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 82: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 83: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!

Better solution, yet still not optimal!

This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 84: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 85: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of APPROX-TSP-TOUR

a d

b f

e

g

c

h

Solution has cost ≈ 19.704 - not optimal!Better solution, yet still not optimal!

This is the optimal solution (cost ≈ 14.715).

1. Compute MST X

2. Perform preorder walk on MST X

3. Return list of vertices according to the preorder tree walk X

VI. Travelling Salesman Problem Metric TSP 11

Page 86: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:

Consider the optimal tour H∗ and remove one edge⇒ yields a spanning tree and therefore

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 87: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:

Consider the optimal tour H∗ and remove one edge⇒ yields a spanning tree and therefore

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 88: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:

Consider the optimal tour H∗ and remove one edge⇒ yields a spanning tree and therefore

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 89: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:

Consider the optimal tour H∗ and remove one edge⇒ yields a spanning tree and therefore

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 90: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and thereforeLet W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 91: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and thereforeLet W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 92: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 93: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 94: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)

Let W be the full walk of the spanning tree T (including repeated visits)⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 95: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 96: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSP

minimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 97: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 98: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, so

c(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 99: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T )

≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 100: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 101: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 102: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree T

Walk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 103: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)

Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 104: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 105: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H with smaller cost:

c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 106: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H with smaller cost:c(H) ≤ c(W )

≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 107: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H with smaller cost:c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 108: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H with smaller cost:c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 109: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Proof of the Approximation Ratio

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Proof:Consider the optimal tour H∗ and remove one edge

⇒ yields a spanning tree and therefore c(T ) ≤ c(H∗)Let W be the full walk of the spanning tree T (including repeated visits)

⇒ Full walk traverses every edge exactly twice, soc(W ) = 2c(T ) ≤ 2c(H∗)

Deleting duplicate vertices from W yields a tour H with smaller cost:c(H) ≤ c(W ) ≤ 2c(H∗)

exploiting that all edgecosts are non-negative!

exploiting triangle inequality!

a d

b f

e

g

c

h

solution H of APPROX-TSPminimum spanning tree TWalk W = (a, b, c, b, h, b, a, d, e, f , e, g, e, d, a)Walk W = (a, b, c,�b, h,�b, �a, d, e, f ,�e, g,�e,�d, a)

Tour H = (a, b, c, h, d, e, f , g, a)

a d

b f

e

g

c

h

optimal solution H∗

spanning tree as a subset of H∗

VI. Travelling Salesman Problem Metric TSP 12

Page 110: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Christofides Algorithm

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Can we get a better approximation ratio?

CHRISTOFIDES(G, c)1: select a vertex r ∈ G.V to be a “root” vertex2: compute a minimum spanning tree T for G from root r3: using MST-PRIM(G, c, r)4: compute a perfect matching M with minimum weight in the complete graph5: over the odd-degree vertices in T6: let H be a list of vertices, ordered according to when they are first visited7: in a Eulearian circuit of T ∪M8: return H

There is a polynomial-time 32 -approximation algorithm for the travelling salesman

problem with the triangle inequality.

Theorem (Christofides’76)

VI. Travelling Salesman Problem Metric TSP 13

Page 111: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Christofides Algorithm

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Can we get a better approximation ratio?

CHRISTOFIDES(G, c)1: select a vertex r ∈ G.V to be a “root” vertex2: compute a minimum spanning tree T for G from root r3: using MST-PRIM(G, c, r)4: compute a perfect matching M with minimum weight in the complete graph5: over the odd-degree vertices in T6: let H be a list of vertices, ordered according to when they are first visited7: in a Eulearian circuit of T ∪M8: return H

There is a polynomial-time 32 -approximation algorithm for the travelling salesman

problem with the triangle inequality.

Theorem (Christofides’76)

VI. Travelling Salesman Problem Metric TSP 13

Page 112: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Christofides Algorithm

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Can we get a better approximation ratio?

CHRISTOFIDES(G, c)1: select a vertex r ∈ G.V to be a “root” vertex2: compute a minimum spanning tree T for G from root r3: using MST-PRIM(G, c, r)4: compute a perfect matching M with minimum weight in the complete graph5: over the odd-degree vertices in T6: let H be a list of vertices, ordered according to when they are first visited7: in a Eulearian circuit of T ∪M8: return H

There is a polynomial-time 32 -approximation algorithm for the travelling salesman

problem with the triangle inequality.

Theorem (Christofides’76)

VI. Travelling Salesman Problem Metric TSP 13

Page 113: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Christofides Algorithm

APPROX-TSP-TOUR is a polynomial-time 2-approximation for thetraveling-salesman problem with the triangle inequality.

Theorem 35.2

Can we get a better approximation ratio?

CHRISTOFIDES(G, c)1: select a vertex r ∈ G.V to be a “root” vertex2: compute a minimum spanning tree T for G from root r3: using MST-PRIM(G, c, r)4: compute a perfect matching M with minimum weight in the complete graph5: over the odd-degree vertices in T6: let H be a list of vertices, ordered according to when they are first visited7: in a Eulearian circuit of T ∪M8: return H

There is a polynomial-time 32 -approximation algorithm for the travelling salesman

problem with the triangle inequality.

Theorem (Christofides’76)

VI. Travelling Salesman Problem Metric TSP 13

Page 114: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST

X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 115: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST

X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 116: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST

X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 117: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 118: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 119: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 120: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 121: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in T

X

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 122: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 123: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit

X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 124: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 125: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 126: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 127: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 128: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 129: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 130: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 131: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 132: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 133: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 134: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian Cycle

X

VI. Travelling Salesman Problem Metric TSP 14

Page 135: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian CycleX

VI. Travelling Salesman Problem Metric TSP 14

Page 136: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Run of CHRISTOFIDES

a d

b f

e

g

c

h

b f

e

g

c

h

Solution has cost ≈ 15.54 - within 10% of the optimum!

1. Compute MST X

2. Add a minimum-weight perfect matching M of the odd vertices in TX

3. Find an Eulerian Circuit X

4. Transform the Circuit into a Hamiltonian CycleX

VI. Travelling Salesman Problem Metric TSP 14

Page 137: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Concluding Remarks

There is a polynomial-time 32 -approximation algorithm for the travelling

salesman problem with the triangle inequality.

Theorem (Christofides’76)

There is a PTAS for the Euclidean TSP Problem.Theorem (Arora’96, Mitchell’96)

Both received the Gödel Award 2010

“Christos Papadimitriou told me that the travelingsalesman problem is not a problem. It’s an addiction.”

Jon Bentley 1991

VI. Travelling Salesman Problem Metric TSP 15

Page 138: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Concluding Remarks

There is a polynomial-time 32 -approximation algorithm for the travelling

salesman problem with the triangle inequality.

Theorem (Christofides’76)

There is a PTAS for the Euclidean TSP Problem.Theorem (Arora’96, Mitchell’96)

Both received the Gödel Award 2010

“Christos Papadimitriou told me that the travelingsalesman problem is not a problem. It’s an addiction.”

Jon Bentley 1991

VI. Travelling Salesman Problem Metric TSP 15

Page 139: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Concluding Remarks

There is a polynomial-time 32 -approximation algorithm for the travelling

salesman problem with the triangle inequality.

Theorem (Christofides’76)

There is a PTAS for the Euclidean TSP Problem.Theorem (Arora’96, Mitchell’96)

Both received the Gödel Award 2010

“Christos Papadimitriou told me that the travelingsalesman problem is not a problem. It’s an addiction.”

Jon Bentley 1991

VI. Travelling Salesman Problem Metric TSP 15

Page 140: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Concluding Remarks

There is a polynomial-time 32 -approximation algorithm for the travelling

salesman problem with the triangle inequality.

Theorem (Christofides’76)

There is a PTAS for the Euclidean TSP Problem.Theorem (Arora’96, Mitchell’96)

Both received the Gödel Award 2010

“Christos Papadimitriou told me that the travelingsalesman problem is not a problem. It’s an addiction.”

Jon Bentley 1991

VI. Travelling Salesman Problem Metric TSP 15

Page 141: VI. Approximation Algorithms: Travelling Salesman Problem · Travelling Salesman Problem Introduction 3. The Traveling Salesman Problem (TSP) Given a set ofcitiesalong with the cost

Concluding Remarks

There is a polynomial-time 32 -approximation algorithm for the travelling

salesman problem with the triangle inequality.

Theorem (Christofides’76)

There is a PTAS for the Euclidean TSP Problem.Theorem (Arora’96, Mitchell’96)

Both received the Gödel Award 2010

“Christos Papadimitriou told me that the travelingsalesman problem is not a problem. It’s an addiction.”

Jon Bentley 1991

VI. Travelling Salesman Problem Metric TSP 15