math models of or: traveling salesman problemeaton.math.rpi.edu/faculty/mitchell/courses/matp... ·...
TRANSCRIPT
Math Models of OR:Traveling Salesman Problem
John E. Mitchell
Department of Mathematical SciencesRPI, Troy, NY 12180 USA
November 2018
Mitchell Traveling Salesman Problem 1 / 19
Outline
1 Examples
2 Proving Optimality
3 Subtours
4 Reoptimizing after adding subtour elimination constraints
Mitchell Traveling Salesman Problem 2 / 19
Examples
Outline
1 Examples
2 Proving Optimality
3 Subtours
4 Reoptimizing after adding subtour elimination constraints
Mitchell Traveling Salesman Problem 3 / 19
Examples
The Traveling Salesman Problem
TSP WebpageBill Cook, Waterloo
Robert BoschOberlin College
Find shortest route that visits each city exactly once.
Largest problem solved to date has more than 85,000 cities.
Applications: VLSI, vehicle routing (UPS, school buses,...)Mitchell Traveling Salesman Problem 4 / 19
Proving Optimality
Outline
1 Examples
2 Proving Optimality
3 Subtours
4 Reoptimizing after adding subtour elimination constraints
Mitchell Traveling Salesman Problem 5 / 19
Proving Optimality
How do we know we are optimal?
We’ve found a good tour somehow.How do we know that we can’t do better?Look at relaxations.Venn diagram:
set of tours
relaxationof set oftours
Mitchell Traveling Salesman Problem 6 / 19
Proving Optimality
How do we know we are optimal?We’ve found a good tour somehow.How do we know that we can’t do better?Look at relaxations.Venn diagram:
optimaltour
optimalrelaxation
Optimal relaxation gives lower bound on length of optimal tour
Mitchell Traveling Salesman Problem 6 / 19
Proving Optimality
Constructing a Relaxation
Mitchell Traveling Salesman Problem 7 / 19
Proving Optimality
Constructing a Relaxation
Use exactly two edges incident to each vertex.
Mitchell Traveling Salesman Problem 7 / 19
Proving Optimality
Optimization Formulation
Use binary variables:
xe =
⇢1 if edge e is in tour0 otherwise
Let E denote the set of edges and V the set of vertices.Let ce be the cost of edge e.
Let �(v) denote the edges incident to vertex v .
minxP
e2E cexe
subject toP
e2�(v) xe = 2 for all v 2 V
and xe = 0 or 1 for all e 2 E .
Mitchell Traveling Salesman Problem 8 / 19
Subtours
Outline
1 Examples
2 Proving Optimality
3 Subtours
4 Reoptimizing after adding subtour elimination constraints
Mitchell Traveling Salesman Problem 9 / 19
Subtours
May have subtours
r
s
t
u
v
w
Mitchell Traveling Salesman Problem 10 / 19
Ledge, foreach vertex
0 A
Subtours
May have subtours
r
s
t
u
v
w
Optimal tour
Mitchell Traveling Salesman Problem 10 / 19
Subtours
May have subtours
r
s
t
u
v
wSolution to relaxation:use 2 edges at each vertex
Mitchell Traveling Salesman Problem 10 / 19
§""""""
Subtours
May have subtours
r
s
t
u
v
wUse subtour elimination constraintto tighten relaxation:
xrs + xst + xrt 2
Mitchell Traveling Salesman Problem 10 / 19
{ r, t ,u} :Xr t t x ru t xc .us 2 .
a
Subtours
Refinements
Can add subtour elimination constraints for any subset U ✓ V ,with 3 |U| |V |/2.Too many subtour elimination constraints to use them all, so addthem selectively as needed.(How many possible constraints do we have?)Can also relax the restriction that x be binary: use 0 xe 1.Then have linear program, which can be solved efficiently.Extensions of this approach can solve instances of the TSP withtens of thousands of cities (and hundreds of millions of edges).
Mitchell Traveling Salesman Problem 11 / 19
Subtours
Refinements
Can add subtour elimination constraints for any subset U ✓ V ,with 3 |U| |V |/2.Too many subtour elimination constraints to use them all, so addthem selectively as needed.(How many possible constraints do we have?)Can also relax the restriction that x be binary: use 0 xe 1.Then have linear program, which can be solved efficiently.Extensions of this approach can solve instances of the TSP withtens of thousands of cities (and hundreds of millions of edges).
Mitchell Traveling Salesman Problem 11 / 19
Seca, K s l U l - l .
Subtours
Refinements
Can add subtour elimination constraints for any subset U ✓ V ,with 3 |U| |V |/2.Too many subtour elimination constraints to use them all, so addthem selectively as needed.(How many possible constraints do we have?)Can also relax the restriction that x be binary: use 0 xe 1.Then have linear program, which can be solved efficiently.Extensions of this approach can solve instances of the TSP withtens of thousands of cities (and hundreds of millions of edges).
Mitchell Traveling Salesman Problem 11 / 19
Subtours
Refinements
Can add subtour elimination constraints for any subset U ✓ V ,with 3 |U| |V |/2.Too many subtour elimination constraints to use them all, so addthem selectively as needed.(How many possible constraints do we have?)Can also relax the restriction that x be binary: use 0 xe 1.Then have linear program, which can be solved efficiently.Extensions of this approach can solve instances of the TSP withtens of thousands of cities (and hundreds of millions of edges).
Mitchell Traveling Salesman Problem 11 / 19
Reoptimizing after adding subtour elimination constraints
Outline
1 Examples
2 Proving Optimality
3 Subtours
4 Reoptimizing after adding subtour elimination constraints
Mitchell Traveling Salesman Problem 12 / 19
Reoptimizing after adding subtour elimination constraints
Using dual simplex to reoptimize
r
s
t
u
v
w1
1
1
1
1
1
5
5
5
edge lengths ce shown
Use two edges incident to each vertex. Eg: xrs + xrt + xru = 2.
Have 0 xij 1 for each edge (i , j). Only impose upper boundexplicitly in simplex tableau for the long edges.
Mitchell Traveling Salesman Problem 13 / 19
Reoptimizing after adding subtour elimination constraints
Initial tableau
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw0 1 1 1 1 1 1 5 5 5 0 0 02 1 1 0 0 0 0 1 0 0 0 0 02 1 0 1 0 0 0 0 1 0 0 0 02 0 1 1 0 0 0 0 0 1 0 0 02 0 0 0 1 1 0 1 0 0 0 0 02 0 0 0 1 0 1 0 1 0 0 0 02 0 0 0 0 1 1 0 0 1 0 0 01 0 0 0 0 0 0 1 0 0 1 0 01 0 0 0 0 0 0 0 1 0 0 1 01 0 0 0 0 0 0 0 0 1 0 0 1
Mitchell Traveling Salesman Problem 14 / 19
L - x r s t x r e +quos t e a l
-
C m(= Xew + Sew
Reoptimizing after adding subtour elimination constraints
Optimal tableau for relaxation
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw�6 0 0 0 0 0 0 4 4 4 0 0 0
1 1 0 0 0 0 0 12
12 �1
2 0 0 01 0 1 0 0 0 0 1
2 �12
12 0 0 0
1 0 0 1 0 0 0 �12
12
12 0 0 0
1 0 0 0 1 0 0 12
12 �1
2 0 0 01 0 0 0 0 1 0 1
2 �12
12 0 0 0
1 0 0 0 0 0 1 �12
12
12 0 0 0
1 0 0 0 0 0 0 1 0 0 1 0 01 0 0 0 0 0 0 0 1 0 0 1 01 0 0 0 0 0 0 0 0 1 0 0 1
r
s
t
u
v
w
Mitchell Traveling Salesman Problem 15 / 19
9 basic variables:column of identitymatr ix
i n\ See x r u = x s v
e x e - =O
Reoptimizing after adding subtour elimination constraints
Add subtour elimination contraint
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw xrst�6 0 0 0 0 0 0 4 4 4 0 0 0 0
1 1 0 0 0 0 0 12
12 �1
2 0 0 0 01 0 1 0 0 0 0 1
2 �12
12 0 0 0 0
1 0 0 1 0 0 0 �12
12
12 0 0 0 0
1 0 0 0 1 0 0 12
12 �1
2 0 0 0 01 0 0 0 0 1 0 1
2 �12
12 0 0 0 0
1 0 0 0 0 0 1 �12
12
12 0 0 0 0
1 0 0 0 0 0 0 1 0 0 1 0 0 01 0 0 0 0 0 0 0 1 0 0 1 0 01 0 0 0 0 0 0 0 0 1 0 0 1 02 1 1 1 0 0 0 0 0 0 0 0 0 1
xrs + xrt + xst 2, slack variable xrst
Mitchell Traveling Salesman Problem 16 / 19
Reoptimizing after adding subtour elimination constraints
Pivot to dual canonical form
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw xrst�6 0 0 0 0 0 0 4 4 4 0 0 0 0
1 1 0 0 0 0 0 12
12 �1
2 0 0 0 01 0 1 0 0 0 0 1
2 �12
12 0 0 0 0
1 0 0 1 0 0 0 �12
12
12 0 0 0 0
1 0 0 0 1 0 0 12
12 �1
2 0 0 0 01 0 0 0 0 1 0 1
2 �12
12 0 0 0 0
1 0 0 0 0 0 1 �12
12
12 0 0 0 0
1 0 0 0 0 0 0 1 0 0 1 0 0 01 0 0 0 0 0 0 0 1 0 0 1 0 01 0 0 0 0 0 0 0 0 1 0 0 1 0
�1 0 0 0 0 0 0 � 12� �1
2 �12 0 0 0 1
� � � � � � 8 8 8 � � � �
Optimize using dual simplex.Mitchell Traveling Salesman Problem 17 / 19
Reoptimizing after adding subtour elimination constraints
Result of first dual simplex pivot
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw xrst�14 0 0 0 0 0 0 0 0 0 0 0 0 8
0 1 0 0 0 0 0 0 0 �1 0 0 0 10 0 1 0 0 0 0 0 �1 0 0 0 0 12 0 0 1 0 0 0 0 1 1 0 0 0 �10 0 0 0 1 0 0 0 0 �1 0 0 0 10 0 0 0 0 1 0 0 �1 0 0 0 0 12 0 0 0 0 0 1 0 1 1 0 0 0 �1
�1 0 0 0 0 0 0 0 � 1� �1 1 0 0 21 0 0 0 0 0 0 0 1 0 0 1 0 01 0 0 0 0 0 0 0 0 1 0 0 1 02 0 0 0 0 0 0 1 1 1 0 0 0 �2
� � � � � � � 0 0 � � � �
Optimize using dual simplex.Mitchell Traveling Salesman Problem 18 / 19
Reoptimizing after adding subtour elimination constraints
Result of second dual simplex pivot
xrs xrt xst xuv xuw xvw xru xsv xtw sru ssv stw xrst�14 0 0 0 0 0 0 0 0 0 0 0 0 8
0 1 0 0 0 0 0 0 0 �1 0 0 0 11 0 1 0 0 0 0 0 0 1 �1 0 0 �11 0 0 1 0 0 0 0 0 0 1 0 0 10 0 0 0 1 0 0 0 0 �1 0 0 0 11 0 0 0 0 1 0 0 0 1 �1 0 0 �11 0 0 0 0 0 1 0 0 0 1 0 0 11 0 0 0 0 0 0 0 1 1 �1 0 0 �20 0 0 0 0 0 0 0 0 �1 0 1 0 21 0 0 0 0 0 0 0 0 1 0 0 1 01 0 0 0 0 0 0 1 0 0 1 0 0 0
r
s
t
u
v
wOptimal in relaxation
Feasible in TSPOptimal in TSP
Mitchell Traveling Salesman Problem 19 / 19