Assignment 3b: The traveling salesman problem

Similar documents
MVE165/MMG630, Applied Optimization Lecture 8 Integer linear programming algorithms. Ann-Brith Strömberg

MVE165/MMG631 Linear and integer optimization with applications Lecture 9 Discrete optimization: theory and algorithms

to the Traveling Salesman Problem 1 Susanne Timsj Applied Optimization and Modeling Group (TOM) Department of Mathematics and Physics

Combinatorial Optimization - Lecture 14 - TSP EPFL

Optimal tour along pubs in the UK

Travelling Salesman Problem. Algorithms and Networks 2015/2016 Hans L. Bodlaender Johan M. M. van Rooij

ALGORITHM CHEAPEST INSERTION

Introduction to Approximation Algorithms

Mathematical Tools for Engineering and Management

Algorithms for Euclidean TSP

Traveling Salesman Problem. Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij

TSP! Find a tour (hamiltonian circuit) that visits! every city exactly once and is of minimal cost.!

56:272 Integer Programming & Network Flows Final Exam -- December 16, 1997

Algorithms and Experimental Study for the Traveling Salesman Problem of Second Order. Gerold Jäger

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

Last topic: Summary; Heuristics and Approximation Algorithms Topics we studied so far:

val(y, I) α (9.0.2) α (9.0.3)

Metaheuristic Development Methodology. Fall 2009 Instructor: Dr. Masoud Yaghini

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

56:272 Integer Programming & Network Flows Final Examination -- December 14, 1998

Lecture 1. 2 Motivation: Fast. Reliable. Cheap. Choose two.

and 6.855J Lagrangian Relaxation I never missed the opportunity to remove obstacles in the way of unity. Mohandas Gandhi

Polynomial time approximation algorithms

1 The Traveling Salesman Problem

Partha Sarathi Mandal

Lagrangian Relaxation in CP

An iteration of Branch and Bound One iteration of Branch and Bound consists of the following four steps: Some definitions. Branch and Bound.

An O(log n/ log log n)-approximation Algorithm for the Asymmetric Traveling Salesman Problem

1 The Traveling Salesman Problem

Practice Final Exam 1

Fundamentals of Integer Programming

A constant-factor approximation algorithm for the asymmetric travelling salesman problem

Fall CS598CC: Approximation Algorithms. Chandra Chekuri

1 The Traveling Salesperson Problem (TSP)

Overview. H. R. Alvarez A., Ph. D.

Algorithms for Integer Programming

Algorithm Design and Analysis

Effective Tour Searching for Large TSP Instances. Gerold Jäger

CSE 417 Branch & Bound (pt 4) Branch & Bound

Notes for Lecture 24

DETERMINISTIC OPERATIONS RESEARCH

Kurt Mehlhorn, MPI für Informatik. Curve and Surface Reconstruction p.1/25

Theorem 2.9: nearest addition algorithm

Integer Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University

(Refer Slide Time: 01:00)

Machine Learning for Software Engineering

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

Effective Tour Searching for Large TSP Instances. Gerold Jäger

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

2 Approximation Algorithms for Metric TSP

IE 102 Spring Routing Through Networks - 1

6 ROUTING PROBLEMS VEHICLE ROUTING PROBLEMS. Vehicle Routing Problem, VRP:

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

Polynomial Time Approximation Schemes for the Euclidean Traveling Salesman Problem

Massively Parallel Approximation Algorithms for the Traveling Salesman Problem

Algorithms for the Precedence Constrained Generalized Travelling Salesperson Problem

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Optimal tree for Genetic Algorithms in the Traveling Salesman Problem (TSP).

Module 6 NP-Complete Problems and Heuristics

Pre-requisite Material for Course Heuristics and Approximation Algorithms

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

Technische Universität München, Zentrum Mathematik Lehrstuhl für Angewandte Geometrie und Diskrete Mathematik. Combinatorial Optimization (MA 4502)

Introduction to Algorithms

Travelling salesman problem using reduced algorithmic Branch and bound approach P. Ranjana Hindustan Institute of Technology and Science

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

DM515 Spring 2011 Weekly Note 7

Integer Programming: Algorithms - 2

Tolerance based Greedy Heuristics for the Asymmetric TSP. Gerold Jäger Martin Luther University Halle-Wittenberg

2. Modeling AEA 2018/2019. Based on Algorithm Engineering: Bridging the Gap Between Algorithm Theory and Practice - ch. 2

Department of Computer Applications. MCA 312: Design and Analysis of Algorithms. [Part I : Medium Answer Type Questions] UNIT I

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility

Applied Lagrange Duality for Constrained Optimization

Research Interests Optimization:

Surrogate Gradient Algorithm for Lagrangian Relaxation 1,2

Algorithms for Decision Support. Integer linear programming models

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

CAD Algorithms. Categorizing Algorithms

ACO and other (meta)heuristics for CO

A NEW HEURISTIC ALGORITHM FOR MULTIPLE TRAVELING SALESMAN PROBLEM

Fuzzy Inspired Hybrid Genetic Approach to Optimize Travelling Salesman Problem

Modeling and Solving Location Routing and Scheduling Problems

Approximation Algorithms

Two models of the capacitated vehicle routing problem

15.082J and 6.855J. Lagrangian Relaxation 2 Algorithms Application to LPs

Lecture 8: The Traveling Salesman Problem

Algorithms Exam TIN093/DIT600

LEAST COST ROUTING ALGORITHM WITH THE STATE SPACE RELAXATION IN A CENTRALIZED NETWORK

Combinatorial Optimization

The MIP-Solving-Framework SCIP

Approximation Algorithms

A Computational Study of Bi-directional Dynamic Programming for the Traveling Salesman Problem with Time Windows

Optimizing and Approximating Algorithms for the Single and Multiple Agent Precedence Constrained Generalized Traveling Salesman Problem

Vertex Cover Approximations

Design and Analysis of Algorithms

Problem Set 6 (Due: Wednesday, December 6, 2006)

Computational Complexity CSC Professor: Tom Altman. Capacitated Problem

Search Algorithms. IE 496 Lecture 17

Automatic Scheduling of Hypermedia Documents with Elastic Times

Improving the Held and Karp Approach with Constraint Programming

Transcription:

Chalmers University of Technology MVE165 University of Gothenburg MMG631 Mathematical Sciences Linear and integer optimization Optimization with applications Emil Gustavsson Assignment information Ann-Brith Strömberg May 2, 2013 Assignment 3b: The traveling salesman problem Given below is a description of the traveling salesman problem (TSP). The model together with its problem background are described in more detail in the notes of Lecture 11b. Material for the assignment can be found at the course homepage: http://www.math.chalmers.se/math/grundutb/cth/mve165/1213/ Files for creating, plotting and solving TSP instances are given. Questions 1-4 are mandatory. In addition, students aiming at grade 4, 5 or VG must answer at least one of questions 5 or 6. To pass the assignment you should (in groups of two persons) (i) write a detailed report that gives satisfactory answers and explanations to the questions. You shall also estimate the number of hours spent on this assignment and note this in your report. The file containing your report shall be called Name1-Name2-Ass3b.pdf, where Namek, k = 1,2, is your respective family name. Do not forget to write the authors names also inside the report. The report should be submitted in PingPong at latest Friday 17th of May 2013. Your shall also (ii) present your assignment orally at a seminar on May 21, 22, 23, or 24, 2013. The seminars are scheduled via a doodle link, which will be published on the course home page. Presence is mandatory at at least one of these seminars.

Problem background The Traveling Salesman Problem (TSP) is one of the most studied problems in optimization and computational mathematics. The name of the problem comes from the case when a salesman has a number of cities to visit, and he wishes to find the shortest route such that he only has to travel to each city once. It was first formulated as a mathematical problem in the 1930s and can be stated as: Given a list of cities and their pairwise distances, find the shortest possible tour that visits each city exactly once. Figure 1: The shortest tour that visits all nodes exactly once. The TSP is one of many NP-hard problems, meaning that there does not exist any algorithm that can solve the problem to optimality in polynomial time. In essence, a NP-hard problem is a computationally difficult problem that we can not expect to solve exactly when considering larger problem instances. For a more general description of NP problems, see [1]. Because of the computational complexity of the TSP, we have to consider solution methods that can provide us with acceptable solutions within a reasonable amount of time. Not only do we want to have a candidate for what we believe to be a short tour, but also a measure of how much we can improve our solution by searching further. To obtain a candidate solution and a quality measure of the solution, we will consider two optimization methods; Heuristics: Algorithms for finding feasible and acceptable solutions that will give upper bounds on the objective value. Relaxation algorithms: Relaxing the problem can give easier subproblems which produce lower bounds on the objective value. The largest TSP instance solved to optimality is a problem with 85,900 cities, which was solved by the Concorde code in 2006. Another interesting example is the shortest tour visiting all the cities in Sweden (24 978 cities) which was found in 2004 and has a length of approximately 72,500 km. [2]

The mathematical model WeconsiderasetN = {1,...,N}ofcities (nodes), wherethedistancebetween city i and j is c ij for i,j N. In this assignment, we will consider the symmetric TSP, in which the distance between two cities does not depend on the direction, i.e., c ij = c ji. The TSP model in the symmetric case can be simplified by only considering undirected links between the cities, meaning that wedonot distinguishbetween thelinks (i,j) and(j,i). We let L N N denotetheundirectedlinksinthegraph, andnotethat thelinks(i,j) and(j,i) are only represented by one non-directed link in the set L. When implementing the model, we let L = {(i,j) : i,j N,i < j}. We introduce binary variables x ij, where x ij = 1 if one travels directly from city i to city j, and x ij = 0 otherwise. The objective is to find a tour of minimum distance such that each city is visited exactly once. This can be formulated as an integer linear program: minimize c ij x ij, (1a) subject to j N:(i,j) L x ij + (i,j) L j N:(j,i) L (i,j) L:{i,j} S x ji = 2, i N, (1b) x ij S 1, S N, (1c) x ij {0,1}, i,j N. (1d) The objective (1a) is to minimize the distance of the tour. Constraints (1b) says that we must enter and leave each city exactly once and constraint (1c) says that no subtours are allowed. The subtour constraints can also be formulated as x ij + x ji 2, S N. (1e) (i,j) L: i S, j N\S (j,i) L: i S, j N\S A special case is the metric TSP problem in which all distances fulfill the triangle inequality, i.e., c ik +c kj c ij for all i,j,k N. All the problems in this assignment will be metric TSP problems. Algorithms The most direct solution technique would be to try all possible tours and then choose the one with lowest cost. A brute force technique like this would require running time which lies within a polynomial factor of O(n!), and hence would be computationally intractable even for problems with only 20 cities. There is an exact algorithm called the Held-Karp algorithm which utilizes dynamic programming that can solve the problem in time O(n 2 2 n ). Constructive heuristics There are many specially designed constructive heuristics for the TSP which, by finding a feasible tour, can give an upper bound on the optimal value.

Some heuristics are for example based on simple rules deciding which city the route should visit next (ex nearest neighbour heuristic), while other are based on solving simple subproblems to find feasible tours (ex Christofides and the MST-heuristic). See [3] and [4] Another kind of heuristics are called probabilistic heuristics, meaning that they involve some stochastic rules for choosing the tour. Some of the most known probabilistic heuristics are genetic algorithms, simmulated annealing and ant colony optimization. Improvement heuristics An improvement heuristic is an algorithm that starts with a tour (given for example by some constructive heuristic) and improves it. The most used improvement heuristics for the TSP are k-opt heuristics and crossing elimination. [3], [4] Relaxation algorithms By relaxing some constraints and then solving the reduced problem to optimality, lower bounds on the distance of the optimal route can be obtained. The trick when relaxing a problem is to do it in such a way that the relaxed problem becomes easy to solve. In this assignment, we will consider the 1-tree Lagrangian relaxation algorithm. A tree defined on a set of nodes is a graph that connects all nodes without any cycles. We say that a 1-tree defined on N nodes is a connected graph with N arcs and exactly one cycle. From this definition, we can see that the symmetric TSP can be formulated as finding the cheapest 1-tree such that all nodes has degree two, i.e., the TSP can be formulated as minimize c ij x ij, (2a) subject to (i,j) L j N:(i,j) L x ij = 2, i N, (2b) x is a 1-tree (2c) If we relax the assignment constraints (2b) for all nodes except for node s, the resulting problem is the problem to find a minimum spanning tree on the set N\{s} of nodes, and then connect nodesto the tree by the two cheapest arcs. Thiscan bedonevery efficiently byfirstfindingthemstby forexampleprims or Kruskals algorithm, and then connecting node s to the tree. The problem to find the least expensive 1-tree in a graph is called a 1-MST problem. However, the 1-tree relaxation to the TSP gives fairly poor lower bounds. Therefore, we will instead Lagrangian relax the assignment constraints and consider the relaxed problem q(π) = minimize (i,j) Lc ij x ij + i N π i (2 i N:(i,j) L x ij ), (3a) subject to x is a 1-tree with root node s (3b) where q(π) is called the dual objective function. For any π, the dual objective function can easily be evaluated by finding a MST on a set N \{s}, and then

connecting node s to the tree by the two cheapest arcs. We note that the objective function (3a) can be written as (i,j) L c ij x ij +2 i N where c ij = c ij π i π j are called the reduced costs. We see that the Lagrangian multipliers π i makes a node attractive (unattractive) if the value of the multiplier is high (low) in the 1-MST problem (3). The dual objective value always gives a lower bound on objective function, and the goal of a relaxation algorithm is to find as good lower bound as possible, i.e., we are interested in finding q = max π R N q(π). To achieve this, we will utilize a subgradient algorithm. In each iteration k of the algorithm, new Lagrangian multipliers π k+1 are computed from π k, such that we get closer to the optimal solution π. The updating is done by considering the subgradient h k i = 2 x k ij, i N:(i,j) N for i N, where x k ij is the solution obtained from solving the 1-MST problem q(π k ). We then update the Lagrangian multipliers according to where the steplength α k is defined by π i, π k+1 = π k +α k h k, (4) α k = ξ kq q(π k ) h k 2, 0 < ξ k < 2. Since q is unknown, the best primal feasible solutions obtained so far is used instead. One common choice is to start the sequence ξ k with ξ k = 2 and reduceξ k by a factor of two whenever q(π k ) has failed to increase in a specified number of iterations. To have a measure on how good the lower bound is in each iteration, one should construct a heuristic that finds a feasible tour based on the solution found in each evaluation of the dual objective function. A short version of the algorithm can thus be formulated as Step 0: Let k = 0 and choose π 0. Step 1: Given π k, solve (3). Step 2: Construct a primal feasible solution. Use the solution obtained from solving the dual problem and make adjustments such that it becomes feasible. Step 3: If the duality gap is small, then stop. Step 4: Compute π k+1 from (4), let k = k +1, and go to Step 1.

Exercises to perform and questions to answer 1. Use the TSP model implemented in TSP.mod and solve the problems TSP small and TSP medium with CPLEX. What is the length of the shortest tour in each instance? Now relax (one at a time) constraints (1b), (1c) and (1d), and resolve the problems. (When you relax constraints (1b), use (1e) as subtour constraints). Which of the relaxations gives the best lower bound? Plot the solutions with and without relaxations by using the plot TSP.m-file in MATLAB. Describe what you see. Give some comments on the computation times. 2. (a) Construct a deterministic constructive heuristic. You are more than welcome to use your own heuristic or other heuristics not mentioned in this assignment. Explain how it works. (b) Use the heuristic on all the test problems. What is the length of the tours found by the heuristic? Can you (by visually inspecting the solutions) determine if the solutions can be improved? (c) What can you say about the optimal objective values for the test problems? What kind of guarantee can your heuristic give? Why? Try to construct a TSP problem where your heuristic would perform as bad as possible. The problem does not have to be metric. (d) Analyze how the computation time of your heuristic depends on the number of cities. Use the file create TSP.m to create TSP problems. 3. (a) Construct an improvement heuristic that uses a feasible tour and then improves it. Explain how it works. (b) Try the improvement heuristic by taking the tours found by the constructive heuristic for all test problems. How much can the heuristic improve the initial tours? 4. (a) Implement the 1-tree Lagrangian relaxation algorithm. Note that you need to construct a primal feasibility heuristic that is used in each iteration. (b) Useitonall thetest problems. Whatcanyou sayabouttheoptimal objective values? (c) Show in a graph how the gap between the lower and upper bound improves in each iteration. Because some of the problems are large, you should set a limit on how many iterations you allow. 5. Implement a probabilistic heuristic for the TSP and explain how it works. Try it on all test problems and analyze its performance. Can the heuristic give any guarantees on the solutions found? 6. Describe either how a Branch and Bound algorithm or a Cutting Plane algorithm could be used for solving the traveling salesman problem. References can be found at [3], [4] and [5]. You do not need to implement it.

References [1] The P versus NP page. http://www.win.tue.nl/ gwoegi/p-versus-np.htm [2] Concorde TSP Solver. http://www.tsp.gatech.edu/concorde.html [3] Optimization. Jan Lundgren, Mikael Rönnqvist, Peter Värnbrand Studentlitteratur AB, Lund, 2010. [4] The Traveling Salesman Problem: An overview of exact and approximate algorithms. Gilbert Laporte, European Journal of Operational Research 59 (1992) 231-247, North-Holland. [5] Solving a TSP - Cutting Plane http://www.tsp.gatech.edu/methods/dfj/index.html