Question: Python code. The travelling salesman problem asks the following question: Given a list of cities and the distances between each pair of cities, what is

Python code. The travelling salesman problem asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?
Apply Genetic Algorithm to Travelling Salesman Problem (TSP) for the following Table. The table below shows the distances between each city in kilometres.
A fitness function calculates the total distance between each city in the chromosome's permutation.
\table[[,Brighton,Bristol,Cambridge,Glasgow,Liverpool,London,Manchester,Oxford],[Brighton,0,172,145,607,329,72,312,120],[Bristol,172,0,192,494,209,158,216,92],[Cambridge,145,192,0,490,237,75,205,100],[Glasgow,607,494,490,0,286,545,296,489],[Liverpool,329,209,237,286,0,421,49,208],[London,72,158,75,545,421,0,249,75],[Manchester,312,216,205,296,49,249,9,194],[Oxford,120,92,100,489,208,75,194,0]]
Python code. The travelling salesman problem asks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!