
4  SIMULATED ANNEALING 
ALGORITHM 
Simulated  annealing  algorithm  is  a  heuristic 
algorithm  designed  to  randomly  search  the  global 
optimal  solution  in  the  feasible  solution  space  by 
combining probabilistic jump characteristics. 
If  the  new  feasible  solution 
 is  found  to  be 
better than the current feasible solution 
, the new 
feasible  solution  is  accepted.  Otherwise,  the 
Metropolis  criterion  determines  whether  to  accept 
the  new  feasible  solution.  In  order  not  to  reject 
directly,  define  the  acceptance  probability 
. 
 
lies  between  [0,1],  and  measures  the  distance 
between 
 and 
.  The  closer  is  the 
distance,  the  larger  is 
.  Here  we  make 
assumptions. 
 
 
 
exp
ji
P f x f x  
                  (20) 
In  order  to  improve  the  efficiency  of  the 
algorithm, in the early stage of the algorithm search, 
it is necessary to improve the scope of the algorithm 
search to avoid falling into local optimal. In the later 
stage  of  the  search,  it  is  necessary  to  reduce  the 
search scope of the algorithm as much as possible. 
That is, it just searches locally, because at this time 
it  is  close  to  the  global  optimal.  We  make  a 
deformation of the above formula (20). 
 
 
 
exp
t j i
P C f x f x  
         (21) 
in the formula (21) can be regarded as a time-
dependent coefficient. Then the probability P of the 
algorithm  accepting  the  new  feasible  solution 
establishes a relationship with the time parameter. 
If t is small in the early stage of search, and the 
search scope is large enough, then the corresponding 
P needs to be larger. And 
 is set to be negatively 
correlated  with 
,  so  it  should  be  small.  If 
 is 
smaller  in  the  late  search  period, 
 should  be 
larger. Obviously, the longer time goes,  the bigger 
 gets. 
The flow of the search process is as follows. 
1) Generate an initial solution A randomly, and 
calculate  the  objective  function 
 
corresponding to the initial solution. 
2)  A  solution  B  is  generated  near  the  initial 
solution  according  to  the  probability  mechanism, 
and  the  objective  function 
 corresponding  to 
the new solution B is calculated. 
3) If 
, the new solution overwrites 
the original solution and repeat the above steps. 
If 
, it calculates the probability of 
accepting  the  newer  solution  B,  that  is 
   
 
exp .
tt
P f B f A C   
Then  it  randomly 
generates  number 
.  If 
,  the  initial 
solution A is overwritten by the new solution B. And 
the above steps are repeated. Otherwise, it returns to 
the second step. A newer solution 
 is re-generate 
near the initial solution, and it continues to iterate. 
However,  there  is  a  problem  in  the  above 
process, that is, the setting of key coefficient 
. So 
we  define  the  initial  temperature 
. 
According  to  thermodynamics,  the  formula  for 
temperature drop is 
                        (22) 
In the formula (22), 
 is usually 0.95, then the 
temperature at time t is 
                (23) 
To ensure that 
 increases about t, we have 
                  (24) 
Then 
       
exp exp
100 0.95
t
t
t
f B f A f B f A
P
T
   
   
   
   
      (25) 
 
Let 
, when the temperature 
is  constant,  the  smaller 
 is,  the  greater  the 
probability 
 is. That is, the smaller the difference 
from  the  existing  solution  is,  the  greater  the 
possibility of accepting the newer solution is. When 
 is  constant,  the  higher  the  temperature  is,  the 
greater the acceptance probability is. Therefore, it is 
easier  to  accept  the  newer  solution  when  the 
temperature is high in the early stage of search. 
5  SIMULATION CALCULATION 
The theoretical basis of Monte Carlo method is the 
law  of  large  numbers.  The  law  of  large  number 
describes  the  results  of  a  considerable  number  of 
repeated experiments, and according to this law, the 
larger the number of samples, the closer the average 
will be to the true value. 
ANIT 2023 - The International Seminar on Artificial Intelligence, Networking and Information Technology
554