Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Implement a genetic algorithm to find a solution to the Traveling Salesman Probl

ID: 3867161 • Letter: I

Question


Implement a genetic algorithm to find a solution to the Traveling Salesman Problem for the following distance matrix: There are 15 cities indicated by 1-15. The distance from city 1 to city 1 is nothing. The distance from city 2 to city 1 is 1. The distance from city 3 to city 1 is 10, and so forth. Write the algorithm in pseudo code or in any notation you want that finds the shortest route to take between the cities. You do not need to implement the algorithm in a programming language. You are just defining and describing a solution to the Traveling Salesman Problem using the information in the chart.

Explanation / Answer

Given the information, following alogorithm can be used to get the shortest path root for TSP:

1.Analyze all the rows (Horizontal data) and select the minimum value across all the rows

2. From the above step we get an edge with least value and two corresponding cities.

3. Choose any one of those two to start the journey

4. Look at the row corresponding to the other city (not chosen as a start point in step 3) in the data and choose a minimum value in that row to get
   the other city to visit to.

5. Keep on repeating step 4 till all the cities get visited.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote