260 likes | 373 Views
Management Science 461. Lecture 7 – Routing (TSP) October 28, 2008. 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
E N D
Management Science 461 Lecture 7 – Routing (TSP) October 28, 2008
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
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….
Applications • Business: delivery routes, facility layout • Manufacturing: Job scheduling, job execution order, robotic function ordering • State of art: Concordehttp://www.tsp.gatech.edu/concorde.html • 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 Xij is 1 if node j visited after node i in the tour Constraint: ensure all cities visited.
Formulation 2 3 1 4 6 5 Problem – Nothing prohibits a subtour Need one constraint for every possible tour, which is 2N-1
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
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
2 1 3 4 5 6 1
2 1 3 4 5 6 5
2 1 3 4 5 6 3
2 1 3 4 5 6 2
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.
2 1 3 4 5 6 5
2 1 3 4 5 6 3 2 1-5-1 (4) 1-3-5-1 : 8 1-5-3-1 : 8
2 1 3 4 3 5 6 3 2 3 6 1-5-3-1 (8) 1-6-5-3-1 : 20 1-5-6-3-1 : 15 1-5-3-6-1 : 21
2 1 3 4 6 5 6 2 2 3 2 6 4 1-5-6-3-1 (15) 1-2-5-6-3-1 : 25 1-5-2-6-3-1 : 22 1-5-6-2-3-1 : 21 1-5-6-3-2-1 : 25
2 1 3 4 7 7 5 6 2 5 3 4 2 4 1-5-6-2-3-1 (21) 1-4-5-6-2-3-1 : 32 1-5-4-6-2-3-1 : 29 1-5-6-4-2-3-1 : 26 1-5-6-2-4-3-1 : 31 1-5-6-2-3-4-1 : 34
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
2-Opt Heuristic k k j j Before After:alternate links part of path reversed j+1 j+1 k+1 k+1 Repeat for all pairs of links until no improvement possible
2-opt example 2 3 1 4 6 5
Another 2-opt example 2 3 1 4 6 5
Another example 2 3 1 4 6 5 Not a tour!
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) 3.6 2-Opt (25 runs) 2.2 2-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