0% found this document useful (0 votes)
15 views15 pages

Travelling Salesman Problem: Using Branch and Bound Method

The document discusses the Traveling Salesman Problem (TSP), an optimization challenge aimed at finding the shortest route visiting each city once and returning to the start. It explains the Branch and Bound method as an efficient approach to solve TSP by systematically exploring paths while eliminating unpromising ones. The document also outlines the algorithm steps and real-world applications of TSP, emphasizing its importance in logistics and scheduling.

Uploaded by

saimrais7499
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views15 pages

Travelling Salesman Problem: Using Branch and Bound Method

The document discusses the Traveling Salesman Problem (TSP), an optimization challenge aimed at finding the shortest route visiting each city once and returning to the start. It explains the Branch and Bound method as an efficient approach to solve TSP by systematically exploring paths while eliminating unpromising ones. The document also outlines the algorithm steps and real-world applications of TSP, emphasizing its importance in logistics and scheduling.

Uploaded by

saimrais7499
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Travelling
Salesman Problem
Using Branch and Bound method
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

What is TSP?
Algorithm….
The Traveling Salesman Problem (TSP) is a classic
optimization problem where the goal is to find the
shortest possible route that visits each city exactly once
and returns to the starting point.

The Branch and Bound technique offers an efficient way


to tackle this complexity by systematically exploring all
possible paths while eliminating those that cannot yield
better solutions than the current best.
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Branch & Bound


Understanding….

Branch and Bound (B&B) is a systematic


way to explore all possible solutions to a
problem, but avoids evaluating
unnecessary paths by using bounds to cut
off unpromising branches.

It’s a smarter alternative to brute-force


approaches. While brute-force explores all
n! possible tours, branch and bound tries to
eliminate as many as possible.
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

ALGORITHM
A
1. Perform row and column reduction on
1
the cost matrix.
2. Calculate the cost of the first node
(e.g., A):
Cost = sum of reductions
3. Choose the next node (e.g., A → B): Path
○ Set row A, column B, and B C D
path B → A to ∞.
2 3 4
○ Perform reduction again.
○ Compute:
Cost = parent cost + reduction cost
+ cost from A to B C D B D B C
4. After exploring all children of a node, 5 6 7 8 9 10
expand the node with the least total
cost, and repeat.
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn 1. Perform row and column reduction on the cost matrix.

Q. Find the Minimum Cost for following Travelling Salesman using Branch & Bound.

20
∞ 20 30 10 11 A B
Reduction: 15
Subtracting min element of a row/column 5
15 ∞ 16 4 2 from the same row/column only. 16 16
4 30
11
2 3
3 5 ∞ 2 4 Reduced matrix:
All the row or column have atleast one 4
19 6
10
ZERO element.
19 6 18 ∞ 3 E 7
C
4

16 4 7 16 ∞ 1 3 3 2
16
18

10 ∞ 10 20 0 1 ∞ 10 17 0 1 D
2 13 ∞ 14 2 0 12 ∞ 11 2 0

2 1 3 ∞ 0 2 0 3 ∞ 0 2

3 16 3 15 ∞ 0 15 3 12 ∞ 0

4 12 0 3 12 ∞ 11 0 0 12 ∞
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn

1. Calculate the cost of the first node (here its, A):


Cost = 10 + 2 + 2 + 3 + 4 + 1 + 3

Cost = 25

2. Choose the next node (e.g., A → B):

a. Set row A, column B, and path B → A to ∞.


b. Perform reduction again.
c. Compute:
Cost = parent cost + reduction cost + cost from A to B

A→B

No reduction required!

Cost = 25 + 0 + 10

Cost(AB) = 35
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn
3. Choose the next node (e.g., A → C):

a. Set row A, column B, and path C → A to ∞.


b. Perform reduction again.
c. Compute:
Cost = parent cost + reduction cost + cost from A to C

A→C
11

Column Reduction → column 1

Cost = 25 + 11 + 17

Cost(AC) = 53
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn
A→D

No reduction required!

Cost = 25 + 0 + 0

Cost(AD) = 25

A→E

2 Row Reduction → row 2 & 4

Cost = 25 + (2 + 3) + 1

3 Cost(AE) = 31
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn
4.After exploring all children of a node, expand the node with the least total
cost, and repeat.
Hence A → D selected. Cost= 25.

Now, Set row D, column B, and path B → A to ∞.

D→B
No reduction required!

Cost = 25 + 0 + 3

Cost(DB) = 28

Now, Set row D, column C, and path C → A to ∞.

D→C Reduction → row 3 & column 1

Cost = 25 + 13 + 12
2
Cost(DC) = 50

11
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn
Now, Set row D, column E, and path E → A to ∞.

D→E Reduction → row 2


11
Cost = 25 + 11 + 0

Cost(DE) = 36

Since cost of D → B is smallest we select path A → D → B with Cost = 28

Now, Set row B, column C, and path C → A to ∞.

B→C Reduction → row 3 & column 1

Cost = 25 + (2+11) + 11
2
Cost(BC) = 49

11
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn
Now, Set row B, column E, and path E → A to ∞.

B→E
No reduction required!
A
Cost = 28 + 0 + 0

Cost(BE) = 28

B C D E
Since cost of B → E is smallest we select path A → D → B → E with Cost = 28
And,
Finally E → C with the cost,
B C E
Cost = Cost(BE) + cost from B to C
28 + 0
C E
Cost = 28;
PATH = A → D → B → E → C → A
C

A
Department: SE-DS | Roll No: 23DS30 | 23DS23 | 23DS41 | 24DDS03

Let’s Learn 1. RESULTANT GRAPH.

A B

3
6

2
7
E C
10

D
Real World
Application
● Delivery Route Optimization: Scheduling Algorithms;
TSP helps delivery companies find the most efficient routes for their
vehicles to visit multiple customers, minimizing fuel consumption, travel
time, and overall costs.

● Order-Picking in Warehouses:
Finding the shortest route for a vehicle to pick up orders from multiple
locations in a warehouse can be modeled as a TSP.
Why we Learn TSP ?
● In OS:
TSP principles can help find the most efficient sequence for executing tasks,
minimizing context switching overhead and improving overall system
performance.

Conclusion
TSP is a computationally challenging problem with n! permutations,
but crucial in fields like logistics, planning, and routing.
Bye…..

● Branch and Bound offers a smarter alternative to brute-force:


○ Reduces the search space using cost bounds.
○ Avoids exploring suboptimal paths early through pruning.
○ Efficiently narrows down to the optimal solution.
● Key Techniques:
○ Matrix Reduction (row & column) to estimate lower
bounds.
○ Cost Calculation at each node to guide the search.
○ Least-Cost Node Expansion ensures priority to promising
paths.
● Result: Significant performance improvement over naive
methods, especially for medium-sized instances.

THANK YOU
23DS30
23DS41
23DS23
24DDS03

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy