Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
33 views1 page

TSP Solution With Steps

The Travelling Salesman Problem (TSP) seeks the shortest route visiting each city once and returning to the start. The solution involves generating all permutations of cities, calculating the total travel cost for each, and identifying the route with the minimum cost. The optimal path found is C1 -> C2 -> C3 -> C5 -> C4, with a minimum cost of 54.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

TSP Solution With Steps

The Travelling Salesman Problem (TSP) seeks the shortest route visiting each city once and returning to the start. The solution involves generating all permutations of cities, calculating the total travel cost for each, and identifying the route with the minimum cost. The optimal path found is C1 -> C2 -> C3 -> C5 -> C4, with a minimum cost of 54.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Travelling Salesman Problem Solution

Step 1: Define the Problem


The Travelling Salesman Problem (TSP) involves finding the shortest possible route that
visits each city exactly once and returns to the starting city. The given cost matrix is:

C1 C2 C3 C4 C5

C1 ∞ 10 13 11 12

C2 10 ∞ 12 10 11

C3 14 13 ∞ 13 11

C4 11 10 14 ∞ 10

C5 12 11 12 10 ∞

Step 2: List All Permutations


To solve the TSP, all possible permutations of the cities are generated. Each permutation
represents a potential route. For example:

C1 -> C2 -> C3 -> C4 -> C5

C1 -> C2 -> C3 -> C5 -> C4

C1 -> C2 -> C4 -> C3 -> C5

C1 -> C2 -> C4 -> C5 -> C3

C1 -> C2 -> C5 -> C3 -> C4

Step 3: Calculate the Total Cost for Each Permutation


For each route, the total cost is calculated by summing up the costs of traveling between
consecutive cities in the route, including returning to the starting city.

Step 4: Identify the Optimal Route


After calculating the total cost for all possible routes, the route with the minimum cost is
identified as the optimal route.

Solution
The optimal path is: C1 -> C2 -> C3 -> C5 -> C4

The minimum cost is: 54

You might also like