在模拟退火中找到更好的邻居

finding better neighbour in Simulated annealing

我正在使用模拟解决 TSP annealing.I 有一个问题:
https://en.wikipedia.org/wiki/Simulated_annealingEfficient candidate generation 块中它说:

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.

所以我随机生成第一个城市,然后连续生成第二个城市 first.but 解决方案变得更糟。
我做错了吗?

最初你需要探索所有的解决方案表面。你可以通过两种方式做到这一点,要么通过有效地随机生成候选人,要么通过高温。如果不使用方法一,则必须使用方法二。这意味着提高温度,直到基本上所有的动作都被接受。然后你尽可能慢地减少它。 "swap adjacent cities" 一步会产生一个合理的结果。