In the simulated Annealing Algorithm at the line number 13 ( IF random([0,1]) ≤ accept THEN ) , why do we need to generate a random number to compare with the evolution value with next node? What is the purpose of generating a random number every time without using constant value to compare?
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```
Aucun commentaire:
Enregistrer un commentaire