TSP, algorithm gets stuck in local minimum
问题 I am struggling to implement a program based on simulated annealing to solve the traveling salesman problem. All solutions I got are not satisfying and i have no clue how to improve my implementation. Obviously I'm not focusing on benchmarks, but only on finding the visually acceptable shortest path. If anyone might enlighten me I would be thankful. # weight function, simple euclidean norm def road(X,Y): sum = 0 size = len(X) -1 for i in range(0,size): sum +=math.sqrt((X[i]-X[i+1])**2 + (Y[i]