SlideShare a Scribd company logo
Traveling Salesman Problem
• Problem Statement
– If there are n cities and cost of traveling from any
city to any other city is given.
– Then we have to obtain the cheapest round-trip
such that each city is visited exactly ones returning
to starting city, completes the tour.
– Typically travelling salesman problem is represent
by weighted graph.
Cont.
• Row Minimization
– To understand solving of travelling salesman
problem using branch and bound approach we
will reduce the cost of cost matrix M, by using
following formula.
– Red_Row(M) = [ Mij – min{ Mij | 1<=j<=n} ]
where Mij < ∞
Cont.
• Column Minimization
– Now we will reduce the matrix by choosing
minimum for each column.
– The formula of column reduction of matrix is
– Red_col(M)=Mij – min { Mij | 1<=j<=n}
where Mij < ∞
Cont.
• Full Reduction
– Let M bee the cost matrix for TSP for n vertices
then M is called reduced if each row and each
column consist of entire entity ∞ entries or else
contain at least one zero.
– The full reduction can be achieved by applying
both row_reduction and column_reduction.
Cont.
• Dynamic Reduction
– Using dynamic reduction we can make the choice of
edge i->j with optimal cost.
– Step in dynamic reduction technique
1. Draw a space tree with optimal cost at root node.
2. Obtain the cost of matrix for path i->j by making I row and
j column entries as ∞. Also set M[i][j]=∞
3. Cost corresponding node x with path I, j is optimal cost +
reduced cost+ M[i][j]
4. Set node with minimum cost as E-node and generate its
children. Repeat step 1 to 4 for completing tour with
optimal cost.
Example
• Solve the TSP for the following cost matrix
∞ 11 10 9 6
8 ∞ 7 3 4
8 4 ∞ 4 8
11 10 5 ∞ 5
6 9 2 5 ∞
Solution
Step 1 :
• We will find the minimum value from each row and
subtract the value from corresponding row
Minvalue
reduce matrix
∞ 11 10 9 6
8 ∞ 7 3 4
8 4 ∞ 4 8
11 10 5 ∞ 5
6 9 2 5 ∞
∞ 5 4 3 0
5 ∞ 4 0 1
4 0 ∞ 0 4
6 5 0 ∞ 0
1 4 0 0 ∞
-> 6
-> 3
->4
->5
->5
---------
23
Cont.
• Now we will obtain minimum value from each column. If they
column contain 0 the ignore that column and a fully reduced
matrix can be obtain.
subtracting 1 from 1st column
∞ 5 4 3 0
5 ∞ 4 0 1
4 0 ∞ 0 4
6 5 0 ∞ 0
1 4 0 0 ∞
∞ 5 4 3 0
4 ∞ 4 0 1
3 0 ∞ 0 4
5 5 0 ∞ 0
0 4 0 0 ∞
Cont.
• Total reduced cost
= total reduced row cost + total reduced column cost
= 23 + 1
= 24
• Now we will set 24 as the optimal cost
24->this is the lower bound
Cont.
• Step 2 :: Now we will consider the paths [1,2], [1,3], [1,4] and [1,5] of state
space tree as given above consider path [1,2] make 1st row and 2nd column to
∞ set M[2][1]=∞
• Now we will find min value from each corresponding column.
• c
∞ ∞ ∞ ∞ ∞
∞ ∞ 4 0 1
3 ∞ ∞ 0 4
5 ∞ 0 ∞ 0
0 ∞ 0 0 ∞
∞ ∞ ∞ ∞ ∞
∞ ∞ 4 0 1
3 ∞ ∞ 0 4
5 ∞ 0 ∞ 0
0 ∞ 0 0 ∞
Cont.
• Hence total receded cost for node 2 is = Optimal
cost+old value of M[1][2]
= 24 + 5
= 25
• Consider path (1,3). Make 1st row, 3rd column to be
∞ set M[3][1] = ∞
Cont.
There is no minimum value from any row and column
Hence total cost of node 3 is
= optimum cost + M[1][3]
= 24+ 4
= 28
∞ ∞ ∞ ∞ ∞
4 ∞ ∞ 0 1
3 0 ∞ 0 4
5 5 ∞ ∞ 0
0 4 ∞ 0 ∞
Cont.
• consider path [1,4] make 1st row and 4th column to ∞ set
M[4][1]=∞
subtracting 1 from 2nd Row
total cost of node 4 is = optimum cost + M[1][4] + minimum row cost
= 24+ 3+1
= 28
∞ ∞ ∞ ∞ ∞
4 ∞ 4 ∞ 1
3 0 ∞ ∞ 4
∞ 5 0 ∞ 0
0 4 0 ∞ ∞
∞ ∞ ∞ ∞ ∞
4 ∞ 3 ∞ 0
3 0 ∞ ∞ 4
∞ 5 0 ∞ 0
0 4 0 ∞ ∞
Cont.
• consider path [1,5] make 1st row and 5th column to ∞ set
M[5][1]=∞
subtracting 3 from 1st Row
total cost of node 5 is = reduced column cost + old value M[1][5]
= 24+ 3+0
= 27
∞ ∞ ∞ ∞ ∞
4 ∞ 4 0 ∞
3 0 ∞ 0 ∞
5 5 0 ∞ ∞
∞ 4 0 0 ∞
∞ ∞ ∞ ∞ ∞
1 ∞ 4 0 ∞
0 0 ∞ 0 ∞
2 5 0 ∞ ∞
∞ 4 0 0 ∞
Cont.
• The partial state space tree will be
• The node 5 shows minimum cost. Hence node 5 will be an E
node. That means we select node 5 for expansion.
27
29 28 28 27
Cont.
• Step 3 :: Now we will consider the paths [1,5,2], [1,5,3] and [1,5,4] of state
space tree as given above consider path [1,5,2] make 1st row , 5th row and
second column as ∞ set M[5][1] and M[2][1] =∞
subtracting 3 from 1st Column.
Hence total cost of node 6 is =optimal cost node 5+column reduced cost+ M[5][2]
= 27+ 3+4
= 34
∞ ∞ ∞ ∞ ∞
∞ ∞ 4 0 1
3 ∞ ∞ 0 4
5 ∞ 0 ∞ 0
∞ ∞ ∞ ∞ ∞
∞ ∞ ∞ ∞ ∞
∞ ∞ 4 0 1
0 ∞ ∞ 0 4
2 ∞ 0 ∞ 0
∞ ∞ ∞ ∞ ∞
Cont.

More Related Content

What's hot

Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
Bhavin Darji
 
Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
Akshay Kamble
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
vikas dhakane
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
Indian Institute of Technology, Roorkee
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)
Viraj Patil
 
Greedy algorithm
Greedy algorithmGreedy algorithm
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman ProblemMaryam Alipour
 
Travelling Salesman Problem
Travelling Salesman ProblemTravelling Salesman Problem
Travelling Salesman ProblemDaniel Raditya
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
maharajdey
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
sana younas
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Hinal Lunagariya
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
Sahil Kumar
 
Sorting
SortingSorting
Binary Search
Binary SearchBinary Search
Binary Search
kunj desai
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
Md. Shafiuzzaman Hira
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Amit Kumar Rathi
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
Fahim Ferdous
 
8 queen problem
8 queen problem8 queen problem
8 queen problem
NagajothiN1
 

What's hot (20)

Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman Problem
 
Travelling Salesman Problem
Travelling Salesman ProblemTravelling Salesman Problem
Travelling Salesman Problem
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Sorting
SortingSorting
Sorting
 
Binary Search
Binary SearchBinary Search
Binary Search
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
8 queen problem
8 queen problem8 queen problem
8 queen problem
 

Viewers also liked

Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
Mohammad Shah - Al - Mamun Khondker
 
Traveling salesman problem__theory_and_applications
Traveling salesman problem__theory_and_applicationsTraveling salesman problem__theory_and_applications
Traveling salesman problem__theory_and_applicationsSachin Kheveria
 
Chapter 4 recruiting salesman
Chapter 4 recruiting salesmanChapter 4 recruiting salesman
Chapter 4 recruiting salesmanKimber Palada
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
Christian Kehl
 
The salesman
The salesmanThe salesman
The salesmanrakiarin
 
metaheuristic tabu pso
metaheuristic tabu psometaheuristic tabu pso
metaheuristic tabu pso
heba_ahmad
 
Ending The War Between Sales Marketing (revised)
Ending The War Between Sales  Marketing (revised)Ending The War Between Sales  Marketing (revised)
Ending The War Between Sales Marketing (revised)
Benjamin Chang-Kwon Chung
 
Who Owns Social Selling? Bridging the Divide Between Sales & Marketing
Who Owns Social Selling? Bridging the Divide Between Sales & MarketingWho Owns Social Selling? Bridging the Divide Between Sales & Marketing
Who Owns Social Selling? Bridging the Divide Between Sales & Marketing
LinkedIn Sales Solutions
 
Social Media Marketing Plan and ROI
Social Media Marketing Plan and ROISocial Media Marketing Plan and ROI
Social Media Marketing Plan and ROI
Lindsey Fair, MBA
 
10 Ways Sales & Marketing Can Close a Deal Together
10 Ways Sales & Marketing Can Close a Deal Together 10 Ways Sales & Marketing Can Close a Deal Together
10 Ways Sales & Marketing Can Close a Deal Together
Pedowitz Group
 
Bridging The Gap Between Sales And Marketing
Bridging The Gap Between Sales And MarketingBridging The Gap Between Sales And Marketing
Bridging The Gap Between Sales And Marketingguest3d2e50c
 
DialogTech Digital Summit: Embracing Conversations in a Digital Landscape
DialogTech Digital Summit: Embracing Conversations in a Digital LandscapeDialogTech Digital Summit: Embracing Conversations in a Digital Landscape
DialogTech Digital Summit: Embracing Conversations in a Digital Landscape
DialogTech
 
More than a marketing channel
More than a marketing channelMore than a marketing channel
More than a marketing channel
TNS
 
First 75 days plan for a Sales Leader
First 75 days plan for a Sales LeaderFirst 75 days plan for a Sales Leader
First 75 days plan for a Sales Leader
abhijitraykgp
 
Awesome Sales Closing Techniques
Awesome Sales Closing Techniques Awesome Sales Closing Techniques
Awesome Sales Closing Techniques
Achievers Group (Australia)
 
Show ant-colony-optimization-for-solving-the-traveling-salesman-problem
Show ant-colony-optimization-for-solving-the-traveling-salesman-problemShow ant-colony-optimization-for-solving-the-traveling-salesman-problem
Show ant-colony-optimization-for-solving-the-traveling-salesman-problem
jayatra
 
8 Sales Closing Techniques
8 Sales Closing Techniques8 Sales Closing Techniques
8 Sales Closing Techniques
xoombi
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationMeenakshi Devi
 
The secret to closing the sale
The secret to closing the saleThe secret to closing the sale
The secret to closing the saleEfrat Barzilay
 

Viewers also liked (20)

Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
Art of Salesmanship by Md. Sabur Khan, Chairman, Daffodil International Unive...
 
Traveling salesman problem__theory_and_applications
Traveling salesman problem__theory_and_applicationsTraveling salesman problem__theory_and_applications
Traveling salesman problem__theory_and_applications
 
Chapter 4 recruiting salesman
Chapter 4 recruiting salesmanChapter 4 recruiting salesman
Chapter 4 recruiting salesman
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
 
The salesman
The salesmanThe salesman
The salesman
 
metaheuristic tabu pso
metaheuristic tabu psometaheuristic tabu pso
metaheuristic tabu pso
 
Ending The War Between Sales Marketing (revised)
Ending The War Between Sales  Marketing (revised)Ending The War Between Sales  Marketing (revised)
Ending The War Between Sales Marketing (revised)
 
Who Owns Social Selling? Bridging the Divide Between Sales & Marketing
Who Owns Social Selling? Bridging the Divide Between Sales & MarketingWho Owns Social Selling? Bridging the Divide Between Sales & Marketing
Who Owns Social Selling? Bridging the Divide Between Sales & Marketing
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Social Media Marketing Plan and ROI
Social Media Marketing Plan and ROISocial Media Marketing Plan and ROI
Social Media Marketing Plan and ROI
 
10 Ways Sales & Marketing Can Close a Deal Together
10 Ways Sales & Marketing Can Close a Deal Together 10 Ways Sales & Marketing Can Close a Deal Together
10 Ways Sales & Marketing Can Close a Deal Together
 
Bridging The Gap Between Sales And Marketing
Bridging The Gap Between Sales And MarketingBridging The Gap Between Sales And Marketing
Bridging The Gap Between Sales And Marketing
 
DialogTech Digital Summit: Embracing Conversations in a Digital Landscape
DialogTech Digital Summit: Embracing Conversations in a Digital LandscapeDialogTech Digital Summit: Embracing Conversations in a Digital Landscape
DialogTech Digital Summit: Embracing Conversations in a Digital Landscape
 
More than a marketing channel
More than a marketing channelMore than a marketing channel
More than a marketing channel
 
First 75 days plan for a Sales Leader
First 75 days plan for a Sales LeaderFirst 75 days plan for a Sales Leader
First 75 days plan for a Sales Leader
 
Awesome Sales Closing Techniques
Awesome Sales Closing Techniques Awesome Sales Closing Techniques
Awesome Sales Closing Techniques
 
Show ant-colony-optimization-for-solving-the-traveling-salesman-problem
Show ant-colony-optimization-for-solving-the-traveling-salesman-problemShow ant-colony-optimization-for-solving-the-traveling-salesman-problem
Show ant-colony-optimization-for-solving-the-traveling-salesman-problem
 
8 Sales Closing Techniques
8 Sales Closing Techniques8 Sales Closing Techniques
8 Sales Closing Techniques
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
The secret to closing the sale
The secret to closing the saleThe secret to closing the sale
The secret to closing the sale
 

Similar to Traveling salesman problem

Travelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptxTravelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptx
Ashima Yasub
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Kaviya452563
 
Tsp bn b
Tsp bn bTsp bn b
Tsp bn b
Musika Fredrick
 
Asssignment problem
Asssignment problemAsssignment problem
Asssignment problem
Mamatha Upadhya
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
Kàŕtheek Jåvvàjí
 
Tsp branch and bound
Tsp branch and boundTsp branch and bound
Tsp branch and bound
Dr.DHANALAKSHMI SENTHILKUMAR
 
Insider mathematical
Insider   mathematicalInsider   mathematical
Insider mathematical
Aditi Saxena
 
Chapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptxChapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptx
PriyankaLunavat
 
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Firas Husseini
 
Data structure - traveling sales person and mesh algorithm
Data structure - traveling sales person and mesh algorithmData structure - traveling sales person and mesh algorithm
Data structure - traveling sales person and mesh algorithm
lavanya marichamy
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
joellivz
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
Satish Gummadi
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment Problem
VivekSaurabh7
 
06. Gaussian Elimination.pptx
06. Gaussian Elimination.pptx06. Gaussian Elimination.pptx
06. Gaussian Elimination.pptx
kibriaswe
 
12 LINEAR EQUATIONS.ppt
12 LINEAR EQUATIONS.ppt12 LINEAR EQUATIONS.ppt
12 LINEAR EQUATIONS.ppt
ElmabethDelaCruz1
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
Shameer Ahmed Koya
 

Similar to Traveling salesman problem (20)

Travelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptxTravelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptx
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Tsp bn b
Tsp bn bTsp bn b
Tsp bn b
 
Asssignment problem
Asssignment problemAsssignment problem
Asssignment problem
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
Tsp branch and bound
Tsp branch and boundTsp branch and bound
Tsp branch and bound
 
Insider mathematical
Insider   mathematicalInsider   mathematical
Insider mathematical
 
Chapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptxChapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptx
 
Ch07 linearspacealignment
Ch07 linearspacealignmentCh07 linearspacealignment
Ch07 linearspacealignment
 
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
Quantitativeanalysisfordecisionmaking 13427543542352-phpapp02-120719222252-ph...
 
Data structure - traveling sales person and mesh algorithm
Data structure - traveling sales person and mesh algorithmData structure - traveling sales person and mesh algorithm
Data structure - traveling sales person and mesh algorithm
 
Lec20
Lec20Lec20
Lec20
 
Assignment problem
Assignment problemAssignment problem
Assignment problem
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment Problem
 
06. Gaussian Elimination.pptx
06. Gaussian Elimination.pptx06. Gaussian Elimination.pptx
06. Gaussian Elimination.pptx
 
Magic square made easy
Magic square made easyMagic square made easy
Magic square made easy
 
12 LINEAR EQUATIONS.ppt
12 LINEAR EQUATIONS.ppt12 LINEAR EQUATIONS.ppt
12 LINEAR EQUATIONS.ppt
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
 

Recently uploaded

Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
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
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
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...
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

Traveling salesman problem

  • 1. Traveling Salesman Problem • Problem Statement – If there are n cities and cost of traveling from any city to any other city is given. – Then we have to obtain the cheapest round-trip such that each city is visited exactly ones returning to starting city, completes the tour. – Typically travelling salesman problem is represent by weighted graph.
  • 2. Cont. • Row Minimization – To understand solving of travelling salesman problem using branch and bound approach we will reduce the cost of cost matrix M, by using following formula. – Red_Row(M) = [ Mij – min{ Mij | 1<=j<=n} ] where Mij < ∞
  • 3. Cont. • Column Minimization – Now we will reduce the matrix by choosing minimum for each column. – The formula of column reduction of matrix is – Red_col(M)=Mij – min { Mij | 1<=j<=n} where Mij < ∞
  • 4. Cont. • Full Reduction – Let M bee the cost matrix for TSP for n vertices then M is called reduced if each row and each column consist of entire entity ∞ entries or else contain at least one zero. – The full reduction can be achieved by applying both row_reduction and column_reduction.
  • 5. Cont. • Dynamic Reduction – Using dynamic reduction we can make the choice of edge i->j with optimal cost. – Step in dynamic reduction technique 1. Draw a space tree with optimal cost at root node. 2. Obtain the cost of matrix for path i->j by making I row and j column entries as ∞. Also set M[i][j]=∞ 3. Cost corresponding node x with path I, j is optimal cost + reduced cost+ M[i][j] 4. Set node with minimum cost as E-node and generate its children. Repeat step 1 to 4 for completing tour with optimal cost.
  • 6. Example • Solve the TSP for the following cost matrix ∞ 11 10 9 6 8 ∞ 7 3 4 8 4 ∞ 4 8 11 10 5 ∞ 5 6 9 2 5 ∞
  • 7. Solution Step 1 : • We will find the minimum value from each row and subtract the value from corresponding row Minvalue reduce matrix ∞ 11 10 9 6 8 ∞ 7 3 4 8 4 ∞ 4 8 11 10 5 ∞ 5 6 9 2 5 ∞ ∞ 5 4 3 0 5 ∞ 4 0 1 4 0 ∞ 0 4 6 5 0 ∞ 0 1 4 0 0 ∞ -> 6 -> 3 ->4 ->5 ->5 --------- 23
  • 8. Cont. • Now we will obtain minimum value from each column. If they column contain 0 the ignore that column and a fully reduced matrix can be obtain. subtracting 1 from 1st column ∞ 5 4 3 0 5 ∞ 4 0 1 4 0 ∞ 0 4 6 5 0 ∞ 0 1 4 0 0 ∞ ∞ 5 4 3 0 4 ∞ 4 0 1 3 0 ∞ 0 4 5 5 0 ∞ 0 0 4 0 0 ∞
  • 9. Cont. • Total reduced cost = total reduced row cost + total reduced column cost = 23 + 1 = 24 • Now we will set 24 as the optimal cost 24->this is the lower bound
  • 10. Cont. • Step 2 :: Now we will consider the paths [1,2], [1,3], [1,4] and [1,5] of state space tree as given above consider path [1,2] make 1st row and 2nd column to ∞ set M[2][1]=∞ • Now we will find min value from each corresponding column. • c ∞ ∞ ∞ ∞ ∞ ∞ ∞ 4 0 1 3 ∞ ∞ 0 4 5 ∞ 0 ∞ 0 0 ∞ 0 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ 4 0 1 3 ∞ ∞ 0 4 5 ∞ 0 ∞ 0 0 ∞ 0 0 ∞
  • 11. Cont. • Hence total receded cost for node 2 is = Optimal cost+old value of M[1][2] = 24 + 5 = 25 • Consider path (1,3). Make 1st row, 3rd column to be ∞ set M[3][1] = ∞
  • 12. Cont. There is no minimum value from any row and column Hence total cost of node 3 is = optimum cost + M[1][3] = 24+ 4 = 28 ∞ ∞ ∞ ∞ ∞ 4 ∞ ∞ 0 1 3 0 ∞ 0 4 5 5 ∞ ∞ 0 0 4 ∞ 0 ∞
  • 13. Cont. • consider path [1,4] make 1st row and 4th column to ∞ set M[4][1]=∞ subtracting 1 from 2nd Row total cost of node 4 is = optimum cost + M[1][4] + minimum row cost = 24+ 3+1 = 28 ∞ ∞ ∞ ∞ ∞ 4 ∞ 4 ∞ 1 3 0 ∞ ∞ 4 ∞ 5 0 ∞ 0 0 4 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ 4 ∞ 3 ∞ 0 3 0 ∞ ∞ 4 ∞ 5 0 ∞ 0 0 4 0 ∞ ∞
  • 14. Cont. • consider path [1,5] make 1st row and 5th column to ∞ set M[5][1]=∞ subtracting 3 from 1st Row total cost of node 5 is = reduced column cost + old value M[1][5] = 24+ 3+0 = 27 ∞ ∞ ∞ ∞ ∞ 4 ∞ 4 0 ∞ 3 0 ∞ 0 ∞ 5 5 0 ∞ ∞ ∞ 4 0 0 ∞ ∞ ∞ ∞ ∞ ∞ 1 ∞ 4 0 ∞ 0 0 ∞ 0 ∞ 2 5 0 ∞ ∞ ∞ 4 0 0 ∞
  • 15. Cont. • The partial state space tree will be • The node 5 shows minimum cost. Hence node 5 will be an E node. That means we select node 5 for expansion. 27 29 28 28 27
  • 16. Cont. • Step 3 :: Now we will consider the paths [1,5,2], [1,5,3] and [1,5,4] of state space tree as given above consider path [1,5,2] make 1st row , 5th row and second column as ∞ set M[5][1] and M[2][1] =∞ subtracting 3 from 1st Column. Hence total cost of node 6 is =optimal cost node 5+column reduced cost+ M[5][2] = 27+ 3+4 = 34 ∞ ∞ ∞ ∞ ∞ ∞ ∞ 4 0 1 3 ∞ ∞ 0 4 5 ∞ 0 ∞ 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ 4 0 1 0 ∞ ∞ 0 4 2 ∞ 0 ∞ 0 ∞ ∞ ∞ ∞ ∞
  • 17. Cont.