TSP.1 9.4 Travelling Salesperson Problem (TSP) Very famous problem Many practical applications Very easy to describe Very difficult to solve (Curse of.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
Hard Problems Some problems are hard to solve. No polynomial time algorithm is known Most combinatorial optimization problems are hard Popular NP-hard.
Part 1 Overview, introduction, examples What is Operations Research? What is Optimization What is Sequential Decision Making? What is Dynamic Programming?
Chapter 5: Linear Programming: The Simplex Method
ECE Longest Path dual 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality – Longest.
1 Appendix B: Solving TSP by Dynamic Programming Course: Algorithm Design and Analysis.
Lecture 5 Set Packing Problems Set Partitioning Problems
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Branch and Bound Searching Strategies
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
Math443/543 Mathematical Modeling and Optimization
1 Traveling Salesman Problem (TSP) Given n £ n positive distance matrix (d ij ) find permutation  on {0,1,2,..,n-1} minimizing  i=0 n-1 d  (i),  (i+1.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Linear Programming Applications
Math 3120 Differential Equations with Boundary Value Problems
1 Integrality constraints Integrality constraints are often crucial when modeling optimizayion problems as linear programs. We have seen that if our linear.
Spring 07, Mar 13, 15 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Linear Programming – A Mathematical Optimization.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
Decision Procedures An Algorithmic Point of View
1. The Simplex Method.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
C&O 355 Mathematical Programming Fall 2010 Lecture 4 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Solving Systems of 3 or More Variables Why a Matrix? In previous math classes you solved systems of two linear equations using the following method:
GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...
Simplex method (algebraic interpretation)
Chapter 9 Integer Programming
Notes 6IE3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Math /4.2/4.3 – Solving Systems of Linear Equations 1.
Chap 10. Integer Prog. Formulations
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Integer Linear Programming Terms Pure integer programming mixed integer programming 0-1 integer programming LP relaxation of the IP Upper bound O.F. Lower.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
Integer Programming (정수계획법)
1 Section 5.3 Linear Systems of Equations. 2 THREE EQUATIONS WITH THREE VARIABLES Consider the linear system of three equations below with three unknowns.
1. 2 Some details on the Simplex Method approach 2x2 games 2xn and mx2 games Recall: First try pure strategies. If there are no saddle points use mixed.
8/14/04 J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 6 – Integer Programming Models Topics.
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
Chapter 13 Backtracking Introduction The 3-coloring problem
OR  Now, we look for other basic feasible solutions which gives better objective values than the current solution. Such solutions can be examined.
8 -1 Dynamic Programming Fibonacci sequence Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, … F i = i if i  1 F i = F i-1 + F i-2 if i  2 Solved.
Management Science 461 Lecture 7 – Routing (TSP) October 28, 2008.
Computationally speaking, we can partition problems into two categories. Easy Problems and Hard Problems We can say that easy problem ( or in some languages.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
1 Welcome to Introduction to Operations Research.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from P. Van Hentenryck’s course.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Hard Problems Some problems are hard to solve.
EMIS 8373: Integer Programming
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
Chap 10. Sensitivity Analysis
Traveling Salesman Problem
Networks.
1.3 Modeling with exponentially many constr.
2 TSP algorithms: (1) AP+B&B, (2) min spanning tree.
Chapter 6. Large Scale Optimization
Integer Programming (정수계획법)
Applied Combinatorics, 4th Ed. Alan Tucker
1.3 Modeling with exponentially many constr.
Integer Programming (정수계획법)
Lecture 19 Linear Program
Lecture 6 – Integer Programming Models
Presentation transcript:

TSP Travelling Salesperson Problem (TSP) Very famous problem Many practical applications Very easy to describe Very difficult to solve (Curse of Dimensionality) We shall consider the dynamic programming (DP) approach Other approaches: see

TSP.2 Problem Formulation There are many ways to describe this problem. We shall consider the following: –English version –Linear Programming oriented version –Linear Programming Free version –Dynamic programming version

TSP.3 English Version You are given a set of n cities You are given the distances between the cities You start and terminate your tour at your home city You must visit each other city exactly once. Your mission is to determine the shortest tour.

TSP.4 Maths versions We shall consider two Maths Version The first is LP-based The second is LP-free The first version dominates the OR literature

TSP.5 TSP Version 1 (LP) Decision variable: A boolean matrix x interpreted as follows: x(i,j):= 1, iff we go from city i to city j. x(i,j) := 0, otherwise

TSP.6 Example This matrix represents the tour (1,2,3,4,1)

TSP.7 Objective function d(i,j) = (direct) distance between city i and city j.

TSP.8 Constraints Each city must be “exited” exactly once Each city must be “entered” exactly once

TSP.9 Is this enough ?

TSP.10 No! The first two constraints allow sub- tours Thus, we have to add a constraint that will prevent sub-tours

TSP.11 Explanation: sub-tours Two subtour: (1,2,1) and (3,4,3) This solution is not feasible for the TSP

TSP.12 If we start at the home city n=1, we will not visit city 3 and 4. We must go from city 2 to either city 3 or city

TSP.13 Subtour elimination constraint S = subset of cities |S| = cardinality of S (# of elements in S) There are 2 n such sets !!!!!!!

TSP.14 Example Consider S={1,2}, |S|=2 Hence the sub-tour elimination constraint is not satisfied. Indeed, thee are two subtours in this solution

TSP.15 Thus, LP Version

TSP.16 LP-Free Version Decision variables: x j := j-th city on the tour, j=1,2,…,n Example: x=(1,3,2,4,1) We start at city 1, then go to city 3, then go to city 2 then go to city 4 then return to city 1.

TSP.17 ASSUMPTION Assume that 0 is the home city, and that there are n other cities

TSP.18 Objective function

TSP.19 Constraints The constraint basically says that x is a permutation of the cities (1,2,3,…,n) Make sure that you appreciate the role of { } in this formulation.

TSP.20 LP-Free Formulation There are n! feasible solutions

TSP.21 Which one do you prefer?

TSP.22 LP Version

TSP.23 LP Free Version

TSP.24 DP Solution Let, f(i,s) := shortest sub-tour given that we are at city i and still have to visit the cities in s (and return to home city) Then clearly,

TSP.25 Explanation Then clearly, ….. (i,s) We are at city i and still have to visit the cities in s Suppose we decide that from here we go to city j Then we shall travel the Distance d(i,j) (j,s\{j}) We are now at city j and still have to visit the cities in s\{j}

TSP.26 Example (Winston, p. 751) Distance (miles) Cities: New York, Miami, Dallas, Chicago

TSP.27 Initialization (s=  ) f(1,  ) = d(1,0) = 1334 f(2,  ) = d(2,0) = 1559 f(3,  ) = d(3,0) = 809

TSP.28 Iteration (on, i and s) We shall generate s systematically by its “size”. Size = 1: Possible values for s: {1}, {2}, {3}. s = {1} : f(2,{1})= ? ; f(3,{1})= ? s = {2} : f(1,{2})= ? ; f(3,{2})= ? s = {3} : f(1,{3})= ? ; f(2,{3})= ?

TSP.29 |s|=1 f(i,{j}) = d(i,j)+f(j,  ) f(2,{1})= d(2,1) + f(1,  ) = = 2677 f(3,{1})= d(3,1) + f(1,  ) = = 2731 f(1,{2})= d(1,2) + f(2,  ) = = 2902 f(3,{2})= d(3,2) + f(2,  ) = = 2480 f(1,{3})= d(1,3) + f(3,  ) = = 2206 f(2,{3})= d(2,3) + f(3,  ) = = 1730

TSP.30 |s| = 2 f(i,s)= min{d(i,j)+f(j,s\{j}): j in s} Size = 2: Possible values for s: {1,2}, {1,3}, {2,3} Thus, we have to determine the values of f(3,{1,2}) = ? ; f(2,{1,3}) = ? ; f(1,{2,3}) = ? Eg: f(3,{1,2}) = min {d(3,j) + f(j,s\{j}): j in {1,2} } = min {d(3,1) + f(1,{2}), d(3,2) + f(2,{1})} = min { , } = min {4299,3598} = 3598, N(3,{1,2})={2}

TSP.31 |s| = 3 In this case there is only one feasible s, namely s={1,2,3}. Thus, there is only one equation to solve, namely for i=0, s={1,2,3}. The value of f(0,{1,2,3}) is the shortest tour. Note that in this case f(0,{1,2,3})=min {d(0,j) + f(j,{1,2,3}\{j}: j in {1,2,3} = min {d(0,1)+f(1,{2,3}), d(0,2)+ f(2,{1,3}), d(0,3)+f(3,{1,2})} =min { , , } = min {4407,5108,4407} = 4407, N(0,{1,2,3})={1,3}

TSP.32 Recovery S=(0,{1,2,3}), N(s)={1,3}, c=1 S={1,{2,3}}, N(s)={2}, c=(1,2) S={2,{3}}, N(s)={3}, c=(1,2,3). Hence: x*=(0,1,2,3,0), z*=4407