2

I want to use simulated annealing for different situations. Every simulated annealing algorithm in net provides the algorithm with the temperature example. Like in wiki

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.

Now what is this 'T' represent in general? Suppose I will use simulated annealing to chess.I will use this algorithm to find next move for computer. I've current state(S) and it's value(e). I've next states(snew) and their values(enew). Then what will be 'T' for chess? Do I need it! Is there any general form for this algorithm? I mean without this temperature example where I can get the basic idea! I can't find any. Please help. Thanks in advance......

AtanuCSE
  • 8,832
  • 14
  • 74
  • 112
  • 1
    Chess is requires a minimax algorithm. I have never seen a way to do that with SA yet (although I would be interested if someone found a way). – Geoffrey De Smet Jun 22 '13 at 13:41
  • @GeoffreyDeSmet Actually my problem is not about how chess will be perfect after applying this algorithm, rather how chess will act if I use this algorithm. Basically I need to implement this for comparison between different algorithms. Found some idea. I will randomly choose any move and then decide whether to accept it or not based on some probability function. You can check the idea from this link: http://nazmialtun.blogspot.com/2011/09/solving-n-queens-puzzle-with-simulated.html He applied SA for N-queen – AtanuCSE Jun 22 '13 at 14:32
  • @AtanuCSE N-queens is a NP-complete optimization problem somehow equivalent to a propositional formula with one existential quantifier. Chess is a two player game, which is equivalent to a formula with alternating existential and universal quantifiers. These are completely different problems. – ziggystar Jun 25 '13 at 07:56

1 Answers1

3

All examples on the net use the temperature example because that is the standard terminology for simulated annealing-- SA is a physics-inspired technique, modeled after a real-world phenomenon called annealing. It is much the same as how all examples for genetic algorithms talk about genes and chromosomes.

If you trace the mathematics back far enough, there are some fascinating connections between various optimization meta-heuristics and some physical processes, usually bridged by the notion of entropy.

But, in very rough terms, the temperature T in simulated annealing corresponds to the willingness or ability of the algorithm to "jump" out of a local minimum in the search for a global (or at least, better local) minimum. High temperatures correspond to higher randomness, jump around more, and may even end up in worse configurations; low temperatures correspond to lower randomness (and eventually purely greedy algorithms) and cannot escape any local minima no matter how shallow.

As to how to use that idea for your applications, well. It takes some insight and some creativity in order to get most metaheuristics to work right. ut you're never going to find a discussion of SA that doesn't talk about temperature.

Novak
  • 4,687
  • 2
  • 26
  • 64