SlideShare a Scribd company logo
TSP.1
9.4
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 620-362
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)
x =
0 1 0 0
0 0 1 0
0 0 0 1
1 0 0 0










TSP.7
Objective function
• d(i,j) = (direct) distance between city i and
city j.
z = ξ ( ι , ϕ ) δ ( ι , ϕ )
ϕ = 1
ν
∑
ι = 1
ν
∑
TSP.8
Constraints
• Each city must be “exited” exactly once
• Each city must be “entered” exactly once
x ( i , j )
j = 1
ν
∑ = 1 , ι = 1 , 2 , ..., ν
x ( i , j )
i = 1
ν
∑ = 1 , ϕ = 1 , 2 , ..., ν
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
x =
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0










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 4.
1
2
3
4
TSP.13
Subtour elimination constraint
• S = subset of cities
• |S| = cardinality of S (# of elements in S)
• There are 2n
such sets !!!!!!!
x ( i , j ) ≤ Σ
ι , ϕ ∈ Σ
∑ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν }
TSP.14
Example
• Consider S={1,2}, |S|=2
x =
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0










x ( i , j ) = 2
ι , ϕ ∈ Σ
∑
• Hence the sub-tour
elimination constraint is
not satisfied.
• Indeed, thee are two
subtours in this solution
TSP.15
Thus, LP Version
min
x
x ( i , j ) d ( i , j )
j = 1
ν
∑
ι = 1
ν
∑
σ . τ.
ξ ( ι , ϕ) = 1 , ι = 1 , 2 , ..., ν
ϕ = 1
ν
∑
ξ ( ι , ϕ) = 1 , ϕ = 1 , 2 , ..., ν
ι = 1
ν
∑
ξ ( ι , ϕ) ≤ Σ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν }
ι , ϕ∈ Σ
ν
∑
ξ ( ι , ϕ) ∈ { 0 , 1 }
TSP.16
LP-Free Version
• Decision variables:
xj := 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
z = δ ( 0 , ξ
1
) + δ ( ξ
ϕ
ϕ = 1
ν − 1
∑ , ξ
ϕ + 1
) + δ ( ξ
ν
, 0 )
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.
x
1
, ..., x
n
{ } = { 1 , 2 , 3 , ..., ν }
TSP.20
LP-Free Formulation
• There are n! feasible solutions
x
1
, ..., x
n
{ } = { 1 , 2 , 3 , ..., ν }
min
x
d ( 0 , x
1
) + δ ( ξ
ϕ
ϕ = 1
ν − 1
∑ , ξ
ϕ + 1
) + δ ( ξ
ν
, 0 )






TSP.21
Which one do you prefer?
TSP.22
LP Version
min
x
x ( i , j ) d ( i , j )
j = 1
ν
∑
ι = 1
ν
∑
σ . τ.
ξ ( ι , ϕ) = 1 , ι = 1 , 2 , ..., ν
ϕ = 1
ν
∑
ξ ( ι , ϕ) = 1 , ϕ = 1 , 2 , ..., ν
ι = 1
ν
∑
ξ ( ι , ϕ) ≤ Σ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν }
ι , ϕ∈ Σ
ν
∑
ξ ( ι , ϕ) ∈ { 0 , 1 }
TSP.23
LP Free Version
x
1
, ..., x
n
{ } = { 1 , 2 , 3 , ..., ν }
min
x
d ( 0 , x
1
) + δ ( ξ
ϕ
ϕ = 1
ν − 1
∑ , ξ
ϕ + 1
) + δ ( ξ
ν
, 0 )






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,
f (i,φ) = d(i,0), φ = empty set
f (i,s) = min
j ∈S
d(i, j) + f (j,s  {j}){ }, s ≠ φ
s  A:= {k ∈ s,k ∉ A}.
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}
f (i,φ) = d(i,0), φ = empty set
f (i,s) = min
j ∈S
d(i, j) + f (j,s  {j}){ }, s ≠ φ
s  A := {k ∈ s,k ∉ A}.
TSP.26
Example (Winston, p. 751)
• Distance (miles)
• Cities: New York, Miami, Dallas, Chicago
d =
− 1334 1559 809
1334 − 1343 1397
1559 1343 − 921
809 1397 921 −
⎡
⎣
⎢
⎢
⎢
⎤
⎦
⎥
⎥
⎥
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,φ) = 1343 + 1334 = 2677
• f(3,{1})= d(3,1) + f(1,φ) = 1397 + 1334 = 2731
• f(1,{2})= d(1,2) + f(2,φ) = 1343 + 1559 = 2902
• f(3,{2})= d(3,2) + f(2,φ) = 921 + 1559 = 2480
• f(1,{3})= d(1,3) + f(3,φ) = 1397 + 809 = 2206
• f(2,{3})= d(2,3) + f(3,φ) = 921 + 809 = 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 {1397+2902,921+2677}
= 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 {1334+3073, 1559+3549, 809 + 3598}
• = 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

More Related Content

What's hot

15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
Abhishek Singh
 
Arithmetic progression
Arithmetic progressionArithmetic progression
Arithmetic progression
Rajaram Narasimhan
 
Numerical_Methods_Simpson_Rule
Numerical_Methods_Simpson_RuleNumerical_Methods_Simpson_Rule
Numerical_Methods_Simpson_Rule
Alex_5991
 
one + 1
one + 1one + 1
Arithmetic progression
Arithmetic progressionArithmetic progression
Arithmetic progression
Chhavi Bansal
 
Arithmetic Progression
Arithmetic ProgressionArithmetic Progression
Arithmetic Progression
Deepali Tanwar
 
Exercicios de integrais
Exercicios de integraisExercicios de integrais
Exercicios de integrais
Ribeij2
 
Arithmeticprogression 130714002550-phpapp02
Arithmeticprogression 130714002550-phpapp02Arithmeticprogression 130714002550-phpapp02
Arithmeticprogression 130714002550-phpapp02
Arpit Meena
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Abhranil Das
 
Arithmetic Progression
Arithmetic ProgressionArithmetic Progression
Arithmetic Progression
itutor
 
Arithmetic progressions
Arithmetic progressionsArithmetic progressions
Arithmetic progressions
shefali1710
 
From moments to sparse representations, a geometric, algebraic and algorithmi...
From moments to sparse representations, a geometric, algebraic and algorithmi...From moments to sparse representations, a geometric, algebraic and algorithmi...
From moments to sparse representations, a geometric, algebraic and algorithmi...
BernardMourrain
 
Laplace periodic function
Laplace periodic functionLaplace periodic function
Laplace periodic function
Kaushal Surti
 
Bioalgo 2013-06-alignment-1 0
Bioalgo 2013-06-alignment-1 0Bioalgo 2013-06-alignment-1 0
Bioalgo 2013-06-alignment-1 0
BioinformaticsInstitute
 

What's hot (14)

15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
 
Arithmetic progression
Arithmetic progressionArithmetic progression
Arithmetic progression
 
Numerical_Methods_Simpson_Rule
Numerical_Methods_Simpson_RuleNumerical_Methods_Simpson_Rule
Numerical_Methods_Simpson_Rule
 
one + 1
one + 1one + 1
one + 1
 
Arithmetic progression
Arithmetic progressionArithmetic progression
Arithmetic progression
 
Arithmetic Progression
Arithmetic ProgressionArithmetic Progression
Arithmetic Progression
 
Exercicios de integrais
Exercicios de integraisExercicios de integrais
Exercicios de integrais
 
Arithmeticprogression 130714002550-phpapp02
Arithmeticprogression 130714002550-phpapp02Arithmeticprogression 130714002550-phpapp02
Arithmeticprogression 130714002550-phpapp02
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
 
Arithmetic Progression
Arithmetic ProgressionArithmetic Progression
Arithmetic Progression
 
Arithmetic progressions
Arithmetic progressionsArithmetic progressions
Arithmetic progressions
 
From moments to sparse representations, a geometric, algebraic and algorithmi...
From moments to sparse representations, a geometric, algebraic and algorithmi...From moments to sparse representations, a geometric, algebraic and algorithmi...
From moments to sparse representations, a geometric, algebraic and algorithmi...
 
Laplace periodic function
Laplace periodic functionLaplace periodic function
Laplace periodic function
 
Bioalgo 2013-06-alignment-1 0
Bioalgo 2013-06-alignment-1 0Bioalgo 2013-06-alignment-1 0
Bioalgo 2013-06-alignment-1 0
 

Similar to Chapter9 4

Travelling sales an problem
Travelling sales an problemTravelling sales an problem
Travelling sales an problem
suprabhathsimacs
 
Recurrent Problem in Discrete Mathmatics.pptx
Recurrent Problem in Discrete Mathmatics.pptxRecurrent Problem in Discrete Mathmatics.pptx
Recurrent Problem in Discrete Mathmatics.pptx
gbikorno
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
Traian Rebedea
 
Lecture5
Lecture5Lecture5
Lecture5
Atner Yegorov
 
time_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdftime_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdf
SrinivasaReddyPolamR
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)
Abhishek Choksi
 
Graph for Coulomb damped oscillation
Graph for Coulomb damped oscillationGraph for Coulomb damped oscillation
Graph for Coulomb damped oscillation
phanhung20
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
Kai Katsumata
 
maths ppt.pdf
maths ppt.pdfmaths ppt.pdf
maths ppt.pdf
nihaiqbal1
 
maths ppt.pdf
maths ppt.pdfmaths ppt.pdf
maths ppt.pdf
nihaiqbal1
 
Lp and ip programming cp 9
Lp and ip programming cp 9Lp and ip programming cp 9
Lp and ip programming cp 9
M S Prasad
 
Laplace_1.ppt
Laplace_1.pptLaplace_1.ppt
Laplace_1.ppt
cantatebrugyral
 
Optimization algorithms for solving computer vision problems
Optimization algorithms for solving computer vision problemsOptimization algorithms for solving computer vision problems
Optimization algorithms for solving computer vision problems
Krzysztof Wegner
 
Tree distance algorithm
Tree distance algorithmTree distance algorithm
Tree distance algorithm
Trector Rancor
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
Indian Institute of Technology, Roorkee
 
NODDEA2012_VANKOVA
NODDEA2012_VANKOVANODDEA2012_VANKOVA
NODDEA2012_VANKOVA
Lilyana Vankova
 
pradeepbishtLecture13 div conq
pradeepbishtLecture13 div conqpradeepbishtLecture13 div conq
pradeepbishtLecture13 div conq
Pradeep Bisht
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
Shariful Haque Robin
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Mahbubur Rahman
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
Nv Thejaswini
 

Similar to Chapter9 4 (20)

Travelling sales an problem
Travelling sales an problemTravelling sales an problem
Travelling sales an problem
 
Recurrent Problem in Discrete Mathmatics.pptx
Recurrent Problem in Discrete Mathmatics.pptxRecurrent Problem in Discrete Mathmatics.pptx
Recurrent Problem in Discrete Mathmatics.pptx
 
Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11Algorithm Design and Complexity - Course 11
Algorithm Design and Complexity - Course 11
 
Lecture5
Lecture5Lecture5
Lecture5
 
time_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdftime_complexity_list_02_04_2024_22_pages.pdf
time_complexity_list_02_04_2024_22_pages.pdf
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)
 
Graph for Coulomb damped oscillation
Graph for Coulomb damped oscillationGraph for Coulomb damped oscillation
Graph for Coulomb damped oscillation
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
 
maths ppt.pdf
maths ppt.pdfmaths ppt.pdf
maths ppt.pdf
 
maths ppt.pdf
maths ppt.pdfmaths ppt.pdf
maths ppt.pdf
 
Lp and ip programming cp 9
Lp and ip programming cp 9Lp and ip programming cp 9
Lp and ip programming cp 9
 
Laplace_1.ppt
Laplace_1.pptLaplace_1.ppt
Laplace_1.ppt
 
Optimization algorithms for solving computer vision problems
Optimization algorithms for solving computer vision problemsOptimization algorithms for solving computer vision problems
Optimization algorithms for solving computer vision problems
 
Tree distance algorithm
Tree distance algorithmTree distance algorithm
Tree distance algorithm
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
NODDEA2012_VANKOVA
NODDEA2012_VANKOVANODDEA2012_VANKOVA
NODDEA2012_VANKOVA
 
pradeepbishtLecture13 div conq
pradeepbishtLecture13 div conqpradeepbishtLecture13 div conq
pradeepbishtLecture13 div conq
 
Presentation on calculus
Presentation on calculusPresentation on calculus
Presentation on calculus
 
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 

More from Nv Thejaswini

Mea notes
Mea notesMea notes
Mea notes
Nv Thejaswini
 
Appendix b 2
Appendix b 2Appendix b 2
Appendix b 2
Nv Thejaswini
 
Huffman coding01
Huffman coding01Huffman coding01
Huffman coding01
Nv Thejaswini
 
Lecture11
Lecture11Lecture11
Lecture11
Nv Thejaswini
 
Ch8
Ch8Ch8
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 
Unit 5 jwfiles
Unit 5 jwfilesUnit 5 jwfiles
Unit 5 jwfiles
Nv Thejaswini
 
Unit 4 jwfiles
Unit 4 jwfilesUnit 4 jwfiles
Unit 4 jwfiles
Nv Thejaswini
 
Unit 2 in daa
Unit 2 in daaUnit 2 in daa
Unit 2 in daa
Nv Thejaswini
 
Ch8 of OS
Ch8 of OSCh8 of OS
Ch8 of OS
Nv Thejaswini
 
Presentation solar
Presentation solarPresentation solar
Presentation solar
Nv Thejaswini
 

More from Nv Thejaswini (11)

Mea notes
Mea notesMea notes
Mea notes
 
Appendix b 2
Appendix b 2Appendix b 2
Appendix b 2
 
Huffman coding01
Huffman coding01Huffman coding01
Huffman coding01
 
Lecture11
Lecture11Lecture11
Lecture11
 
Ch8
Ch8Ch8
Ch8
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Unit 5 jwfiles
Unit 5 jwfilesUnit 5 jwfiles
Unit 5 jwfiles
 
Unit 4 jwfiles
Unit 4 jwfilesUnit 4 jwfiles
Unit 4 jwfiles
 
Unit 2 in daa
Unit 2 in daaUnit 2 in daa
Unit 2 in daa
 
Ch8 of OS
Ch8 of OSCh8 of OS
Ch8 of OS
 
Presentation solar
Presentation solarPresentation solar
Presentation solar
 

Recently uploaded

14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 

Recently uploaded (20)

14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 

Chapter9 4

  • 1. TSP.1 9.4 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 620-362
  • 2. 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
  • 3. 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.
  • 4. 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
  • 5. 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
  • 6. TSP.6 Example • This matrix represents the tour (1,2,3,4,1) x = 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0          
  • 7. TSP.7 Objective function • d(i,j) = (direct) distance between city i and city j. z = ξ ( ι , ϕ ) δ ( ι , ϕ ) ϕ = 1 ν ∑ ι = 1 ν ∑
  • 8. TSP.8 Constraints • Each city must be “exited” exactly once • Each city must be “entered” exactly once x ( i , j ) j = 1 ν ∑ = 1 , ι = 1 , 2 , ..., ν x ( i , j ) i = 1 ν ∑ = 1 , ϕ = 1 , 2 , ..., ν
  • 10. TSP.10 No! • The first two constraints allow sub- tours • Thus, we have to add a constraint that will prevent sub-tours
  • 11. TSP.11 Explanation: sub-tours • Two subtour: (1,2,1) and (3,4,3) • This solution is not feasible for the TSP x = 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0          
  • 12. 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 4. 1 2 3 4
  • 13. TSP.13 Subtour elimination constraint • S = subset of cities • |S| = cardinality of S (# of elements in S) • There are 2n such sets !!!!!!! x ( i , j ) ≤ Σ ι , ϕ ∈ Σ ∑ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν }
  • 14. TSP.14 Example • Consider S={1,2}, |S|=2 x = 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0           x ( i , j ) = 2 ι , ϕ ∈ Σ ∑ • Hence the sub-tour elimination constraint is not satisfied. • Indeed, thee are two subtours in this solution
  • 15. TSP.15 Thus, LP Version min x x ( i , j ) d ( i , j ) j = 1 ν ∑ ι = 1 ν ∑ σ . τ. ξ ( ι , ϕ) = 1 , ι = 1 , 2 , ..., ν ϕ = 1 ν ∑ ξ ( ι , ϕ) = 1 , ϕ = 1 , 2 , ..., ν ι = 1 ν ∑ ξ ( ι , ϕ) ≤ Σ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν } ι , ϕ∈ Σ ν ∑ ξ ( ι , ϕ) ∈ { 0 , 1 }
  • 16. TSP.16 LP-Free Version • Decision variables: xj := 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.
  • 17. TSP.17 ASSUMPTION • Assume that 0 is the home city, and that there are n other cities
  • 18. TSP.18 Objective function z = δ ( 0 , ξ 1 ) + δ ( ξ ϕ ϕ = 1 ν − 1 ∑ , ξ ϕ + 1 ) + δ ( ξ ν , 0 )
  • 19. 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. x 1 , ..., x n { } = { 1 , 2 , 3 , ..., ν }
  • 20. TSP.20 LP-Free Formulation • There are n! feasible solutions x 1 , ..., x n { } = { 1 , 2 , 3 , ..., ν } min x d ( 0 , x 1 ) + δ ( ξ ϕ ϕ = 1 ν − 1 ∑ , ξ ϕ + 1 ) + δ ( ξ ν , 0 )      
  • 21. TSP.21 Which one do you prefer?
  • 22. TSP.22 LP Version min x x ( i , j ) d ( i , j ) j = 1 ν ∑ ι = 1 ν ∑ σ . τ. ξ ( ι , ϕ) = 1 , ι = 1 , 2 , ..., ν ϕ = 1 ν ∑ ξ ( ι , ϕ) = 1 , ϕ = 1 , 2 , ..., ν ι = 1 ν ∑ ξ ( ι , ϕ) ≤ Σ − 1 , ∀ Σ ⊂ { 1 , 2 , ..., ν } ι , ϕ∈ Σ ν ∑ ξ ( ι , ϕ) ∈ { 0 , 1 }
  • 23. TSP.23 LP Free Version x 1 , ..., x n { } = { 1 , 2 , 3 , ..., ν } min x d ( 0 , x 1 ) + δ ( ξ ϕ ϕ = 1 ν − 1 ∑ , ξ ϕ + 1 ) + δ ( ξ ν , 0 )      
  • 24. 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, f (i,φ) = d(i,0), φ = empty set f (i,s) = min j ∈S d(i, j) + f (j,s {j}){ }, s ≠ φ s A:= {k ∈ s,k ∉ A}.
  • 25. 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} f (i,φ) = d(i,0), φ = empty set f (i,s) = min j ∈S d(i, j) + f (j,s {j}){ }, s ≠ φ s A := {k ∈ s,k ∉ A}.
  • 26. TSP.26 Example (Winston, p. 751) • Distance (miles) • Cities: New York, Miami, Dallas, Chicago d = − 1334 1559 809 1334 − 1343 1397 1559 1343 − 921 809 1397 921 − ⎡ ⎣ ⎢ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ⎥
  • 27. TSP.27 Initialization (s=φ) • f(1, φ) = d(1,0) = 1334 • f(2, φ) = d(2,0) = 1559 • f(3, φ) = d(3,0) = 809
  • 28. 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})= ?
  • 29. TSP.29 |s|=1 f(i,{j}) = d(i,j)+f(j, φ) • f(2,{1})= d(2,1) + f(1,φ) = 1343 + 1334 = 2677 • f(3,{1})= d(3,1) + f(1,φ) = 1397 + 1334 = 2731 • f(1,{2})= d(1,2) + f(2,φ) = 1343 + 1559 = 2902 • f(3,{2})= d(3,2) + f(2,φ) = 921 + 1559 = 2480 • f(1,{3})= d(1,3) + f(3,φ) = 1397 + 809 = 2206 • f(2,{3})= d(2,3) + f(3,φ) = 921 + 809 = 1730
  • 30. 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 {1397+2902,921+2677} = min {4299,3598} = 3598 , N(3,{1,2})={2}
  • 31. 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 {1334+3073, 1559+3549, 809 + 3598} • = min {4407,5108,4407} = 4407, N(0,{1,2,3})={1,3}
  • 32. 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