You are on page 1of 16

Derivative Free Optimization

Simulated Annealing

Presentation by:
C. Vinoth Kumar
SSN College of Engineering
Derivative Free Optimization
• Four of the most popular derivative-free optimization are:

– Genetic Algorithms (GA)


– Simulated Annealing (SA)
– Random search method
– Downhill simplex search
Simulated Annealing (SA)
• Introduced by Metropolis et al. in 1953 and adapted by
Kirkpatrick (1983) in order to find an optimum solution to
a large-scale combinatorial optimization problems
(traveling salesman problems).

• SA was derived from physical characteristics of spin


glasses.

• The principle behind SA is analogous to what happens


when metals are cooled at a controlled rate.
Simulated Annealing
• The slowly decrease of temperature allows the atoms in
the molten metal, to line themselves up and form a
regular crystalline structure that possesses a low density
& low energy.

• But if the temperature goes down too quickly, the atoms


do not have time to orient themselves into a regular
structure.

• The value of an objective function that we intend to


minimize corresponds to the energy in a thermodynamic
system.
Simulated Annealing
• High temperatures corresponds to the case where high-
mobility atoms can orient themselves with other non-local
atoms & the energy can increase: function evaluation
accepts new points with higher energy

• Low temperatures corresponds to the case where the


low-mobility atoms can only orient themselves with local
atoms & the energy state is not likely to increase:
Function evaluation is performed only locally and points
with higher energy are refused

• The most important element of SA is the so-called


annealing schedule (or cooling schedule), which express
how fast the temperature is being lowered from high to
low
Simulated Annealing - Terminlogy
Objective function - f(·) : It maps an input vector x into a
scalar E
E = f(x)
SA has to sample the input space effectively to find an x
that minimizes E.

Generating function – g(·,·) : It specifies the probability


density function of difference between the current point and
next point to be visited (specifically, g(∆x,T) where ∆x =
xnew–x).
Simulated Annealing - Terminlogy
Acceptance function h(∆E,T): To determine if the selected
point should be accepted or not. Usually,
h(∆E, T) = 1/(1+exp(∆E/(cT))
where ‘c’ is the system-dependent constant
‘T’ is the temperature
∆E = f(xnew) – f(x), is the energy difference

Annealing (cooling) schedule: schedule for reducing the


temperature T at each iteration
Simulated Annealing – Basic Steps
Step 1 [Initialization]: Choose an initial point x and a high
temperature T and set the iteration count k to 1

Step 2 [Evaluation]: Evaluate the objective function E = f(x)

Step 3 [Exploration]: Select ∆x with probability g(∆x, T), and


set xnew = x + ∆x

Step 4 [Re-evaluation]: Compute the new value of the


objective function Enew = f(xnew)
Simulated Annealing – Basic Steps
Step 5 [Acceptance]: Test if xnew is accepted or not by
computing h(∆E, T) where ∆E = Enew-E

Step 6: Lower the temperature according to the annealing


schedule (T = ηT; 0 < η < 1)

Step 7: k = k + 1, if k reaches the maximum iteration count,


then stop otherwise go to step 3
Simulated Annealing
Example – Traveling Salesman Problem (TSP)

How to transverse n cities once and only once with a


minimal total distance?

NP hard problem with [(n – 1)!] / 2 possible tours to explore


Traveling Salesman Problem – Move Sets

12 12
Remove 8-7 &
10 Remove 6-7 and 8-9 10
3 3 replace it in
1 and replace them 1
6 6 between two
with opposite order
randomly selected
7 2 7
2 cities 4 & 5
11 9 11 8 9
8 Inversion
4 5 Translation
4 5
1-2-3-4-5-9-8-7-6-10-11-12
1-2-3-4-5-6-7-8-9-10-11-12

12 12
10 10
3 3
1 Select 3 and 11 1 6
6
and switch them
7 2 7
2
11 9 Switching 11 9
8 8
4 5 4 5

1-2-11-4-8-7-5-9-6-10-3-12 1-2-3-4-8-7-5-9-6-10-11-12
100 City TSP using SA

The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart y our computer, and then open the file again. If the red x still appears, y ou may hav e to delete the image and then insert it again.

Initial random path During SA process Final path


Random Search
• This method explores the parameter space of an
objective function sequentially in a random fashion to find
the optimal point that maximizes the objective function.

• This method is simple and converges to the global


optimum surely on a compact set but takes long time.
Random Search - Steps
Step 1: Choose an initial point x as the current point

Step 2: Add a random vector dx to the current point x & evaluate


the objective function at x + dx

Step 3: if f(x + dx) < f(x) set x = x + dx

Step 4: Stop the process if maximum iteration is reached


otherwise go back to step 2 to find a new point
Random Search - Steps
• This method is blind since the search directions are
guided by a random number generator, therefore an
improved version is developed

• It is based on 2 observations:

– If a search in a direction results in a higher value of


the objective function the opposite direction should
provide a lower value of the objective function (leads
to reverse step)

– Successive successful (failure) searches in a certain


direction should bias subsequent searches toward (or
against) this direction (leads to addition bias term)
Random Search - Flowchart
Initialization stop

yes
no
Select a random dx Stop?

yes x = x + b + dx
f(x+b+dx)<f(x)?
b = 0.2 b + 0.4 dx
no

yes x = x + b - dx
f(x+b-dx)<f(x)?
b = b - 0.4 dx
no
b = 0.5 b

You might also like