Management Science 461 Lecture 7 – Routing (TSP) October 28, 2008
2 Facility Location Models Assumes Shipments are not combined Each truck serves one client at a time Shortest path between facility and client Can we relax this assumption? Combine shipments Respect truck capacity Respect trip time limit
3 Problem Description Given a set of nodes and a cost metric (distance matrix, network, time network, etc) Find a route of minimum total length that visits each node exactly once This is called the Travelling Salesman Problem. Sounds easy….
4 Applications Business: delivery routes, facility layout Manufacturing: Job scheduling, job execution order, robotic function ordering State of art: Concorde Largest TSP solved: 49 in 1954; 532 in 1987; 7,397 in 1994; 24,978 in 2004 (took 8 years of computation time)
Modelling TSP Minimize total cost travelled, making sure each node is visited Have full distance matrix D for all O-D pairs Binary variable X ij is 1 if node j visited after node i in the tour Constraint: ensure all cities visited. 5
Formulation 6
Problem – Nothing prohibits a subtour Need one constraint for every possible tour, which is 2 N
8 Heuristics for the TSP Trade-off between finding good solutions and time spent coding Simple heuristics in this class: Construction Heuristics: Nearest Neighbor, Nearest Insertion, Cheapest Insertion, Farthest Insertion Improvement Heuristics: 2-opt and k-opt Others – See Concorde
9 Nearest Neighbor (NN) Start with a random node n Find the nearest node to n not already selected Select the node, travel there Repeat until all nodes selected; reconnect to n
FromToDist
FromToDist
FromToDist
13 2 FromToDist
14 Nearest Insertion (NI) Choose a starting node Choose a node to enter the path by considering minimum distance Consider where on the tour is the least- cost location for adding the node Repeat until all nodes are part of the tour.
FromToDist
FromToDist (4) : 8
(8) : 20 : 15 FromToDist :
(15) : 25 : : FromToDist :
(21) : 32 : : FromToDist : :
20 2-opt Heuristic Start with a completed tour Repeat until no improvements possible: Repeat for all pairs of links on the tour: Consider deleting the pair and reconstructing a valid tour Keep the modification that most improves tour length
21 2-Opt Heuristic k+1 j+1 k j k+1 j+1 k j Before After: alternate links part of path reversed Repeat for all pairs of links until no improvement possible
opt example
Another 2-opt example
Not a tour! Another example
25 Comparison Between Heuristics Heuristicavg. % above opt. Nearest neighbor (100 runs)15.3 Nearest insertion (100 runs)17.6 Cheapest insertion (100 runs)13.9 Farthest insertion (100 runs) 4.9 Arbitrary insertion (100 runs) 3.8 Clarke-Wright (100 runs) Opt (25 runs) Opt (50 runs) + 3-Opt 0.9 NN + 2-Opt + 3-Opt 1.2 AI + 3-Opt (10 runs) 1.0 FI + 3-Opt (10 runs) 0.8 Four composite heur. above 0.5