Solution to Exercise 3: Finding the Best Way to Travel
Explore how to use population-based metaheuristic methods like mutation and crossover to solve a modified traveling salesman problem. This lesson guides you through minimizing total travel time by finding the best city permutation, implementing swaps, and using Python's numpy functions for efficient solutions.
We'll cover the following...
This exercise is a modified version of the famous traveling salesman problem. Let’s solve it.
Exercise 3
The matrix tells us the time required to go from one city to another. As the salesman has to visit all the cities, we need to figure out how to sort them in a way that minimizes the total time spent on travel. We need to keep in mind that the salesman wants to finish in the same city he starts in.
A solution is an arrangement of the cities. As the cities are numbered from to ...