Wikipedia和此site两者都描述了模拟退火算法中的类似步骤,我在此处选择了这一步:
百科:
if P(e, enew, temp(k/kmax)) > random() then // Should we move to it?
s ← snew; e ← enew // Yes, change state.
Yuval Baror,关于Eight Queens puzzle:
If moving the queen to the new column will reduce the number of attacked
queens on the board, the move is taken. Otherwise, the move is taken only
with a certain probability, which decreases over time.
Hence early on the algorithm will tend to take moves even if they
don't improve the situation. Later on, the algorithm will only make moves
which improve the situation on the board.
我的问题是:这种随机动作实现了什么?
答案 0 :(得分:2)
目的是避免解决本地化的最佳解决方案,而是尝试找到全局最佳解决方案。请参阅此处:http://en.wikipedia.org/wiki/Local_minimum
您允许随机移动量最初可能会使您的位置变得更糟,以期找到一个更好的整体解决方案,而不是仅采取的步骤可以改善您的位置。
名称的“退火”部分是允许更糟糕的位置的移动量随着时间的推移而减少。
答案 1 :(得分:0)
只采取改善情况的解决方案被称为“贪婪”,意味着你找到了当地的最佳状态。