Member-only story

A look at the Travelling Salesman Problem in Python

Crystal X
2 min readMar 31, 2022

--

In my most recent post I discussed the Hill Climbing algorithm, which can be viewed here:- https://tracyrenee61.medium.com/youtube-video-review-hill-climbing-algorithm-in-artificial-intelligence-7b62500b211f

Because the Hill Climbing algorithm can be used to solve the Travelling Salesman Problem, I thought it would be a good idea to discuss this algorithm as well.

Simply stated, given a set of cities and distances between every pair of cities, the problem is to find the shortest possible route that visits every city exactly once and returns to the starting point.

During my research, I have found that there are many different algorithms for the Travelling Salesman Problem, so below is a flowchart of one way to solve this problem:-

There are also several different scripts that can be used to solve this problem, and during my research I have found three in particular.

I have prepared a Code Review for the three scripts in Python that I have found to solve the Travelling Salesman Problem, which can be viewed here:- https://www.youtube.com/watch?v=erSrF92R4k0

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet