the held & karp relaxation of tspeaton.math.rpi.edu/faculty/mitchell/courses/matp...a lagrangian...
TRANSCRIPT
The Held & Karp Relaxation of TSP
John E. Mitchell
Department of Mathematical SciencesRPI, Troy, NY 12180 USA
April 2019
Mitchell The Held & Karp Relaxation of TSP 1 / 18
A Lagrangian relaxation of the traveling salesman problem
Outline
1 A Lagrangian relaxation of the traveling salesman problem
2 Algorithm
3 Example
Mitchell The Held & Karp Relaxation of TSP 2 / 18
A Lagrangian relaxation of the traveling salesman problem
The traveling salesman problem
Let G = (V ,E) be the complete graph on n vertices, with edge weightswe for each e ∈ E .
A feasible solution to the traveling salesman problem satisfies threeconditions:
1 It is connected.2 It contains n edges.3 It contains exactly two edges incident to each vertex.
In the polyhedral approach to the TSP, we relaxed the first condition,connectivity. We then enforce this condition by selectively addingsubtour elimination constraints.
Mitchell The Held & Karp Relaxation of TSP 3 / 18
A Lagrangian relaxation of the traveling salesman problem
The traveling salesman problem
Let G = (V ,E) be the complete graph on n vertices, with edge weightswe for each e ∈ E .
A feasible solution to the traveling salesman problem satisfies threeconditions:
1 It is connected.2 It contains n edges.3 It contains exactly two edges incident to each vertex.
In the polyhedral approach to the TSP, we relaxed the first condition,connectivity. We then enforce this condition by selectively addingsubtour elimination constraints.
Mitchell The Held & Karp Relaxation of TSP 3 / 18
A Lagrangian relaxation of the traveling salesman problem
The traveling salesman problem
Let G = (V ,E) be the complete graph on n vertices, with edge weightswe for each e ∈ E .
A feasible solution to the traveling salesman problem satisfies threeconditions:
1 It is connected.2 It contains n edges.3 It contains exactly two edges incident to each vertex.
In the polyhedral approach to the TSP, we relaxed the first condition,connectivity. We then enforce this condition by selectively addingsubtour elimination constraints.
Mitchell The Held & Karp Relaxation of TSP 3 / 18
A Lagrangian relaxation of the traveling salesman problem
The Held & Karp relaxation
In the Held & Karp relaxation, the degree constraints are relaxed.
Thus, we require our solution to be connected and to contain n edges,but it might not have exactly two edges incident to each vertex.
For notational simplicity, let V = {1,2, . . . ,n}.
Our feasible solutions to our Lagrangian relaxations are required tosatisfy two criteria:
1 We have a spanning tree on nodes {2, . . . ,n}.2 We have exactly two edges incident to node 1.
Such a solution is called a 1-tree.
Mitchell The Held & Karp Relaxation of TSP 4 / 18
A Lagrangian relaxation of the traveling salesman problem
The Held & Karp relaxation
In the Held & Karp relaxation, the degree constraints are relaxed.
Thus, we require our solution to be connected and to contain n edges,but it might not have exactly two edges incident to each vertex.
For notational simplicity, let V = {1,2, . . . ,n}.
Our feasible solutions to our Lagrangian relaxations are required tosatisfy two criteria:
1 We have a spanning tree on nodes {2, . . . ,n}.2 We have exactly two edges incident to node 1.
Such a solution is called a 1-tree.
Mitchell The Held & Karp Relaxation of TSP 4 / 18
A Lagrangian relaxation of the traveling salesman problem
1-treesThus, our solution is connected, and has n edges:n − 2 from the spanning tree, plus two edges incident to node 1.
We relax the dual constraints for vertices 2, . . . ,n, adding them to theobjective with Lagrangian multipliers.
Let δ(v) denote the edges incident to vertex v .
Let x be the incidence vector of our solution. Thus, the Lagrangianrelaxation is
zHK (λ) := minx∑
e∈E wexe +∑n
j=2 λj(2−∑
e∈δ(j) xe)
subject to∑
e∈δ(1) xe = 2x gives a spanning tree on vertices 2, . . . ,nx binary
This is a relaxation of the TSP for any choice of λ.
Mitchell The Held & Karp Relaxation of TSP 5 / 18
A Lagrangian relaxation of the traveling salesman problem
Solving the Lagrangian dual
If the optimal solution to the relaxation is a tour then zHK (λ) is equal tothe length of the tour.
If the solution for a particular λ has the degree of a vertex v equal toone, the value of λv is increased to make it more attractive to useedges incident to vertex v .
Conversely, if a vertex v has degree greater than 2, we decrease thevalue of λv .
Mitchell The Held & Karp Relaxation of TSP 6 / 18
A Lagrangian relaxation of the traveling salesman problem
The Lagrangian relaxation
Note that we can rewrite the Lagrangian relaxation as follows:
zHK (λ) := 2n∑
j=2
λj + minx∑
(u,v)∈E (wuv − λu − λv ) xuv
subject to∑
e∈δ(1) xe = 2x gives a spanning tree
on vertices 2, . . . ,nx binary
Thus, as λv increases, the cost of using any edge incident to vertex vdecreases.
Mitchell The Held & Karp Relaxation of TSP 7 / 18
Algorithm
Outline
1 A Lagrangian relaxation of the traveling salesman problem
2 Algorithm
3 Example
Mitchell The Held & Karp Relaxation of TSP 8 / 18
Algorithm
The algorithm
1 Initialize: Choose initial values for λv , v = 2, . . . ,n. For example,can set λv = 0 for all vertices.
2 Solve a spanning tree problem: Use a greedy algorithm to findan optimal minimum spanning tree on vertices {2, . . . ,n}, withedge weights wuv − λu − λv .
3 Connect vertex 1: Choose the two shortest edges incident tovertex 1, with edge weights w1v − λv for v = 2, . . . ,n.
4 Terminate: If the current x constitutes a cycle, STOP with anoptimal solution to the TSP.
5 Update: Otherwise, update λ and loop back to Step 2.
Mitchell The Held & Karp Relaxation of TSP 9 / 18
Algorithm
The algorithm
1 Initialize: Choose initial values for λv , v = 2, . . . ,n. For example,can set λv = 0 for all vertices.
2 Solve a spanning tree problem: Use a greedy algorithm to findan optimal minimum spanning tree on vertices {2, . . . ,n}, withedge weights wuv − λu − λv .
3 Connect vertex 1: Choose the two shortest edges incident tovertex 1, with edge weights w1v − λv for v = 2, . . . ,n.
4 Terminate: If the current x constitutes a cycle, STOP with anoptimal solution to the TSP.
5 Update: Otherwise, update λ and loop back to Step 2.
Mitchell The Held & Karp Relaxation of TSP 9 / 18
Algorithm
The algorithm
1 Initialize: Choose initial values for λv , v = 2, . . . ,n. For example,can set λv = 0 for all vertices.
2 Solve a spanning tree problem: Use a greedy algorithm to findan optimal minimum spanning tree on vertices {2, . . . ,n}, withedge weights wuv − λu − λv .
3 Connect vertex 1: Choose the two shortest edges incident tovertex 1, with edge weights w1v − λv for v = 2, . . . ,n.
4 Terminate: If the current x constitutes a cycle, STOP with anoptimal solution to the TSP.
5 Update: Otherwise, update λ and loop back to Step 2.
Mitchell The Held & Karp Relaxation of TSP 9 / 18
Algorithm
The algorithm
1 Initialize: Choose initial values for λv , v = 2, . . . ,n. For example,can set λv = 0 for all vertices.
2 Solve a spanning tree problem: Use a greedy algorithm to findan optimal minimum spanning tree on vertices {2, . . . ,n}, withedge weights wuv − λu − λv .
3 Connect vertex 1: Choose the two shortest edges incident tovertex 1, with edge weights w1v − λv for v = 2, . . . ,n.
4 Terminate: If the current x constitutes a cycle, STOP with anoptimal solution to the TSP.
5 Update: Otherwise, update λ and loop back to Step 2.
Mitchell The Held & Karp Relaxation of TSP 9 / 18
Algorithm
The algorithm
1 Initialize: Choose initial values for λv , v = 2, . . . ,n. For example,can set λv = 0 for all vertices.
2 Solve a spanning tree problem: Use a greedy algorithm to findan optimal minimum spanning tree on vertices {2, . . . ,n}, withedge weights wuv − λu − λv .
3 Connect vertex 1: Choose the two shortest edges incident tovertex 1, with edge weights w1v − λv for v = 2, . . . ,n.
4 Terminate: If the current x constitutes a cycle, STOP with anoptimal solution to the TSP.
5 Update: Otherwise, update λ and loop back to Step 2.
Mitchell The Held & Karp Relaxation of TSP 9 / 18
Algorithm
Strength of the relaxation
Each iteration of the algorithm can run in polynomial time.
With certain update rules, it is a subgradient method.
The Lagrangian dual problem can be solved in polynomial time usingthe ellipsoid algorithm or an interior point cutting plane algorithm.
The optimal solution to the dual problem may not solve the travelingsalesman problem, as in the following example.
Mitchell The Held & Karp Relaxation of TSP 10 / 18
Algorithm
Exercise
Show that the optimal value of the Held-Karp 1-tree relaxation of thefollowing graph is 3, while the optimal value of the traveling salesmanproblem is 4.
1
7
2
3 4
5
6
1
1
0
1
0
0 0
1
1
1
other edge lengths equal to 15
Mitchell The Held & Karp Relaxation of TSP 11 / 18
Example
Outline
1 A Lagrangian relaxation of the traveling salesman problem
2 Algorithm
3 Example
Mitchell The Held & Karp Relaxation of TSP 12 / 18
Example
Example
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
other edge lengths equal to 15
We initialize with each λv = 0, v = 2, . . . ,6. We update λ as follows:
λv ←− λv + 2 (2 − degree(v))
(Other update rules are possible.)
Mitchell The Held & Karp Relaxation of TSP 13 / 18
Example
Solution to the initial Lagrangian relaxationThe optimal solution to the first Lagrangian relaxation is as follows(spanning tree edges are red, two edges incident to vertex 1 are blue):
1
2
3 4
5
6
5
2
6
5
3
4
other edge lengths equal to 15
Vertices 2,3,5 each have degree 2, so their λ values are not changed.The values of λ4 and λ6 are updated. We now have:
λ2 = 0, λ3 = 0, λ4 = 2, λ5 = 0, λ6 = −2.
Mitchell The Held & Karp Relaxation of TSP 14 / 18
Example
Solution to the initial Lagrangian relaxationThe optimal solution to the first Lagrangian relaxation is as follows(spanning tree edges are red, two edges incident to vertex 1 are blue):
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
other edge lengths equal to 15
Vertices 2,3,5 each have degree 2, so their λ values are not changed.The values of λ4 and λ6 are updated. We now have:
λ2 = 0, λ3 = 0, λ4 = 2, λ5 = 0, λ6 = −2.
Mitchell The Held & Karp Relaxation of TSP 14 / 18
Example
Updated relaxationλ4 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 15 / 18
Example
Updated relaxationλ4 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 15 / 18
Example
Updated relaxationλ4 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 15 / 18
Example
Updated relaxationλ4 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 15 / 18
Example
Updated relaxationλ4 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 15 / 18
Example
Solution to second Lagrangian relaxationThe optimal solution to the second Lagrangian relaxation is as follows(spanning tree edges are red, two edges incident to vertex 1 are blue):
1
2
3 4
5
6
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
We decrease λ4 and increase λ2:
λ2 = 2, λ3 = 0, λ4 = 0, λ5 = 0, λ6 = −2.
Mitchell The Held & Karp Relaxation of TSP 16 / 18
Example
Solution to second Lagrangian relaxationThe optimal solution to the second Lagrangian relaxation is as follows(spanning tree edges are red, two edges incident to vertex 1 are blue):
1
2
3 4
5
6
8
4
5
5
2
4
3
3
6
other edge lengths equal to 13, 15, or 17
We decrease λ4 and increase λ2:
λ2 = 2, λ3 = 0, λ4 = 0, λ5 = 0, λ6 = −2.
Mitchell The Held & Karp Relaxation of TSP 16 / 18
Example
Next relaxationλ2 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 17 / 18
Example
Next relaxationλ2 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 17 / 18
Example
Next relaxationλ2 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 17 / 18
Example
Next relaxationλ2 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 17 / 18
Example
Next relaxationλ2 = 2, λ6 = −2.
Edge weights updated:
wuv ←− wuv − λu − λv
1
2
3 4
5
6
8
4
3
5
2
6
5
3
4
We solve the 1-tree relaxation on the following graph:
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Mitchell The Held & Karp Relaxation of TSP 17 / 18
Example
Solution to third relaxation
The optimal solution to the 1-tree relaxation is
1
2
3 4
5
6
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Since the solution to the Lagrangian relaxation is a tour, it solves theoriginal problem.
Mitchell The Held & Karp Relaxation of TSP 18 / 18
Example
Solution to third relaxation
The optimal solution to the 1-tree relaxation is
1
2
3 4
5
6
6
4
5
3
0
6
5
5
6
other edge lengths equal to 13, 15, or 17
Since the solution to the Lagrangian relaxation is a tour, it solves theoriginal problem.
Mitchell The Held & Karp Relaxation of TSP 18 / 18