Traveling Salesman Problem (TSP)

Slides:



Advertisements
Similar presentations
Vehicle Routing: Coincident Origin and Destination Points
Advertisements

ITS THE FINAL LECTURE! (SING IT, YOU KNOW YOU WANT TO) Operations Research.
CS6800 Advanced Theory of Computation
1Other Network ModelsLesson 6 LECTURE SIX Other Network Models.
Great Theoretical Ideas in Computer Science for Some.
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 22 Network Problems.
Vehicle Routing & Scheduling: Part 1
Ant Colony Optimization. Brief introduction to ACO Ant colony optimization = ACO. Ants are capable of remarkably efficient discovery of short paths during.
Great Theoretical Ideas in Computer Science.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Math 308 Discrete Mathematics Discrete Mathematics deals with “Separated” or discrete sets of objects (rather than continuous sets) Processes with a sequence.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Math443/543 Mathematical Modeling and Optimization
Vehicle Routing & Scheduling
Ant Colony Optimization Optimisation Methods. Overview.
1 Efficiency of Algorithms. 2  Two main issues related to the efficiency of algorithms:  Speed of algorithm  Efficient memory allocation  We will.
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
Linear Programming Applications
The Traveling Salesperson Problem
Network Optimization Problems: Models and Algorithms
Solution methods for Discrete Optimization Problems.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
1 IOE/MFG 543 Chapter 7: Job shops Sections 7.1 and 7.2 (skip section 7.3)
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Ch. 11: Optimization and Search Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009 some slides from Stephen Marsland, some images.
Package Transportation Scheduling Albert Lee Robert Z. Lee.
1 Traveling Salesman Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Algorithms for Network Optimization Problems This handout: Minimum Spanning Tree Problem Approximation Algorithms Traveling Salesman Problem.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Network Optimization Models
The Traveling Salesperson Problem Algorithms and Networks.
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
Introduction to Operations Research
1 1 1-to-Many Distribution Vehicle Routing John H. Vande Vate Spring, 2005.
6.1 Hamilton Circuits and Paths: Hamilton Circuits and Paths: Hamilton Path: Travels to each vertex once and only once… Hamilton Path: Travels to each.
MODELING AND ANALYSIS OF MANUFACTURING SYSTEMS Session 12 MACHINE SETUP AND OPERATION SEQUENCING E. Gutierrez-Miravete Spring 2001.
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
More Computational Complexity Shirley Moore CS4390/5390 Fall August 29,
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
Metaheuristic – Threshold Acceptance (TA). 2 Outlines ▪ Measuring Computational Efficiency ▪ Construction Heuristics ▪ Local Search Algorithms ▪ Metaheuristic.
The Traveling Salesman Problem Over Seventy Years of Research, and a Million in Cash Presented by Vladimir Coxall.
Thursday, May 9 Heuristic Search: methods for solving difficult optimization problems Handouts: Lecture Notes See the introduction to the paper.
Mobile Agent Migration Problem Yingyue Xu. Energy efficiency requirement of sensor networks Mobile agent computing paradigm Data fusion, distributed processing.
Bonus Round Assembly Line Scheduling Assume Assembly Line is used for multiple products 1.
Vehicle Routing & Scheduling
TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,
1 Travelling Salesman Problem Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij.
8/14/04 J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 6 – Integer Programming Models Topics.
Vehicle Routing & Scheduling Cluster Algorithms Improvement Heuristics Time Windows.
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
Management Science 461 Lecture 7 – Routing (TSP) October 28, 2008.
1 Euler and Hamilton paths Jorge A. Cobb The University of Texas at Dallas.
Routing Through Networks - 1
Traveling Salesman Problem
1.3 Modeling with exponentially many constr.
Heuristics Definition – a heuristic is an inexact algorithm that is based on intuitive and plausible arguments which are “likely” to lead to reasonable.
Integer Programming (정수계획법)
Heuristic Algorithms via VBA
Applied Combinatorics, 4th Ed. Alan Tucker
1.3 Modeling with exponentially many constr.
The travelling salesman problem
Presented by Yi-Tzu, Chen
Integer Programming (정수계획법)
The Traveling Salesperson Problem
Heuristic Algorithms via VBA
Heuristic Algorithms via VBA
Approximation Algorithms
Vehicle Routing John H. Vande Vate Fall,
Presentation transcript:

Traveling Salesman Problem (TSP)

An Example 12 2 12 2 4 8 4 12 11 8 12 11 10 10 11 3 10 3 10 11 1 3 3 6 1 5 6 6 5 9 6 7 9 12 7 9 12 9 7 7 A truck needs to leave node 1, visit each of the other nodes one and only one time, and back to node 1 What is the best route? Difference from the shortest path problem In shortest path problems, we only care the source and destination, and leave enough freedom to intermediate nodes

TSP and Shortest Path 1 2 3 4 5 6 7 8 9 A B C Finding a route like this (routing arbitrarily) is TSP Finding a route like this (forward only) can be modeled as a shortest path problem

The Traveling Salesman Problem A network G=(N,A) The network may be directed or undirected, which defines two versions of TSP Symmetric or asymmetric TSP If not explicitly mentioned, our discussion applies to both versions Each arc (i,j) has a cost cij Assumption 1: cij ≥0 What can we do if some cij < 0? Assumption 2: There is an arc between any two nodes. If there is no arc (i,j), we simply let the cost cij be a very large number

The Traveling Salesman Problem A tour is defined as a sequence of the nodes in N The cost of a tour is the total cost for the loop that visits all nodes along the sequence of the tour Each node is visited one and only one time The TSP problem is to find a tour with the minimum cost

An Example The optimal tour with total cost = 12+12+10+9+7+3+10=63 4 8 4 12 11 8 12 11 10 10 11 3 10 3 10 11 1 3 3 6 1 5 6 6 5 9 6 7 9 12 7 9 12 9 7 7 The optimal tour with total cost = 12+12+10+9+7+3+10=63 The tour can be represented by (1,2,4,6,7,5,3) or equivalently (2,4,6,7,5,3,1), … Starting node for the tour does not matter because it is a loop

Visiting a Node Multiple Times? 12 1 2 3 4 12 10 8 30 1 2 3 4 12 10 8 20 2 4 8 12 30 10 3 1 In practice, sometimes it may be more cost-effective if we allow to visit some nodes multiple times (1,2,4,3,1) with cost=64 v.s. (1,2,4,2,3,1) with cost=54 Any TSP allowing multiple-time visit can be converted into a TSP not allowing multiple-time visit Find the shortest-path cost d[i,j] for all pairs of (i,j) Use d[i,j] to replace cij for all pairs of (i,j)

Background Applications Time complexity In transportation Delivery/pickup for a set of customers In production scheduling To determined the processing sequence for n jobs on a single machine There is a setup cost/delay cij if job j follows job i The goal is to minimize the total setup cost Time complexity There are up to O(n!) different tours The TSP problem is NP-hard

Algorithms Optimal Algorithms Heuristic algorithms Formulating and solving an integer programming Time consuming Heuristic algorithms Nearest neighbor algorithm Cheapest insertion algorithm Others

Nearest Neighbor Algorithm Choose one node as the starting node Repeatedly go to the closest unvisited node until all nodes are visited Return to the starting node Start from node 1 Along (1,5) to node 5 Along (5,2) to node 2 Along (2,4) to node 4 Along (4,3) to node 3 Along (3,1) to return to node 1 Solution found: (1,5,2,4,3) with cost=668 It happens to be the optimal tour. City 1 City 2 City 3 City 4 City 5 132 217 164 58 290 201 79 113 303 196

Nearest Neighbor Algorithm The nearest neighbor algorithm may not find an optimal tour For example, if we choose node 3 as the starting node, the solution found is not optimal. Multi-start Heuristics Choose different nodes as the starting nodes, and solve the problem n times. Use the best solution. Start from node 3 Along (3,4) to node 4 Along (4,1) to node 1 Along (1,5) to node 5 Along (5,2) to node 2 Along (2,3) to return to node 3 Solution found: (3,4,1,5,2) with cost=704 It is not the optimal tour. City 1 City 2 City 3 City 4 City 5 132 217 164 58 290 201 79 113 303 196

Nearest Neighbor Algorithm Choose one node as the starting node Repeatedly go to the closest unvisited node until all nodes are visited Return to the starting node Time complexity It takes n iterations, to determine one node in each iteration In each iteration, it takes O(n) comparison to find the nearest node Overall complexity is O(n2)

Nearest Neighbor Algorithm The nearest neighbor algorithm may find a solution that is very bad Starting from node 1, the nearest neighbor algorithms has to use a large-cost arc (7,4) to go to node 4 For a heuristic solution, define the relative error as (Cost of heuristic solution - Cost of optimal solution) / Cost of optimal solution The relative error of the nearest neighbor tour may be very large 12 2 12 2 4 4 8 12 8 11 12 11 10 10 3 11 10 10 3 11 1 3 3 1 6 5 6 6 5 6 9 7 9 7 12 9 12 9 7 7

Cheapest Insertion Algorithm 12 2 7 1 2 3 12 10 8 9 1 2 3 12 10 8 From arc (1,3), only nodes 2 and 7 can be inserted If node 2 is inserted, the cost increase is 12+8-10=10 If node 7 is inserted, the cost increase is 12+9-10=11 So node 2 is to be selected 4 8 12 11 10 10 11 3 3 1 6 5 6 9 7 12 9 7 Start from a loop with two nodes For example, (1,3) and (3,1) Repeat the following steps For each arc (i,j) on the loop, try to replace it with two arcs (i,k) and (k,j) for an unvisited node k We try to insert node k to the loop Find the node k with the smallest cost increase

Cheapest Insertion Algorithm 12 1 2 3 7 12 10 8 9 4 11 1 2 3 7 12 8 9 2 4 8 12 11 10 10 11 3 3 1 6 5 6 9 7 12 9 7 From loop (1,2,3), nodes 4 and 7 can be inserted If node 4 is inserted, the cost increase is 12+11-8=15 If node 7 is inserted, the cost increase is 12+9-10=11 So node 7 is to be inserted, which leads to a new loop (1,2,3,7)

Cheapest Insertion Algorithm 12 2 1 2 3 7 12 8 9 4 11 5 1 2 3 7 12 8 5 Node 5 is inserted 4 8 12 11 10 10 11 3 3 1 6 5 6 9 7 12 9 7 1 2 3 7 12 8 4 11 5 6 9 1 2 3 7 12 8 5 6 9 Node 6 is inserted. Note that Node 4 can be inserted in two different ways.

Cheapest Insertion Algorithm 12 1 2 3 7 12 8 4 11 5 6 9 10 1 2 3 7 12 8 4 5 11 6 9 Final solution (not optimal) 2 4 8 12 10 11 10 10 11 3 3 1 6 5 6 9 7 12 9 7 The cheapest insertion tour has a finite error bound with the triangle inequality assumption, i.e., Cost of cheapest insertion solution ≤ 2 Cost of optimal solution (We omit the proof.)

How about start from loop (6,7) 12 2 4 4 8 12 11 10 10 10 11 11 3 3 3 3 1 6 6 5 5 6 6 9 9 7 7 12 9 9 7 7 4 11 10 10 11 3 3 1 6 5 To be continued… 6 9 12 9 7

Cheapest Insertion Algorithm Start from a loop with two nodes Repeat the following steps For each arc (i,j) on the loop, try to replace it with two arcs (i,k) and (k,j) for an unvisited node k We try to insert node k to the loop Find the node k with the smallest cost increase Time complexity There are O(n) iterations, one node is selected in each iteration Inside each iteration, there are O(n2) possible different insertion Overall time complexity O(n3) Question: can you improve it?

Group Project Each group (3-5 students) will be assigned an article to read. These articles are about how vehicle routing techniques have helped in various industrial applications. Please read carefully and prepare to introduce the article to the class. A sample article has been uploaded at canvas, for your references. Deliverables Presentation: Each group is expected to report the content of the article, including, for example, the background of the application, what is the problem, what formulation and techniques have been used, any challenges, what is the impact, what can we learn, any other related stories/follow-ups beyond the article. Evaluation: Each group is required to evaluate the presentation of other groups. Details will be announced later. Actions to take Sign up project groups at canvas by Oct 15. Please send email to TA, Mr. Yifu LI (ylick@ust.hk) for you cannot find a group to join.