The latter is true: only the probability of acceptance depends on the temperature. The higher the temperature, the more βbadβ movements are taken to escape from local optima. If you pre-select neighbors with low energy values, you basically contradict the idea of ββSimulated Annealing and turn it into a greedy search.
Pseudocode from Wikipedia :
s β s0; e β E(s) // Initial state, energy. sbest β s; ebest β e // Initial "best" solution k β 0 // Energy evaluation count. while k < kmax and e > emax // While time left & not good enough: T β temperature(k/kmax) // Temperature calculation. snew β neighbour(s) // Pick some neighbour. enew β E(snew) // Compute its energy. if P(e, enew, T) > random() then // Should we move to it? s β snew; e β enew // Yes, change state. if enew < ebest then // Is this a new best? sbest β snew; ebest β enew // Save 'new neighbour' to 'best found'. k β k + 1 // One more evaluation done return sbest // Return the best solution found.
source share