[Solved]Python Program Use Hill Climbing Algo Traveling Salesman Problem Optimization Problem Fini Q37109289
Python Program – USE HILL CLIMBING ALGO
The traveling salesman problem is an optimization problem wherethere is a finite number of cities, and the cost of travel betweeneach city is known. The goal is to find an ordered set of all thecities for the salesman to visit such that the cost or totaldistance traveled by the salesman is minimized.
The following shoes some cities in US and the route that isoptimal for the salesman to follow to minimize the totaldistance.
Generate 15 random points or cities in python. Each point can berepresented by a location tuple (x,y). Assume x ranges from 0-5 andy ranges from 0-5. Select an ordered set of these 15 points e.g.,{(x4,y4), (x9,y9),…., 15 points}. This will represent a singleindividual/chromosome which basically tells the sales person thathe/she should visit 4th city first, then 9thcity and so on. The heuristic value of this individual will be thetotal distance covered by the salesman or the sum of distancebetween consecutive pair of those 15 points in that individual.Likewise generate a pollution of 45 individuals (possibly byrandomly permuting this set). Keep in mind that the salesman is notallowed to visit any city twice i.e., the list must not contain anypoint multiple times. Use set() function in python for thispurpose. See how the total fitness values of the populationdecreases with each generation. Note that in this case we don’tknow the minimum heuristic value of the ideal solution. Actually,we don’t have an ideal solution beforehand i.e., we don’t know howthe ideal sequence of cities looks like (unlike other problemswhere we already know the solution beforehand e.g., how 4 queensshould be placed in order to obtain the heuristic value of 0 or howall bits should be 1 to obtain the ideal heuristic value).
Expert Answer
Answer to Python Program – USE HILL CLIMBING ALGO The traveling salesman problem is an optimization problem where there is a finit… . . .
OR

