ak0692
ak0692

Reputation: 233

finding better neighbour in Simulated annealing

I am solving TSP using simulated annealing.I have a question that :
In https://en.wikipedia.org/wiki/Simulated_annealing in Efficient candidate generation block it said:

the travelling salesman problem above, for example, swapping two consecutive cities in a low-energy tour is expected to have a modest effect on its energy (length); whereas swapping two arbitrary cities is far more likely to increase its length than to decrease it. Thus, the consecutive-swap neighbour generator is expected to perform better than the arbitrary-swap one.

So I generated first city randomly and second consecutive to the first.but solution got worsen .
am i doing wrong?

Upvotes: 1

Views: 573

Answers (1)

Malcolm McLean
Malcolm McLean

Reputation: 6404

Initially you need to explore all the solution surface. Which you can do in two ways, either by generating effectively random candidates, or by having a high temperature. If you don't use method one, you must use method two. Which means ramping up temperature until essentially all moves are accepted. Then you reduce it as slowly as you are able. A "swap adjacent cities" move will then produce a reasonable result.

Upvotes: 3

Related Questions