SlideShare a Scribd company logo
Travelling Salesman Problem using
branch and bound
•Find a tour of minimum cost starting from a node S going
through other nodes only once and returning to the
starting point S.
• Let G=(V,E) be a directed graph defining an instances of
TSP.
• Let Cij cost of edge <i, j>
• Cij =∞ if <i, j> E∉
• A row (column) is said to be reduced iff it contains at
least one zero & remaining entries are non negative.
• A matrix is reduced iff every row & column is reduced.
•The TSP starts from node 1: Node 1
The reduced cost is: RCL = 25
So the cost of node 1 is: Cost (1)
Node 2
Cost of edge <1,2> is: A(1,2) = 10
Set A(2,1) = inf , row 1 and column 2 = inf
The resulting cost matrix is:
•The matrix is reduced:
•RCL = 0
•The cost of node 2
Cost(2) = cost(1) + A(1,2) = 25 + 10 = 35
Node 3
Cost of edge <1,3> is: A(1,3) = 17
Set A(3,1) = inf ,
row 1 and column 3 = inf
The resulting cost matrix is:
•The matrix row is reduced:
•Reduce column 1 by 11:
•RCL = 11
•The cost of node 3
Cost(3) = cost(1) + RCL+A(1,3) = 25 + 17+11 = 53
Node 4
Cost of edge <1,4> is: A(1,4) = 0
Set A(4,1) = inf, row 1 and column 4 = inf
The resulting cost matrix is:
•The matrix row & column are reduced:
RCL = 0
•The cost of node 4
Cost(4) = cost(1) + RCL+A(1,4) = 25 + 0+0 = 25
Node 5
Cost of edge <1,5> is: A(1,5) = 1
Set A(5,1) = inf
,row 1 and column 5 = inf
The resulting cost matrix is:
Reduce row #4: Reduce by
3
RCL = 2+3
•The cost of node 5
Cost(5) = cost(1) + RCL+A(1,5) = 25 + 5+1 = 31
Reduce row #2:
Reduce by 2
In summary:
So the live nodes we have so far are:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
4: cost(4) = 25, path: 1->4
5: cost(5) = 31, path: 1->5
Explore the node with the lowest cost: Node 4 has a cost of 25
Vertices to be explored from node 4: 2, 3, and 5
Now we are starting from the cost matrix at node 4 is:
Node 6
Cost of edge <4,2> is: A(4,2) = 3
Set A(2,1) = inf , row 4 and column 2 = inf
The resulting cost matrix is:
Rows and columns are reduced
RCL = 0
•The cost of node 6
Cost(6) = cost(4) + RCL+A(4,2) = 25 + 0+3 = 28
(path is 1->4->2)
Node 7
Cost of edge <4,3> is: A(4,3) = 12
Set A(3,1) = inf , row 4 and column 3 = inf
The resulting cost matrix is:
Reduce row #3: by 2
Reduce column # 1: by 11
RCL = 2+11
•The cost of node 7
Cost(7) = cost(4) + RCL+A(4,3) = 25 + 13+12 = 50
(path is 1->4->3)
Node 8
Cost of edge <4,5> is: A(4,5) = 0
Set A(5,1) = inf , row 4 and column 5 = inf
The resulting cost matrix is:
Reduced row 2: by 11
Columns are Reduced
RCL = 11
•The cost of node 8
Cost(8) = cost(4) + RCL+A(4,5) = 25 + 11+0 = 36
(path is 1->4->5)
In summary:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
5: cost(5) = 31, path: 1->5
6: cost(6) = 28, path: 1->4->2
7: cost(7) = 50, path: 1->4->3
8: cost(8) = 36, path: 1->4->5
Explore the node with the lowest cost: Node 6 has a cost of 28
Vertices to be explored from node 6: 3 and 5
Now we are starting from the cost matrix at node 6 is:
Node 9
Cost of edge <2,3> is: A(2,3) = 11
Set A(3,1) = inf , row 2 and column 3 = inf
The resulting cost matrix is:
Reduced row 3: by 2
Reduced column 1: by 11
RCL = 2+11
•The cost of node 9
Cost(9) = cost(6) + RCL+A(2,3) = 28 + 13+11 = 52
(path is 1->4->2->3)
Node 10
Cost of edge <2,5> is: A(2,5) = 0
Set A(5,1) = inf , row 2 and column 5 = inf
The resulting cost matrix is:
Reduced row and columns
RCL = 0
•The cost of node 10
Cost(10) = cost(6) + RCL+A(2,5) = 28 + 0+0 = 28
(path is 1->4->2->5)
In summary:
2: cost(2) = 35, path: 1->2
3: cost(3) = 53, path: 1->3
5: cost(5) = 31, path: 1->5
7: cost(7) = 50, path: 1->4->3
8: cost(8) = 36, path: 1->4->5
9: cost(9) = 52, path: 1->4->2->3
10: cost(2) = 28, path: 1->4->2->5
Explore the node with the lowest cost: Node 10 has a cost of 28
Vertices to be explored from node 10: 3
Now we are starting from the cost matrix at node 10 is:
Node 11
Cost of edge <5,3> is: A(5,3) = 0
Set A(3,1) = inf , row 5 and column 3 = inf
The resulting cost matrix is:
Reduced row and column
RCL = 0
•The cost of node 11
Cost(11 = cost(10) + RCL+A(5,3) = 28 + 0+0 = 28
(path is 1->4->2->5->3)
State Space Tree:

More Related Content

What's hot

Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
mansab MIRZA
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
AntaraBhattacharya12
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
Amit Kumar Rathi
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
Saga Valsalan
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Treezhaokatherine
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
vikas dhakane
 
Network flows
Network flowsNetwork flows
Network flows
Richa Bandlas
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
Dr Sandeep Kumar Poonia
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
Sahil Kumar
 
Modeling with Recurrence Relations
Modeling with Recurrence RelationsModeling with Recurrence Relations
Modeling with Recurrence Relations
Devanshu Taneja
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
Mohammed Hussein
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
smruti sarangi
 
Backtracking
Backtracking  Backtracking
Backtracking
Vikas Sharma
 
Pigeonhole Principle
Pigeonhole  PrinciplePigeonhole  Principle
Pigeonhole Principle
sheiblu
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
MdSajjadulislamBappi
 
Euler graph
Euler graphEuler graph
Euler graph
AAQIB PARREY
 
Maxflow
MaxflowMaxflow

What's hot (20)

Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Tree
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
Network flows
Network flowsNetwork flows
Network flows
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Modeling with Recurrence Relations
Modeling with Recurrence RelationsModeling with Recurrence Relations
Modeling with Recurrence Relations
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
 
Backtracking
Backtracking  Backtracking
Backtracking
 
Pigeonhole Principle
Pigeonhole  PrinciplePigeonhole  Principle
Pigeonhole Principle
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
Euler graph
Euler graphEuler graph
Euler graph
 
Maxflow
MaxflowMaxflow
Maxflow
 

Similar to Tsp branch and bound

Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
Kàŕtheek Jåvvàjí
 
travelingsalesmanproblem-170122053648.pdf
travelingsalesmanproblem-170122053648.pdftravelingsalesmanproblem-170122053648.pdf
travelingsalesmanproblem-170122053648.pdf
mounikanarra3
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
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
 
routing algorithm
routing algorithmrouting algorithm
routing algorithm
AnusuaBasu
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
Nv Thejaswini
 
Travelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptxTravelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptx
Ashima Yasub
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
Kai Katsumata
 
All pair shortest path
All pair shortest pathAll pair shortest path
All pair shortest path
Arafat Hossan
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 
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
 
Dijkstra's algorithm
Dijkstra's algorithmDijkstra's algorithm
Dijkstra's algorithmgsp1294
 
IAP PPT-1.pptx
IAP PPT-1.pptxIAP PPT-1.pptx
IAP PPT-1.pptx
HirazNor
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)
mohsinggg
 
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
Austin Benson
 
Implementation of Low Power and Area Efficient Carry Select Adder
Implementation of Low Power and Area Efficient Carry Select AdderImplementation of Low Power and Area Efficient Carry Select Adder
Implementation of Low Power and Area Efficient Carry Select Adder
inventionjournals
 

Similar to Tsp branch and bound (20)

Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
travelingsalesmanproblem-170122053648.pdf
travelingsalesmanproblem-170122053648.pdftravelingsalesmanproblem-170122053648.pdf
travelingsalesmanproblem-170122053648.pdf
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
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
 
routing algorithm
routing algorithmrouting algorithm
routing algorithm
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
Travelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptxTravelling salaseman problem (1).pptx
Travelling salaseman problem (1).pptx
 
Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法Linear Cryptanalysis Lecture 線形解読法
Linear Cryptanalysis Lecture 線形解読法
 
All pair shortest path
All pair shortest pathAll pair shortest path
All pair shortest path
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
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
 
Dijkstra's algorithm
Dijkstra's algorithmDijkstra's algorithm
Dijkstra's algorithm
 
IAP PPT-1.pptx
IAP PPT-1.pptxIAP PPT-1.pptx
IAP PPT-1.pptx
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)
 
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
Tall-and-skinny Matrix Computations in MapReduce (ICME MR 2013)
 
Implementation of Low Power and Area Efficient Carry Select Adder
Implementation of Low Power and Area Efficient Carry Select AdderImplementation of Low Power and Area Efficient Carry Select Adder
Implementation of Low Power and Area Efficient Carry Select Adder
 

Recently uploaded

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
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
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
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
 
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
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
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
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
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
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
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
 
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
 
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
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 

Recently uploaded (20)

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
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
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
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
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
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
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
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
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.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
 
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
 
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
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 

Tsp branch and bound

  • 1. Travelling Salesman Problem using branch and bound •Find a tour of minimum cost starting from a node S going through other nodes only once and returning to the starting point S. • Let G=(V,E) be a directed graph defining an instances of TSP. • Let Cij cost of edge <i, j> • Cij =∞ if <i, j> E∉ • A row (column) is said to be reduced iff it contains at least one zero & remaining entries are non negative. • A matrix is reduced iff every row & column is reduced.
  • 2.
  • 3.
  • 4. •The TSP starts from node 1: Node 1 The reduced cost is: RCL = 25 So the cost of node 1 is: Cost (1)
  • 5. Node 2 Cost of edge <1,2> is: A(1,2) = 10 Set A(2,1) = inf , row 1 and column 2 = inf The resulting cost matrix is: •The matrix is reduced: •RCL = 0 •The cost of node 2 Cost(2) = cost(1) + A(1,2) = 25 + 10 = 35
  • 6. Node 3 Cost of edge <1,3> is: A(1,3) = 17 Set A(3,1) = inf , row 1 and column 3 = inf The resulting cost matrix is: •The matrix row is reduced: •Reduce column 1 by 11: •RCL = 11 •The cost of node 3 Cost(3) = cost(1) + RCL+A(1,3) = 25 + 17+11 = 53
  • 7. Node 4 Cost of edge <1,4> is: A(1,4) = 0 Set A(4,1) = inf, row 1 and column 4 = inf The resulting cost matrix is: •The matrix row & column are reduced: RCL = 0 •The cost of node 4 Cost(4) = cost(1) + RCL+A(1,4) = 25 + 0+0 = 25
  • 8. Node 5 Cost of edge <1,5> is: A(1,5) = 1 Set A(5,1) = inf ,row 1 and column 5 = inf The resulting cost matrix is: Reduce row #4: Reduce by 3 RCL = 2+3 •The cost of node 5 Cost(5) = cost(1) + RCL+A(1,5) = 25 + 5+1 = 31 Reduce row #2: Reduce by 2
  • 9. In summary: So the live nodes we have so far are: 2: cost(2) = 35, path: 1->2 3: cost(3) = 53, path: 1->3 4: cost(4) = 25, path: 1->4 5: cost(5) = 31, path: 1->5 Explore the node with the lowest cost: Node 4 has a cost of 25 Vertices to be explored from node 4: 2, 3, and 5 Now we are starting from the cost matrix at node 4 is:
  • 10. Node 6 Cost of edge <4,2> is: A(4,2) = 3 Set A(2,1) = inf , row 4 and column 2 = inf The resulting cost matrix is: Rows and columns are reduced RCL = 0 •The cost of node 6 Cost(6) = cost(4) + RCL+A(4,2) = 25 + 0+3 = 28 (path is 1->4->2)
  • 11. Node 7 Cost of edge <4,3> is: A(4,3) = 12 Set A(3,1) = inf , row 4 and column 3 = inf The resulting cost matrix is: Reduce row #3: by 2 Reduce column # 1: by 11 RCL = 2+11 •The cost of node 7 Cost(7) = cost(4) + RCL+A(4,3) = 25 + 13+12 = 50 (path is 1->4->3)
  • 12. Node 8 Cost of edge <4,5> is: A(4,5) = 0 Set A(5,1) = inf , row 4 and column 5 = inf The resulting cost matrix is: Reduced row 2: by 11 Columns are Reduced RCL = 11 •The cost of node 8 Cost(8) = cost(4) + RCL+A(4,5) = 25 + 11+0 = 36 (path is 1->4->5)
  • 13. In summary: 2: cost(2) = 35, path: 1->2 3: cost(3) = 53, path: 1->3 5: cost(5) = 31, path: 1->5 6: cost(6) = 28, path: 1->4->2 7: cost(7) = 50, path: 1->4->3 8: cost(8) = 36, path: 1->4->5 Explore the node with the lowest cost: Node 6 has a cost of 28 Vertices to be explored from node 6: 3 and 5 Now we are starting from the cost matrix at node 6 is:
  • 14. Node 9 Cost of edge <2,3> is: A(2,3) = 11 Set A(3,1) = inf , row 2 and column 3 = inf The resulting cost matrix is: Reduced row 3: by 2 Reduced column 1: by 11 RCL = 2+11 •The cost of node 9 Cost(9) = cost(6) + RCL+A(2,3) = 28 + 13+11 = 52 (path is 1->4->2->3)
  • 15. Node 10 Cost of edge <2,5> is: A(2,5) = 0 Set A(5,1) = inf , row 2 and column 5 = inf The resulting cost matrix is: Reduced row and columns RCL = 0 •The cost of node 10 Cost(10) = cost(6) + RCL+A(2,5) = 28 + 0+0 = 28 (path is 1->4->2->5)
  • 16. In summary: 2: cost(2) = 35, path: 1->2 3: cost(3) = 53, path: 1->3 5: cost(5) = 31, path: 1->5 7: cost(7) = 50, path: 1->4->3 8: cost(8) = 36, path: 1->4->5 9: cost(9) = 52, path: 1->4->2->3 10: cost(2) = 28, path: 1->4->2->5 Explore the node with the lowest cost: Node 10 has a cost of 28 Vertices to be explored from node 10: 3 Now we are starting from the cost matrix at node 10 is:
  • 17. Node 11 Cost of edge <5,3> is: A(5,3) = 0 Set A(3,1) = inf , row 5 and column 3 = inf The resulting cost matrix is: Reduced row and column RCL = 0 •The cost of node 11 Cost(11 = cost(10) + RCL+A(5,3) = 28 + 0+0 = 28 (path is 1->4->2->5->3)