在这个模拟退火算法中与 [0, 1] 中的随机值进行比较的目的是什么?

What is the purpose of comparing with a random value in [0, 1] in this simulated annealing algorithm?

第13行(IF random([0,1]) ≤ accept THEN)的模拟退火算法中,为什么要生成一个随机数来与下一个节点的进化值进行比较?每次都生成一个随机数,不用常量比较有什么用?

1: INITIALIZE startTemperature, endTemperature, maxNumberIterations
2: coolingRate = eˆ(log(endTemperature/startTemperature)/maxNumberIterations)
3: INITIALIZE dataStructures
4: COMPUTE initialSolution
5: INITIALIZE currentSolution, bestSolution, currentObjective, bestObjective
6: currentTemperature = startTemperature ∗ initialObjective
7: globalIteration = 0
8: WHILE currentTemperature > endTemperature ∗ initialObjective DO
9: currentTemperature = currentTemperature ∗ coolingRate
10:EXECUTE randomMove(movesWeight, currentSolution)
11:tentativeObjective = currentObjective + moveCost
12:accept = eˆ(currentObjective − tentativeObjective)/currentTemperature)
13:IF random([0,1]) ≤ accept THEN
14:currentSolution = tentativeSolution
15:IF tentativeObjective < bestObjective THEN
16:bestSolution = tentativeSolution
17:END IF
18:END IF
19:globalIteration = globalIteration +1
20: END WHILE
21: PRINT bestSolution, bestObjective

目的是仅以给定的概率accept执行下面的代码。

例如,如果 accept 为 0.3,则 0 和 1 之间的随机数将仅在所有可能情况下的 30% 小于或等于该值。

算法每次迭代都需要抽取一个新的随机数,否则下面的代码要么always要么never[=20=执行],对于给定的 运行 算法。