The 2 Period Travelling Salesman Problem
Applied to Milk Collection in Ireland
By
Professor H P Williams,London
School of EconomicsDr Martin Butler,
University College Dublin
Appears in: M. Butler, H Paul Williams & l-A Yarrow
Computational Optimization and Applications,
7(1997) 291-306
Ireland
Farmer Catchment Area
Location of Suppliers
A MILK DISTRIBUTION PROBLEM
• Milk is to be collected from 41 farms using a vehicle based at a central depot.
• For 12 of the farms there is to be a daily collection.
• For the other 29 farms collection is to be every other day.
• 1. Decide which farms are to be visited on which days
• 2. Route the vehicle on these days.
• The objective is to minimise total distance travelled
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
Extension of the Symmetric Travelling Salesman Problem
Number of Nodes visited every other day 1 29n
Number of Nodes visited every day 2 13n
1 2 42n n n
1 – Period Problem Number of Tours 49( 1)!1.67 10
2
nx
2 – Period Problem Number of Pairs of Tours
1
1 2 2 1
0 1
! ( 1)! (n ( ) 1)!1x x
2 ! ! 2 2
n
r
n n r n r
r n r
624.27 x10
22 2 1
2
(( 1)!) (2 1)!
8(2 1)!
n n n
n
A HEURISTIC SOLUTION PROCEDURE(gives upper bound for total distance)
• Create a tour around “every day” farms (e.g. nearest neighbour heuristic)
• Apply an improvement heuristic (e.g. 2-interchange method)
• Duplicate tours
• Insert “every other day” farms into tours by an insertion heuristic (e.g. cheapest insertion method)
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node ProblemNearest Neighbour
Solution for Every Day Farms
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
Nearest Neighbour
+2-Interchange for Every Day Farms
(Length = 687
Optimal)
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
Heuristic Solution
Length 1750
OTHER HEURISTIC SOLUTION PROCEDURES
(give upper bounds for total distance)
1. (i) Partition Farms into 2 sets (e.g. Clustering, Distance from Depot etc)
(ii) Apply 1-Period TSP heuristic to each cluster +depot
2. (i) Grow 2 Spanning Trees from Depot. Each “every day” farm included in both trees
Each “every other day” farm included in one tree
(ii) Match odd degree nodes in each tree
(iii) Create Eulerian tours
(iv) “Short circuit” farms visited twice
INTEGER PROGRAMMING FORMULATION
1 iff i,j on tour ijkx k, 1, 2,..., , , 1, 2i j n i j k
21 iff i visited on tour , 1,...,iky k i n n
. .ij ijk
i j ki j
Minimise c x
1 2 21, 1,..,i isubject to y y i n n every other day visits
22, 1,..., , 1, 2ijk jikj i j i
x x i n k
both day visits
2 22 0, 1,..., , 1, 2ijk jik ikj i j i
x x y i n n k
every other day visits
This is the 2-Matching Relaxation
2
29, 13, 42, 2 = 1131 2 1
( -1) 2 1780 (1
, 1, , = 0 1 22
n n n n n
n n n Variables
y yn n
Constraints and
To avoid symmetric alternate
solutions we set leading to a 112 x 1778 size model)
To create a ''correct'' model we wo -1 2 -1 2,199,023,255,551
n uld need to append
subtour elimination constraints, which is clearly impractical.
SOLUTION APPROACH
1. Solve Linear Programming Relaxation of 2-Matching Relaxation. (2 secs, 993 iterations)
(Could then apply the Branch and Bound alogrithm to try to obtain optimal integer solution. This
(i) takes a prohibitive amount of time – weeks – to solve
(ii) only produces subtours)
2. Identify violated “VUB” Constraints (61)
3. Identify violated single day subtours (14)
4. Identify violated single day combs (1)
5. Identify violated aggregated combs (1)
6. Append these constraints (and those for other day)
Resolve LP Relaxation (2 secs, 536 iterations from starting basis)
Append violated VUB constraints (63)
Resolve LP Relaxation (13 secs, 2365 iterations)
7. Repeat 3,4,5
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
LP Relaxation of 2 – Matching Relaxation
Length =1570
½
½
½
½
½
½
½
½
½
½
½ ½
½
½
½
½
½
½
½
½
½
½
½
½
½
½
VARIABLE UPPER BOUND CONSTRAINTS(CUTS)
2 0ijk ijk ikj i j i
x x y
0ijk ikx y 2
2
1,....,
1,.... ,
i n n
j n n i j
0ijk jkx y 2
1,....,
1,....,
i n
j n n
Second pair of constraints may be violated by fractional solutions which satisfy first constraint.
Would need to append 1 1 1 2( 1) 1189n n n n
such constraints.
Will only append if violated.
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
LP Relaxation after violated VUB constraints appended
Length = 1696.5
½
½ ½
½
½
½ ½
½
½ ½
½
½ ½
½
½
½
½ ½
½
+
+
+
*
**
SUBTOURS
COMBS
+ +
++
+
+
**
*
*
*
**
1 2* , V V
SUBTOUR CONSTRAINTS
2V
1
2( )
1kek v
e E S v S V
x S V y
all
2
depot, 2
, 1,2
S V S
S V k
1( )
1 all S , 2
S,k 1,2
ek vk ke E S v S V
x y y
V S
Where is set of farms visited every other day1V
is set of farms visited every day
1 2V V V
( )E S Is set of edges with both ends in S
SUBTOURS, COMBS AND AGGREGATED COMBS
1
2
A violated subtour constraint
*
*
+1
134,2
32
2
4,1
y
y
1
110,1
12
2
0,1
y
y
34
10
39
10,34,2 10,39,2 34,39,2 34,2 0x x x y
A violated aggregated comb constraint
* *
* *
+ +
+
5,6,1 5,8,1 6,8,1 5,6,2 5,8,2 6,8,2
5,25,1 5,25,2
8,28,1 8,28,2
6,26,1 6,27,1 6,26,2 6,27,2 26,27,2
8
x x x x x x
x x
x x
x x x x x
(handle)
(tooth 1)
(tooth 2)
(tooth 3)
1
2
1
2
1
21
2
1
2 1
21
2
1
2
1
2
1
2
1
21
2
1
2
2.82.5 5 8
6
26 27
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
21
2
1
2
1
2
1
21
21
2
1
2
1
2
1
2
1
21
2
1
2
1
21
2
1
2
1
2
1
2
1
21
21
2
1
2
1
2
1
2
1
2
1
2
1
2
Length = 1711 1
2
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
1
3
1
3
1
31
3
1
3 1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
31
3
1
3
1
3
1
3
1
3
1
3
1
3 1
3
1
3
1
3
1
3
1
3
1
31
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
2
1
2
1
2
1
2
1
2
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
32
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
1
6
1
6
1
6
3
6
5
6
LP Relaxation after VUBs
2nd set of subtours & Comb Constarints
Length 1720 5
6
Nodes 1-13 (+) Visited Both days Nodes 14-42 Visited Every Other Day
+ Every Day
* Second Day
42 Node Problem
Optimal Solution
Length 1725
SOLUTION RESULTS
LP Relaxation 1570
(B & B takes weeks and produces subtours)
LP Relaxation after VUB constraints 1696.5
(B&B TAKES 40 MINUTES AND PRODUCES SUBTOURS)
LP Relaxation after VUB, Subtour and Comb 1711.5
Constraints
(B & B takes 7 minutes to produce subtours)
LP Relaxation after VUB and further Subtour 1720.83
Constraints
B & B takes 13 seconds to produce optimal solution 1725
Heuristic Solution 1750
A total of 63 VUB, 18 Subtour, 1Comb Constraint and 2 Aggregated Comb Constraints were used.
Resultant model has 149 Constraints (excluding (VUB’s), 1778 Variables and solves in a total of 26 seconds (On a 486 PC)
Objective (1/10 miles)
Solution Approach
SOLVE LP RELAXATION
AUTOMATICALLY APPEND VIOLATED VUB CONSTRAINTS
APPEND VIOLATED CONSTRAINTS
APPEND VIOLATED CONSTRAINTS
SOLVE LP RELAXATION
DRAW GRAPH OF SOLUTION
IS SOLUTION INTEGER?
IDENTITY INEQUALITIES VIOLATED BY SOLUTION
VIOLATED INEQUALITIES IDENTIFIED
ARE THERE VIOLATED SUBTOURS?
STOP AN OPTIMAL 2-TOUR FOUND
APPLY BRANCH AND BOUND ALGORITHM
Yes
NoNo
Yes
No
Yes
FURTHER CONSIDERATIONS
1. Could identify further cuts (facets?) and avoid use of Branch and Bound.
2. . Can include capacity constraints limiting each day’s collection
(Constraints on i ik
y for each )k
3. Could generalise to more than 2 time periods.
Top Related