TSP_119
TSP_119
Salesman
Algorithm
Presented By
Md Sadman Sakib
Our team members who have
contributed their best.
Siam 2023-1-60-
119
Redoan Islam
2023-1-60-
118
Rakibul Islam
2023-1-60-
226
Introducti
on
Introduction
The Traveling Salesman Problem (TSP) is an optimization algorithm
for finding the shortest route to visit all cities exactly once and
return to the starting point. The aim is to minimize the total travel
cost or distance. This algorithm uses recursive backtracking to solve
the problem by exploring all possible paths and selecting the one
with the minimum cost. This approach ensures efficiency for small
datasets by eliminating unnecessary paths early which reduced the
computational burden. The output includes the optimal path and its
corresponding minimal travel cost, providing an ideal solution for
the given set of cities.
Flowcha
rt
Flowchart
Graphical
Representati
on
Graphical Representation
For 4 cities
The cost matrix is:
0 4 1 3
4 0 2 1
1 2 0 5
3 1 5 0
Number of States: 2n ⋅n
All possible subsets of cities = : 2n
iteration through all cities for each subset = n
complexity = O( n⋅2n )
Path Reconstruction:
Reconstructing the optimal path requires a single loop over the cities.
complexity = O(n)
The Travelling Salesman Problem (TSP) aims to find the shortest route visiting all
cities exactly once and returning to the start. Dynamic programming and
approximation algorithms offer efficient solutions for varying problem sizes. TSP is
widely used in logistics, networking, and route planning, balancing theory and
practical applications.
Thank
You