Msdo 2015 Lecture 9 Sa
description
Transcript of Msdo 2015 Lecture 9 Sa
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 1/193
IN THE NAME OF A
THE MOST BENEFTHE MOST MER
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 2/193
[email protected] ; 0321-9
_________________PhD, FLIGHT VEHICLE DESIGNBEIJING UNIVERSITY OF AERONAUTICS AND ASTRONAUTICS, BUAA, P.R.CHINA, 2009
MS, FLIGHT VEHICLE DESIGNBEIJING UNIVERSITY OF AERONAUTICS AND ASTRONAUTICS, BUAA, P.R.CHINA, 2006
BE, MECHANICAL ENGINEERINGNATIONAL UNIVERSITY OF SCIENCE AND TECHNOLOGY, NUST, PAKISTAN, 2000
EMAIL: [email protected]
TEL: +92-320-9595510
WEB:
www.ist.edu.pk/qasim-zeeshan LINKEDIN: pk.linkedin.com/pub/qasim-zeeshan/67/554/ba7
Dr Qasim Zeeshan
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 3/193
MULTIDISCIPLI
SY
DOPTIMIZA
LECTURE # 9
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 4/193
STATUS
PHASE-I
Introduction to Multidisciplinary System Design Optimizatio
Terminology and Problem Statement
Introduction to Optimization
Classification of Optimization Problems
Numerical/ Classical Optimization
MSDO Architectures
Practical Applications: Structure, Aero etc
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 5/193
STATUS
PHASE-II WEEK 8: Genetic Algorithm
WEEK 9: Particle Swarm Optimization
WEEK 10: Simulated Annealing
WEEK 11: MID TERM
WEEK 12:
Ant Colony Optimization, Tabu Search, Pattern Search
WEEK 13:
LAB, Practical Applications
00
20
40
60
-0.5
0
0.5
1
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 6/193
STATUS
PHASE-III WEEK 14: Design of Experiments, Meta-modeling, and Ro
WEEK 15: Multi-objective Optimization
Hybrid Optimization & Hyper Heuristic Optimiz
WEEK 16: Post Optimality Analysis/ Revision & Discussion
WEEK 17: END TERM/ Paper Presentations ?
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 7/193
Previous Lecture : GA
HAVE U TRIED GA at home?
SOME QUESTIONS ?
Is GA a LOCAL SEARCH or a GLOBAL SEARCH algorithm? Or BOTH
What will happen if you change different parameters of GA?
POPULATION SIZE/ TYPE
SELECTION CROSSOVER
MUTATION
What will you do if you have a very short time and you want a reaso
Will GA give the same result if RUN on different Machines with same
Will GA give the same result every time you Run the algorithm with sa
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 8/193
M
________________SIMULATED ANNE
Dr. Qasim ZeeshanLECTURE # 9
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 9/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 10/193
SIMULATED ANNEA
_______________________GLOBAL OPT
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 11/193
Difficulty in Searching Global Op
Local search techniques, such as steepest
descend method, are very good infinding local optima.
However, difficulties arise when theglobal optima is different from the localoptima.
Since all the immediate neighboringpoints around a local optima is worse
than it in the performance value, localsearch can not proceed once trapped ina local optima point.
We need some mechanism that can helpus escape the trap of local optima.
And the simulated annealing is one ofsuch methods.
startingpoint
descenddirection
local minima
gl
ba
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 12/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 13/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 14/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 15/193
ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 16/193
What is Annealing?
The name and inspiration come from annealing inmetallurgy, a technique involving heating andcontrolled cooling of a material to increase thesize of its crystals and reduce their defects.
The heat causes the atoms to become unstuck from
their initial positions (a local minimum of theinternal energy) and wander randomly throughstates of higher energy
The slow cooling gives them more chances offinding configurations with lower internal energy
than the initial one.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 17/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 18/193
What is Annealing?
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 19/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 20/193
What is Annealing?
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 21/193
What is Annealing?
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 22/193
What is Annealing?
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 23/193
What is Annealing?
Annealing, in metallurgy and materials science, is a heat treatment wherein a mater
altered, causing changes in its properties such as strength and hardness. It is a procthat produces conditions by heating to above the recrystallization temperature,maintaining a suitable temperature, and then cooling.
Annealing is used to induce ductility, soften material, relieve internal stresses, refinestructure by making it homogeneous, and improve cold working properties.
In the cases of copper, steel, silver, and brass, this process is performed by substantheating the material (generally until glowing) for a while and allowing it to cool.
Unlike ferrous metals — which must be cooled slowly to anneal — copper, silver and bcan be cooled slowly in air or quickly by quenching in water. In this fashion the metasoftened and prepared for further work such as shaping, stamping, or forming
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 24/193
What is Annealing?
Full annealing is the process of slowly raising thetemperature about 50 ºC (90 ºF) above the Austenitictemperature line A3 or line ACM in the case ofHypoeutectoid steels (steels with < 0.77% Carbon)and 50 ºC (90 ºF) into the Austenite-Cementite regionin the case of Hypereutectoid steels (steels with >0.77% Carbon).
It is held at this temperature for sufficient time for all
the material to transform into Austenite or Austenite-Cementite as the case may be. It is then slowly cooledat the rate of about 20 ºC/hr (36 ºF/hr) in a furnaceto about 50 ºC (90 ºF) into the Ferrite-Cementiterange. At this point, it can be cooled in roomtemperature air with natural convection.
The grain structure has coarse Pearlite with ferrite orCementite (depending on whether hypo or hyper
eutectoid). The steel becomes soft and ductile.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 25/193
What is Annealing?
The benefits of annealing are: Improved ductility
Removal of residual stresses that result from cold-workingor machining
Improved machinability
Grain refinement
Full annealing consists of
(1) recovery (stress-relief )
(2) recrystallization
(3) grain growth stages.
Annealing reduces the hardness, yield strength and
tensile strength of the steel.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 26/193
Annealing of solids
Annealing: the physical process of heating up a solid and then cdown slowly until it crystallizes.
The atoms in the material have high energies at high temperatures and havfreedom to arrange themselves. As the temperature is reduced, the atomic decrease.
A crystal with regular structure is obtained at the state where the system haenergy.
If the cooling is carried out very quickly, which is known as rapid quenchingirregularities and defects are seen in the crystal structure.
The system does not reach the minimum energy state and ends in a polycrywhich has a higher energy.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 27/193
The study of statistical mechanics shows that, at a given atom remaining at the state of r satisfies Boltzmann’s pr
distribution (Boltzmann’s law)
E (r) denotes the energy at state r,k>0 is the Boltzmann’s cons
random variable representing energy, Z(T ) is the standardizatio
probability distribution
1 ( )( ( )) exp( )
( )
E r P E E r
Z T kT
( )( ) exp( )
s D
E s Z T
kT
Annealing of Solids
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 28/193
Given two energies E1 < E2 ,at the same temperature T :
The probability of atom remaining at low energy state is gprobability remaining at high energy state.
When temperature is very high, the probabilities of each sbasically the same, close to the average value of 1 / |D|number of state in the state space D).
The lower the temperature (T 0), the higher the probabilit
lower energy state.
0)()( 21 E E P E E P
Annealing of Solids
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 29/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 30/193
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 5
P r o b a b i l i t y
When temperature is higher (T = 20), the
difference between the probabilities remaining at
four energies is relatively small. However the
probability at the lowest energy state, x =1, is
0.269, which exceeds the average of 0.25. This
can be seen as the random move of atoms.
With temperature drops (T = 5), the probabilityat state x = 4 becomes relatively small.
At T = 0.5, the probability at state x = 1 is
0.865, while the probabilities at other three
states are very small.
Annealing of Solids
x=1
x=4
x=3
x=2
Analogy between
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 31/193
Analogy betweenOptimization and Annealing
Analogy the states of the solid represent feasible solutions of the optimization pro
the energies of the states correspond to the values of the objective funct
the minimum energy state corresponds to the optimal solution to the prob
rapid quenching can be viewed as local optimization
The optimal solution of an optimization problem can be
to the minimum energy state in an annealing process, i.e
with the greatest probability at the lowest temperature.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 32/193
SIMULA
ANNEAL
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 33/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 34/193
What is Simulated Annealing?
Simulated annealing (SA) is a generic probabilistic metaheuristic fooptimization problem of locating a good approximation to the glogiven function in a large search space.
It is often used when the search space is discrete (e.g., all tours thaof cities).
For certain problems, simulated annealing may be more effective tenumeration — provided that the goal is merely to find an acceptasolution in a fixed amount of time, rather than the best possible solu
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 35/193
What is Simulated Annealing?
The name and inspiration come from annealing
in metallurgy, a technique involving heatingand controlled cooling of a material toincrease the size of its crystals and reduce theirdefects.
The heat causes the atoms to become unstuck
from their initial positions (a local minimum ofthe internal energy) and wander randomlythrough states of higher energy; the slowcooling gives them more chances of findingconfigurations with lower internal energy thanthe initial one.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 36/193
What is Simulated Annealing?36
In annealing, a material is heated to high energy where there are frchanges (disordered). It is then gradually (slowly) cooled to a low ewhere state changes are rare (approximately thermodynamic equili
“frozen state”).
For example, large crystals can be grown by very slow cooling, butcooling or quenching is employed the crystal will contain a number imperfections (glass).
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 37/193
MINIMUM ENERGY CONFIGURATIO37
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 38/193
Simulated Annealing
Simulated Annealing (SA) is a generalization of a Monte Carlo methodthe equations of state and frozen states of n-body systems Metropolis
The concept is based on the manner in which liquids freeze or metals rthe process of annealing. In an annealing process a melt, initially at higand disordered, is slowly cooled so that the system at any time is apprthermodynamic equilibrium.
As cooling proceeds, the system becomes more ordered and approachground state at T=0. Hence the process can be thought of as an adiabto the lowest energy state.
If the initial temperature of the system is too low or cooling is done insslowly the system may become quenched forming defects or freezing ometastable states (ie. trapped in a local minimum energy state).
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 39/193
Simulated Annealing
The original Metropolis scheme was that an initial state of a thermosystem was chosen at energy E and temperature T, holding T constaconfiguration is perturbed and the change in energy dE is compute
If the change in energy is negative the new configuration is accepte
If the change in energy is positive it is accepted with a probability
Boltzmann factor exp -(dE/T).
This processes is then repeated sufficient times to give good samplithe current temperature, and then the temperature is decremented process repeated until a frozen state is achieved at T=0.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 40/193
Simulated Annealing
The current state of the thermodynamic system is analogous to the current scombinatorial problem, the energy equation for the thermodynamic systemat the objective function, and ground state is analogous to the global minim
The major difficulty (art) in implementation of the algorithm is that there isanalogy for the temperature T with respect to a free parameter in the comproblem.
Furthermore, avoidance of entrainment in local minima (quenching) is depe
annealing schedule
choice of initial temperature
how many iterations are performed at each temperature
and how much the temperature is decremented at each step as cooling proceed
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 41/193
Simulated Annealing
SA is one of the most flexible techniques available for solving hard coproblems.
The main advantage of SA is that it can be applied to large problemsthe conditions of differentiability, continuity, and convexity that are noin conventional optimization methods.
The algorithm starts with an initial design. New designs are then rando
in the neighborhood of the current design.
The change of objective function value, ( ΔE), between the new and theis calculated as a measure of the energy change of the system.
At the end of the search, when the temperature is low the probability worse designs is very low. Thus, the search converges to an optimal sol
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 42/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 43/193
Simulated Annealing
The Metropolis algorithm generates a sequence of states of a solid as follows: givin
with energy Ei, the next state Sj is generated by a transition mechanism that consists perturbation with respect to the original state, obtained by moving one of the partiby the Monte Carlo method.
Let the energy of the resulting state, which also is found probabilistically, be Ej; if thless than or equal to zero, the new state Sj is accepted. Otherwise, in case the diffezero, the new state is accepted with probability
Where T is the temperature of the solid and kB is the Boltzmann constant. This accepknown as Metropolis criterion and the algorithm summarized above is the Metropolitemperature is assumed to have a rate of variation such that thermodynamic equilibthe current temperature level, before moving to the next level. This normally requirestate transitions of the Metropolis algorithm.
T k
E E
P B
ji
exp
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 44/193
Adaptive Simulated Annealing
Adaptive simulated annealing (ASA) is a variant of simulated annealing (SA) algo
algorithm parameters that control temperature schedule and random step selection adjusted according to algorithm progress.
This makes the algorithm more efficient and less sensitive to user defined parameter
These are in the standard variant often selected on the basis of experience and expoptimal values are problem dependent), which represents a significant deficiency in
The algorithm works by representing the parameters of the function to be optimized
numbers, and as dimensions of a hypercube (N dimensional space). Some SA algorithms apply Gaussian moves to the state, while others have distributio
temperature schedules.
Imagine the state as a point in a box and the moves as a rugby-ball shaped cloud a
The temperature and the step size are adjusted so that all of the search space is saresolution in the early stages, whilst the state is directed to favorable areas in the la
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 45/193
SIMULATED ANNEA
_______________________VOCABU
TERMINO
Analogy between combinatorial
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 46/193
gyoptimization and annealing
Analogy the states of the solid represent feasible solutions of the optimizat
the energies of the states correspond to the values of the objectiv
the minimum energy state (Frozen State) corresponds to the optim
the problem
rapid quenching can be viewed as local optimization
The optimal solution of a combinatorial optimization problemanalogous to the minimum energy state in an annealing procestate with the greatest probability at the lowest temperature
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 47/193
TERMINOLOGY47
Simulated AnAnnealing Feasible solutionsSystem states
Cost (Objective)Energy
Neighboring solution (Change of state
Control parameterTemperature
Final solutionFrozen state
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 48/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 49/193
TERMINOLOGY
Annealing Schedule
The annealing schedule is the rate by which the tempera
decreased as the algorithm proceeds.
The slower the rate of decrease, the better the chances
finding an optimal solution, but the longer the run time.
TERMINOLOGY
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 50/193
TERMINOLOGY
Reannealing
Annealing is the technique of closely controlling the temp
cooling a material to ensure that it is brought to an optim
Reannealing raises the temperature after a certain num
points have been accepted, and starts the search againtemperature.
Reannealing avoids getting caught at local minima.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 51/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 52/193
Basic principle of SA
According to the analogy between the annealing of solids andof solving combinatorial optimization problems, in 1983, Kirkp
al.proposed the SA algorithm based on Metropolis’s criterion
In 1953, Metropolis et al. presented the so-called Metropolis’s
their study of how to simulate the annealing process of solids. They produced an algorithm to provide efficient simulation of a collec
equilibrium at a given temperature.
This algorithm is also called Metropolis’s algorithm, which follows Boltz
B i i i l f SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 53/193
A solution and its objective function of a combinatorial optimizaproblem are equivalent to a state and its energy of a solid res
Set a control parameter t , whose value decreases in the coursealgorithm. Let t play the role of temperature T in a solid annea
For each value taken by t , the algorithm repeats an iterative p
“produce a new solution - judge - accept /reject”. This correspprocess tending to a thermal equilibrium of solids.
The action course of “produce a new solution - judge - accept /rejecttime of implementing Metropolis’s algorithm.
Basic principle of SA
B i i i l f SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 54/193
At a given temperature, the iteration number of impMetropolis’s algorithm is called the length of Markov
SA starts from an initial solution and an initial tempe
Reduce the value of control parameter T gradually,
implementing Metropolis’s algorithm.
Finally when T tends to 0, the optimal solution of anoptimization problem can be obtained.
Basic principle of SA
B i i i l f SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 55/193
Solid annealing must be "slowly" cooled down, so as
a thermal equilibriums at every temperature, and ult
tends to the minimum energy state.
Similarly, the control parameter t must also decreaseensure that SA eventually converge to the global op
solution of an optimization problem.
Basic principle of SA
Basic principle of SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 56/193
SA produces a sequence of solutions by using Metropolis’s algorithmcorresponding transfer probability Pt based on Metropolis’s criterio
Pt determines whether or not to transfer from the current solution i tsolution j.
At the beginning, t takes a greater value, after enough transfers, slowly redof t .
Repeat the process, until some stopping criterion is met.
1, ( ) ( )
( ) ( ) ( )exp( ) ( ) ( )
t
f j f i
P i j f i f j f j f i
t
i f
i f
Basic principle of SA
Basic principle of SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 57/193
The SA algorithm consists of a sequence of iterations
Each iteration consists of randomly changing the current solution to
solution in the neighborhood of the current solution.
Once a new solution is created, the corresponding change in the c
computed to decide whether the newly produced solution can be a
the current solution.
If the change in the cost function is negative, the newly produced s
directly taken as the current solution.
Otherwise, it is accepted according to Metropolis’s criterion based
probability.
Basic principle of SA
METROPOLIS CRITERION
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 58/193
If the difference f ji=f (j)-f (i) between the cost function vacurrent and the newly produced solution is equal to or la
zero, a random number in [0, l] is generated from a un
distribution and if
then the newly produced solution j is accepted as the curr
If not, the current solution i keeps unchanged.
[ / ] ji k f t
e
METROPOLIS CRITERION
Metropolis’s criterion
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 59/193
- f ji
exp(- f ji /t k )
0
1
Low t k High t k
Metropolis’s criterion
FLOWCHART
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 60/193
Initial solution
Final solution
Evaluate solution
Update the current solution
Decrease temperature
Generate a
new solution
Accepted ?
Change
temperature ?
Terminate
the search ?
No
Yes
Yes
No
No
Yes
FLOWCHART
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 61/193
SIMULATED ANNEA
_______________________
PROCED
Procedure of a basic SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 62/193
Begin
Initialize (i 0, t0, L0);k: =0; i : =i 0;
Repeat
For l : =1 to Lk do
Begin
Generate ( j from N(i ));
If f ( j ) < f (i ) then i := j ;
ElseIf exp (-(f ( j )-f (i )/tk)>random [0,1] then i : = j ;
End;
k: =k+1;Calculate Length (Lk);
Calculate Control (tk);
Until stop criterion
End;
Procedure of a basic SAI
Fin
Evalu
Update
Decre
Generate a
new solution
A
tem
t
No
No
Procedure of a basic SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 63/193
STEP 1
Generate an initial solution i 0; Set i :=i 0; k:=0; t0:=tmax (initial temperature).
STEP 2 If the stopping condition for internal iteration is met, then go to
STEP 3; Otherwise select a solution j from neighborhood N(i ) randomly,
compute f ji =f ( j )-f (i ); if f ji <0 set i := j ;
else if exp(- f ji /tk)> random(0, 1) set i := j repeat STEP 2.
STEP 3 Set tk+1:=g(tk); k:=k+1; If the stopping condition for external iteration is met, then
terminate the algorithm; otherwise return to STEP 2.
Procedure of a basic SA
Initial s
Final solu
Evaluate so
Update the cur
Decrease te
Generate a
new solution
Accepted
Chang
temperatu
Termin
the sear
No
No
Procedure of a basic SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 64/193
SA includes an internal cycle and an
external cycle The internal cycle is STEP 2. It indicates that, at
the same temperature t k, some solutions are
explored randomly.
The external cycle is STEP 3, including drops in
the temperature t k+1
: = g (t k), increasing in the
number of iterative steps k: = k +1, and
stopping conditions.
Procedure of a basic SA
Initial s
Final solu
Evaluate so
Update the cur
Decrease te
Generate a
new solution
Accepted
Chang
temperatu
Termin
the sear
No
No
Procedure of a basic SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 65/193
The internal cycle simulates the process of the
thermal equilibrium at a constant temperature. It is an important component that ensuring SA
can converge to the global optimal solution.
In each iteration of the internal cycle,
Metropolis’s algorithm is implemented once.
The iteration number in internal cycle is calledthe length of Markov chain, or the length of
time.
Procedure of a basic SA
Initial s
Final solu
Evaluate so
Update the cur
Decrease te
Generate anew solution
Accepted
Changtemperatu
Termin
the sear
No
No
Procedure of a basic SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 66/193
SA makes a tradeoff between
concentralization and diversification
strategies
For the next solution, if it is better than the
current solution, then select it as new current
solution. (concentralization strategy)
Otherwise, select it as new current solution with
a probability. (diversification strategy)
Procedure of a basic SA
Initial s
Final solu
Evaluate so
Update the cur
Decrease te
Generate a
new solution
Accepted
Chang
temperatu
Termin
the sear
No
No
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 67/193
SIMULATED ANNEA
_______________________
BASIC ELEM
Basic elements of SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 68/193
In order to implement the SA algorithm for a problem, fichoices must be made:
Representation of solutions
Definition of the cost function
Definition of the generation mechanism for the neighbors
Setting stopping criteria
Designing a cooling schedule
Basic elements of SA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 69/193
SIMULATED ANNEA _______________________
BASIC ELEMREPRESENTATION OF SOLU
Representation of solutions
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 70/193
The representation of solutions for SA is similar to
including binary coding, real number coding, and
others.
For complex optimization problems, the real numbis usually used.
Representation of solutions
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 71/193
SIMULATED ANNEA _______________________
BASIC ELEMDEFINITION OF COST FUN
Definition of the cost function
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 72/193
The cost function can be defined like the fitness definGAs.
Or just take the objective function f ( x) (or – f ( x) ) as t
function SAs do not require the cost function must be non-neg
Definition of the cost function
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 73/193
SIMULATED ANNEA
_______________________BASIC ELEM
GENERATION MECHANISNEIGH
Generation mechanism for neigh
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 74/193
Generation mechanism for neigh
Various generation mechanisms could be developedcould be borrowed from GAs, for example, mu
inversion.
A neighbor can be generated by changing the value of
variable or several decision variables with a small magnitu
For instance, X =(2.17,3.45, 6.32, 9.88)
Neighbors X' =(2.17, 3.35, 6.32,9.88)
X' =(2.17, 3.35, 6.42,9.88)
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 75/193
SIMULATED ANNEA _______________________
BASIC ELEMCOOLING SCH
Cooling schedule
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 76/193
g
In designing the cooling schedule for a SA algorithmparameters must be specified:
an initial temperature, t 0
a temperature update rule, g(t k)
a final temperature, t f
the number of iterations to be performed at each temperat
the length of Markov chain, Lk
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 77/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 78/193
HISTORICAL PERSPECTIVE
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 79/193
79
After the World War II he returned to the faculty of the Universityof Chicago as an Assistant Professor. He came back to Los Alamos in
1948 to lead the group in the Theoretical (T) Division that designedand built the MANIAC Icomputer in 1952 and MANIAC II in 1957.
He chose the name MANIAC in the hope of stopping the rash ofsuch acronyms for machine names, but may have, instead, onlyfurther stimulated such use)
The MANIAC ( Mathematical Analyzer, Numerical I ntegrator, and Computer or Mathematical Analyzer, Numerator, I ntegrator, and Computer)was an early computer built under the direction of Nicholas
Metropolis at the Los Alamos Scientific Laboratory. It was based onthe von Neumann architecture of the IAS, developed by John vonNeumann. As with all computers of its era, it was a one of a kindmachine that could not exchange programs with other computers(even other IAS machines)
From 1957 to 1965 he was Professor of Physics at the University ofChicago and was the founding Director of its Institute for ComputerResearch. In 1965 he returned to Los Alamos where he was made aLaboratory Senior Fellow in 1980
HISTORICAL PERSPECTIVE
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 80/193
METROPOLIS (1915-1999)
In the 1950s, a group of researchers led by Metropolis developedthe Monte Carlo method. Generally speaking, the Monte Carlomethod is a statistical approach to solve deterministic many-bodyproblems. In 1953 Metropolis co-authored the first paper on atechnique that was central to the method now known as simulatedannealing.
This landmark paper showed the first numerical simulations ofa liquid . Although credit for this innovation has historically beengiven to Metropolis, the entire theoretical development in factcame from Marshall Rosenbluth, who later went on to distinguishhimself as the most dominant figure in plasma physics during thelatter half of the 20th century.
HISTORICAL PERSPECTIVE
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 81/193
METROPOLIS (1915-1999)
The algorithm — the Metropolis algorithm or Metropolis-Hastingsalgorithm -- for generating samples from the Boltzmanndistribution was later generalized by W.K. Hastings.
He is credited as part of the team that came up with the nameMonte Carlo method in reference to a colleague's relative's lovefor the Casinos of Monte Carlo.
Monte Carlo methods are a class of computational algorithms thatrely on repeated random sampling to compute their results.
HISTORICAL PERSPECTIVE
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 82/193
METROPOLIS (1915-1999)
In statistical mechanics applications prior to the introduction of theMetropolis algorithm, the method consisted of generating a largenumber of random configurations of the system, computing theproperties of interest (such as energy or density) for each configuration,and then producing a weighted average where the weight of eachconfiguration is its Boltzmann factor, e − E / kT , where E is the energy, T isthe temperature, and k is the Boltzmann constant
The key contribution of the Metropolis paper was the idea that
Instead of choosing configurations randomly, then weighting them with
exp( −E/kT), we choose configurations with a probability exp( −E/kT) and
weight them evenly.
– Metropolis et al .
Historical Perspective
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 83/193
The Boltzmann constant (k or kB) is the physicalconstant relating energy at the individual particle level
with temperature observed at the collective or bulk level.It is the gas constant R divided by the Avogadroconstant NA:
It has the same units as entropy. It is named afterthe Austrian physicist Ludwig Boltzmann.
Ludwig Eduard Boltzmann (February 20, 1844 – September 5, 1906) was an Austrian physicist famous forhis founding contributions in the fields of statisticalmechanics and statistical thermodynamics. He was one ofthe most important advocates for atomic theory at a timewhen that scientific model was still highly controversial.
BOLTZMAN CONSTANT
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 84/193
The logarithmic connection between entropy and probability was firststated by L. Boltzmann in his kinetic theory of gases. This famousformula for entropy S
where k = 1.3806505(24) × 10−23 J K−1 is Boltzmann's constant,and the logarithm is taken to the natural base e. W is theWahrscheinlichkeit, the frequency of occurrence of a macrostate
On September 5, 1906, while on a summer vacation in Duino, nearTrieste, Boltzmann hanged himself during an attack of depression. Heis buried in the Viennese Zentralfriedhof; his tombstone bears theinscription
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 85/193
Simulated Annealing in Practi
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 86/193
method proposed in 1983 by IBM researchers for solving VLSI layout prob(Kirkpatrick et al, Science, 220:671-680, 1983).
Very-large-scale integration (VLSI) is the process of creating integrated circuits bythousands of transistors into a single chip. VLSI began in the 1970s when complexand communication technologies were being developed. The microprocessor is a V
theoretically will always find the global optimum (the best solution)
useful for some problems, but can be very slow slowness comes about because T must be decreased very gradually to retain optimality
In practice how do we decide the rate at which to decrease T? (this is a practical method)
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 87/193
SIMULATED ANNEA
_______________________
MONTE CA
MONTE CARLO
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 88/193
Monte Carlo methods (or Monte Carlo experiments) are a classof computational algorithms that rely on repeated random sampling to
compute their results. Monte Carlo methods are often usedin simulating physical and mathematical systems. These methods are mostsuited to calculation by a computer and tend to be used when it isinfeasible to compute an exact result with a deterministic algorithm.Thismethod is also used to complement the theoretical derivations.
Monte Carlo methods are especially useful for simulating systems withmany coupled degrees of freedom, such as fluids, disordered materials,strongly coupled solids, and cellular structures (see cellular Potts model).
They are used to model phenomena with significant uncertainty in inputs,such as the calculation of risk in business.
They are widely used in mathematics, for example to evaluatemultidimensional definite integrals with complicated boundary conditions.When Monte Carlo simulations have been applied in space explorationand oil exploration, their predictions of failures, cost overruns and scheduleoverruns are routinely better than human intuition or alternative "soft"methods.
MONTE CARLO
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 89/193
The Monte Carlo method was coined in the 1940s by John vonNeumann and Stanislaw Ulam, while they were working on nuclear weapon
projects in the Los Alamos National Laboratory. It was named in homageto Monte Carlo casino, a famous casino, where Ulam's uncle would oftengamble away his money
John von Neumann (December 28, 1903 – February 8, 1957) as aHungarian-American mathematician who made major contributions to a vastrange of fields, including set theory, functional analysis, quantum mechanics,ergodic theory, continuous geometry, economics and game theory, computerscience, numerical analysis, hydrodynamics, and statistics, as well as many
other mathematical fields. He is generally regarded as one of the greatestmathematicians in modern history
Stanisław Marcin Ulam (April 13, 1909 – May 13, 1984) was arenowned American mathematician of Polish-Jewish origin, whoparticipated in the Manhattan Project and originated the Teller – Ulamdesign of thermonuclear weapons. He also proposed the idea of nuclearpulse propulsion and developed a number of mathematical methods innumber theory, set theory, ergodic theory and algebraic topology
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 90/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 91/193
SIMULATED ANNEA
_______________________METROPOLIS –HASTINGS ALGO
Metropolis –Hastings algorithm
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 92/193
Marshall Nicholas Rosenbluth (5 February, 1927 – 28 September,2003) was an American plasma physicist and member of the
National Academy of Sciences. In 1997 he was awarded the National Medal of Science for
discoveries in controlled thermonuclear fusion, contributions toplasma physics and work in computational statistical mechanics. Hewas also a recipient of the E.O. Lawrence Prize (1964), the AlbertEinstein Award (1967), the James Clerk Maxwell Prize in Plasma
Physics (1976), and the Enrico Fermi Award (1985). In 1953, Rosenbluth derived the Metropolis algorithm; cited in
Computing in Science and Engineering (Jan. 2000) as being amongthe top 10 algorithms having the "greatest influence on thedevelopment and practice of science and engineering in the 20thcentury."
Metropolis –Hastings algorithm
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 93/193
In mathematics and physics, the Metropolis –
Hastings algorithm is a Markov chain MonteCarlo method for obtaining a sequence
of random samples from a probability
distribution for which direct sampling is
difficult.
This sequence can be used to approximate the
distribution (i.e., to generate a histogram), or
to compute an integral (such as an expected
value).
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 94/193
SIMULATED ANNEA
______________________MARKOV CHAIN MONTE C
Markov Chain Monte Carlo
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 95/193
Markov chain Monte Carlo (MCMC) methods (which include random walmethods) are a class of algorithms for sampling from probability distribuon constructing a Markov chain that has the desired distribution as its eqdistribution.
The state of the chain after a large number of steps is then used as a sadesired distribution. The quality of the sample improves as a function of of steps.
Usually it is not hard to construct a Markov chain with the desired propemore difficult problem is to determine how many steps are needed to costationary distribution within an acceptable error.
A good chain will have rapid mixing — the stationary distribution is reachstarting from an arbitrary positio
Markov Chain Monte Carlo
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 96/193
Many Markov Chain Monte Carlo methods move around the equilibrium distributsmall steps, with no tendency for the steps to proceed in the same direction. Thes
easy to implement and analyse, but unfortunately it can take a long time for the explore all of the space. The walker will often double back and cover ground alHere are some random walk MCMC methods: Metropolis –Hastings algorithm: Generates a random walk using a proposal density a
rejecting proposed moves. Gibbs sampling: Requires that all the conditional distributions of the target distribution
exactly. Popular partly because when this is so, the method does not require any 'tuning Slice sampling: Depends on the principle that one can sample from a distribution by sa
from the region under the plot of its density function. This method alternates uniform samvertical direction with uniform sampling from the horizontal 'slice' defined by the curren
Multiple-try Metropolis: A variation of the Metropolis – Hastings algorithm that allows meach point. This allows the algorithm to generally take larger steps at each iteration, wproblems intrinsic to large dimensional problems.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 97/193
SIMULATED ANNEA _______________________
METROPOLIS CRITER
METROPOLIS CRITERION98
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 98/193
new c
b
E E
c T P e
If a system is in some current energy state Ecurr and some aspects changed to makepotentially achive a new energy state Enew , than the :
system goes to
if Ecurr < Enew New state with pr
else New state with probability
State Space : Ecurr and Enew can each take one of N values x1 , x2 ,...,, xN and trfrom one state to any others is possible
Spall, Introduction to Stochastic Search and Optimization: Estimation, Simulation a
Wiley & Sons, 2003
cb : Boltzman Constant (k)
T : Temparature
METROPOLIS CRITERION99
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 99/193
Metropolis’s paper describes a Monte Carlo simulation of interacting
Each state change is described by: If E decreases, P = 1, where E is energy
If E increases,
where T = temperature (Kelvin), k = Boltzmann constant, k > 0, energy ch
To summarize behavior:
For large T, P
For small T, P
)(kT
E
e P
01
e
11
0
e
E
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 100/193
SIMULATED ANNEA
_______________________
MARKOV CH
MARKOV CHAINS
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 101/193
Markov Chain:
Sequence of trials where the outcome of each trial depends onoutcome of the previous one
Markov Chain is a set of conditional probabilities:
Pij (k-1,k)
Probability that the outcome of the k-th trial is j, when trial k-1
Markov Chain is homogeneous when the probabilities do not d
MARKOV CHAINS
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 102/193
The result of three Markov chains running on
the 3D Rosenbrock function using theMetropolis-Hastings algorithm.
The algorithm samples from regions where
the posterior probability is high and the
chains begin to mix in these regions.
The approximate position of the maximum hasbeen illuminated.
Note that the red points are the ones that
remain after the burn-in process. The earlier
ones have been discarded.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 103/193
SIMULATED ANNEA
_______________________
ALGOR
SA: ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 104/193
The inspiration for simulated annealing is the ancient
process of forging iron. Instead of optimizing profits, itoptimized the metal’s hardness.
The blacksmith’s hammer guided the iron into thedesired shape and density while the heat made the ironmore malleable and responsive to the hammer.
Essentially hill climbing is equivalent to a blacksmithhammering without heat.
Annealing is the word for heating a metal and thencooling it slowly.
SA: ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 105/193
Simulated Annealing improves on hill climbing. First, here is sombackground to help with the intuition
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 106/193
HILL CLIM
_______________________
ALGOR
Hill-climbing search
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 107/193
function HILL-CLIMBING( problem) return a state that is a local maximum
input: problem, a problem
local variables: current , a node.
neighbor, a node.
current MAKE-NODE(INITIAL-STATE[problem])
loop do neighbor a highest valued successor of current
if VALUE [neighbor] ≤ VALUE[current ] then return STATE[current ]
current neighbor
Hill-climbing search
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 108/193
“a loop that continuously moves in the direction of increasing value”
terminates when a peak is reached
Aka greedy local search
Value can be either
Objective function value
Heuristic function value (minimized)
Hill climbing does not look ahead of the immediate neighbors of the curren
Can randomly choose among the set of best successors, if multiple have the
Characterized as “trying to find the top of Mount Everest while in a thick fo
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 109/193
Other drawbacks
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 110/193
Ridge = sequence of local maxima difficult for greedy algorithms to navigate
Plateau = an area of the state space where the evaluation function is flat.
SA: ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 111/193
Simulated annealing will
outperform hill climbing whenthe local maximum is near theglobal maximum.
In this case one of the jumps mayget far enough from the local
max to reach the ascendingslope of the global max:
Search using Simulated Annea
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 112/193
Simulated Annealing = hill-climbing with non-deterministic searchBasic ideas:
like hill-climbing identify the quality of the local improvements
instead of picking the best move, pick one randomly
say the change in objective function is
if is positive, then move to that state
otherwise:
move to this state with probability proportional to thus: worse moves (very large negative ) are executed less often
however, there is always a chance of escaping from local maxima
over time, make it less likely to accept locally bad moves
(Can also make the size of the move random as well, i.e., allow “large” ste
Physical Interpretation of Simulated An
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 113/193
A Physical Analogy:
imagine letting a ball roll downhill on the function surface
this is like hill-climbing (for minimization)
now imagine shaking the surface, while the ball rolls, gradually reduamount of shaking this is like simulated annealing
Annealing = physical process of cooling a liquid or metal until part
a certain frozen crystal state simulated annealing:
free variables are like particles
seek “low energy” (high quality) configuration
get this by slowly reducing temperature T, which particles move around
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 114/193
SIMULATED ANNEA _______________________
ALGOR
The SA Algorithm: General Outline
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 115/193
1. generate a neighboured solution / state
2. probabilistically accept the solution / state
3. probability of acceptance depends on the objective function function) difference and an additional parameter called temp
The SA Algorithm: General Out
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 116/193
Solution generation
typically returns a random, neighbored solution
Acceptance criterion
Metropolis acceptance criterion
better solutions are always accepted
worse solutions are accepted with probability
Annealing
Parameter T , called temperature, is slowly decreased
The SA Algorithm: General Out
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 117/193
SA ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 118/193
Step SA Operation
Step 1: At each iteration, an “atom” is randomly displaced a small amount.Step 2: The energy is calculated for each atom and the difference with the en
location is calculated.
Step 3: The Boltzmann probability factor is calculated
Step 4: If E 0 then the new location is accepted
Step 5: Otherwise, a random number is generated between 0 and 1:Step 6: If the random number is greater than the calculated P, then the higher ener
in the hope that the new location may eventually lead to a better locatilocation.
Step 7: Otherwise, the old atomic location is retained and the algorithm generates a
function SIMULATED ANNEALING( problem schedule) return a solution state
SA ALGORITHM: PSEUODOCO
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 119/193
function SIMULATED-ANNEALING( problem, schedule) return a solution stateinput: problem, a problem
schedule, a mapping from time to temperaturelocal variables: current , a node. next , a node. T , a “temperature” controlling the probability of downward
current MAKE-NODE(INITIAL-STATE[problem])for t 1 to ∞ do
T schedule[t ]
if T = 0 then return currentnext a randomly selected successor of current
∆E VALUE[next ] - VALUE[current ] if ∆E > 0 then current next
else current next only with probability e∆E /T
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 120/193
Initialisation
SA FLOWCHART
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 121/193
Metropolis simulation with fixed
temperature T
Adjust the solution
Evaluate cost function
Improvement
Accept new
solution
Accept new solution
with a probability
Check for equilibrium
Stop criteria at outer loop
Return optimal solution
Cooling
temperature T
Generate new solution
NoYes
Yes
No
Yes
No
SA ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 122/193
SA ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 123/193
SA FLOWCHART
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 124/193
SA ALGORITHMThe following is an outline of the steps performed for both the simulated annealing and thresho
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 125/193
algorithms:
1. The algorithm begins by randomly generating a new point. The distance of the new point from textent of the search, is determined by a probability distribution with a scale proportional to the
2. The algorithm determines whether the new point is better or worse than the current point. If the the current point, it becomes the next point. If the new point is worse than the current point, the ait the next point. Simulated annealing accepts a worse point based on an acceptance probabiliaccepts a worse point if the objective function is raised by less than a fixed threshold.
3. The algorithm systematically lowers the temperature and (for threshold acceptance) the thresho
found so far.4. Reannealing is performed after a certain number of points (ReannealInterval) are accepted by
raises the temperature in each dimension, depending on sensitivity information. The search is restemperature values.
5. The algorithm stops when the average change in the objective function is very small, or when anare met.
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 126/193
_______________________
ALGOR
PSEUODOC
SA ALGORITHM: PSEUODOC
PROCEDURE simulated annealing()
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 127/193
InputInstance();Generate randomly an initial solution;
initialize ;DODO thermal equilibrium not reachedGenerate a neighbour state randomly;evaluate ;update current stateIF with new state;
IF with new statewith probability ;OD;Decrease using annealing schedule;OD;RETURN(solution with the lowest energy)
END simulated annealing; A pseudo-code for a simulated annealing procedure
SA ALGORITHM
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 128/193
The following pseudocode implements the simulated annealing heu
described above. It starts from a state s0 and continues to either a maximum of kma
until a state with an energy of emax or less is found.
In the process, the call neighbour(s) should generate a randomly cneighbour of a given state s; the call random() should return a ranthe range [0,1].
The annealing schedule is defined by the call temp(r), which shouldtemperature to use, given the fraction r of the time budget that haexpended so far.
SA ALGORITHM: PSEUODOCOD
s ← s0; e ← E(s) // Initial state, energy.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 129/193
sbest ← s; ebest ← e // Initial "best" solution
k ← 0 // Energy evaluation countwhile k < kmax and e < emax // While time left & not g
snew ← neighbour(s) // Pick some neighbour.
enew ← E(snew) // Compute its ene
if P(e, enew, temp(k/kmax)) > 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 f
k ← k + 1 // One more evaluation done
return sbest // Return the best solution
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 130/193
_______________________
ALGOR
ACCEPTANCE PROBAB
The SA Algorithm131
Acceptance Probability
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 131/193
Acceptance Probability
T
E
e P
T
E P
1
T
E
P
By Johnson et al.
By Brandimarte et al., need to decide waccept moves for the change of energy
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 132/193
_______________________
ALGOR
STOPPING CRIT
Stopping Criteria133
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 133/193
Stopping Criteria total moves attempted
no improvement over n attempts
no accepted moves over m attempts
minimum temperature
Stopping criteria
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 134/193
The lowest temperature is reached The maximum iteration number is reached (external cycle
The improvement on cost function is not significant in succe
several iterations
Mixed criterion
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 135/193
SIMULATED ANNEA _______________________
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 136/193
DECISION MAK
Decisions to make in SA
Generic decisions
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 137/193
Generic decisions
Initial temperature, t 0
Cooling schedule, a and no of iterations
Stopping condition
Problem specific decisions
Solution space, S Cost function, f
Starting solution, s0
Neighborhood structure, N(s)
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 138/193
_______________________
DECISION MAKGENERAL DEC
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 139/193
_______________________
DECISION MAKGENERAL DEC
INITIAL TEMPER
Generic decisions:Initial Temperature
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 140/193
It must be hot enough to allow free exchange of neisolutions and to make the final solution independentstarting solution
Choose it large enough to heat the system rapidly uproportion of accepted moves to rejected moves re
prespecified value Then start the cooling
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 141/193
Generic decisions:Cooling schedule
Th h ld l i i di ib
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 142/193
The system should get close to its stationary distribucurrent temperature before temperature reduction
Temperature (and probability of accepting non-impmoves) should converge to zero
For this, make
(1) a large number of iterations at few temperatures (2) a small number of iterations at many temperature
Generic decisions:Cooling schedule (cont.)
A li h d l f (1) i t i a(t)= t h
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 143/193
A common cooling schedule for (1) is geometric, a (t )=at whe
0.8-0.99 suggested for a, implying slow cooling Increase no. of iterations as temperature decreases to better
local optimum towards the end no of iterations may be dynamic, depending on the number o
acceptances, e.g. iterate until 10 acceptances occur (no of itenaturally increase as t decreases)
no of iterations should not be much smaller than the neighbor
Generic decisions:Cooling schedule (cont.)144
A li h d l f (2) i (t) t/(1+
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 144/193
A common cooling schedule for (2) is a (t )=t /(1+ where b is small, implying very slow cooling
Only one iteration is made at each temperature
Other cooling schedules are proposed but not a
used as the above two
Generic decisions:Cooling schedule (cont.)145
In general:
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 145/193
In general:
Rate of cooling is more important than manner o(geometric or otherwise)
Try to keep rate of acceptance high at the begi
(exploration of the search space), reduce it towend (exploitation of the current solution’s neighb
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 146/193
_______________________
DECISION MAKGENERAL DEC
STOPPING COND
Generic decisions:Stopping condition147
As t approaches zero, probability of accepting non-
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 147/193
As t approaches zero, probability of accepting non
moves becomes virtually zero We may stop before that, e.g. after a certain numb
iterations or when
This is to produce a solution within e of optimum withprobability q
]/)1|ln[(| q
e
S t
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 148/193
Problem specific decisions149
Decision criteria
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 149/193
Decision criteria:
Validity of the algorithm should be maintaine
Computation time should be used effectively
Final solution should be close to the optimal s
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 150/193
_______________________
DECISION MAKPROBLEM SP
NEIGHBOURHOOD STRU
Problem specific decisions:Neighborhood structure
151
Every solution should be reachable from every othe
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 151/193
y y
convergence and validity) Neighborhood should be small enough to be search
adequately in fewer iterations, but large enough todrastic cost improvements in a single move (tradeoffbetween computation time and solution quality)
Random generation of a neighboring solution shouldfor effective use of computation time (since this mustat every iteration)
Problem specific decisions:Neighborhood structure
152
Choose the neighborhood (and the cost function) suc
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 152/193
g ( )
difference between the cost for s0 and s can be comfast (since this must be done at every iteration)
Avoid spiky neighborhood topography over the soluspace, as well as deep troughs, to reduce the numbeiterations
Also, avoid large plateau-like areas where the costchange
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 153/193
_______________________
DECISION MAKPROBLEM SP
SOLUTION
Problem specific decisions:Solution space
154
Infeasible solutions may be allowed and can be
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 154/193
y
penalized in the objective function (or repaired) To reduce the number of iterations, no of iterations,
the solution space as small as possible by choosingappropriate moves (may conflict with allowing infeasolutions)
If possible, apply a series of reductions to the problwithout destroying reachability
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 155/193
SIMULATED ANNEA _______________________
FINE TUN
Fine tuning a SA algorithm156
Experiment for best parameter settings (replicat
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 156/193
p p g ( p
are needed) Monitor evolution of the SA algorithm, graphica
possible, for different parameter settings
Monitor temperature, cost, ratio of accepted morejected moves and other statistics (plot these agthe iteration number)
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 157/193
SIMULATED ANNEA
_______________________ENHANCEMENTS AND MODIFICA
Enhancements and modificatio158
Functions other than exp(- /t ) can be used to accept nonimproving moves for speed or solution quality e g 1 /
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 158/193
improving moves for speed or solution quality, e.g. 1- /discrete approximation
Different cooling schedules can be used in different phauseful work is done in the middle of the schedule)
Using a constant temperature may be an option Reheating may be tried if no progress is observed Cooling may take place every time a move (or so many
accepted (no of iterations is dynamic)
Enhancements and modifications
(cont.)159
Neighborhood structure may be adjusted (typically rest
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 159/193
as the temperature decreases Neighborhood size may be changed
Sampling from the neighborhood can be cyclic rather thrandom
An approximate cost function can be used to reduce the
computation time Solution space may be restricted
Control of Annealing Process
Suppose that a step in the search direction produce a differen
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 160/193
performance value. The acceptance criterion, which is often reMetropolis Criterion, is as follows:
If it is a favorable direction, say 0, we always accept it.
Otherwise, this step is accepted with a probability exp(-/T), wparameter.
Control of Annealing Process161
Acceptance of a search step (Metropolis Criterion
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 161/193
Assume the performance change in the search direis E.
Accept a ascending step only if it pass a random te
Always accept a descending step, i.e. E≤0
1,0exp randomT E
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 162/193
Control of Annealing Process163
Cooling Schedule:
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 163/193
At each temperature, search is allowed to procee
a certain number of steps, L(k ).
T, the annealing temperature, is the parameter tcontrol the frequency of acceptance of ascending
We gradually reduce temperature T (k ).
The choice of parametersis called the cooling schedule.
k Lk T ,
Control of Annealing Process164
Notation:
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 164/193
T 0 starting (inital) temperatureT F final temperature (T0 > TF, T0,TF ≥ 0)
T t temperature at state t
m number of states
n(t) number of moves at state t
(total number of moves = n * m)
move operator
Control of Annealing Process165
x0 initial solution
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 165/193
xi solution i xF final solution
f( xi) objective function value of xi
cooling parametera
SA : PROCESS166
Procedure (Minimization)
Select x0, T0, m, n, α
Set x1= x0, T1= T0, xF= x0
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 166/193
for (t = 1,…,m) { for (i = 1,…n) {
xTEMP = σ(xi)
if f(xTEMP) ≤ f(xi), xi+1 = xTEMP
else
if , xi+1 = xTEMP
else xi+1 = xi
if f(xi+1) ≤ f(xF), xF = xi+1 }
Tt+1= α Tt }
return xF
t
iTEMP
T
f f
eU
)x()x(
)1,0(
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 167/193
CONCLUD
REMA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 168/193
SIMULATED ANNEA _______________________
PERFORMA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 169/193
Implementation of Simulated
Annealing
Finally, we like to emphasize the interpretation of the algorithm
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 170/193
Simulated annealing is a stochastic algorithm. Because random variables are used in the algorithm, the outco
different trials may vary even for the exact same choice of cooschedule.
Moreover, the convergence to the global optima of simulated a
only achieved when algorithm proceeds to infinite number of it
Implementation of Simulated
Annealing
Understand the result:
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 171/193
• This is a stochastic algorithm. The outcomay be different at different trials.
• Convergence to global optima can onlybe realized in asymptotic sense.
SIMULATED ANNEALING At each iteration of the simulated annealing algorithm, a new point is rand
The distance of the new point from the current point, or the extent of the se
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 172/193
on a probability distribution with a scale proportional to the temperature. The algorithm accepts all new points that lower the objective, but also, with
probability, points that raise the objective.
By accepting points that raise the objective, the algorithm avoids being traminima, and is able to explore globally for more possible solutions.
An annealing schedule is selected to systematically decrease the temperatalgorithm proceeds. As the temperature decreases, the algorithm reduces tsearch to converge to a minimum.
SIMULATED ANNEALING Threshold acceptance uses a similar approach, but instead of accepting ne
raise the objective with a certain probability, it accepts all new points belothreshold.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 173/193
The threshold is then systematically lowered, just as the temperature is loweannealing schedule.
Because threshold acceptance avoids the probabilistic acceptance calculatannealing, it may locate an optimizer faster than simulated annealing.
SIMULATED ANNEA
_______________________
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 174/193
ADVANT
DISADVANT
Advantages and disadvantag175
Advantages:
SA is historically important
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 175/193
easy to implement
convergence proofs: theoretically interesting, but practical relevance v
good performance often at the cost of substantial run-time
Issues:
Performance
Solution is only as good as the evaluation function Termination Criteria
Whys is SA a META-HEURISTIC SA is not a single algorithm but rather a heuristic strategy
There are several decisions to make and several parameters to set (both gproblem specific) to implement SA for a particular problem
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 176/193
p p ) p p p
The same is true for TS, GA and the others as well (main difficulty of devemetaheuristic algorithm)
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 177/193
_______________________
MA
MATLAB SYNTAX
[x fval] = simulannealbnd(@objfun,x0,lb,ub,options)
Where
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 178/193
@objfun is a function handle to the objective function.
x0 is an initial guess for the optimizer.
lb and ub are lower and upper bound constraints, respectively, on x.
options is a structure containing options for the algorithm. If you doargument, simulannealbnd uses its default options.
The results are given by: x — Final point returned by the solver
fval — Value of the objective function at x
To open the Optimization Tool, enter optimtool('simulannealbnd')
MATLABTEMPERATURE
The temperature is the control parameter in simulated a
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 179/193
is decreased gradually as the algorithm proceeds.
It determines the probability of accepting a worse solut
step and is used to limit the extent of the search in a giv
You can specify the initial temperature as an integer in tInitialTemperature option, and the annealing schedule a
the TemperatureFcn option
MATLAB Annealing Schedule
The annealing schedule is the rate by which the tempera
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 180/193
decreased as the algorithm proceeds. The slower the rate of decrease, the better the chances
finding an optimal solution, but the longer the run time.
You can specify the temperature schedule as a function
the TemperatureFcn option.
MATLABReannealing
Annealing is the technique of closely controlling the temp
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 181/193
cooling a material to ensure that it is brought to an optim Reannealing raises the temperature after a certain num
points have been accepted, and starts the search againtemperature.
Reannealing avoids getting caught at local minima. You specify the reannealing schedule with the Reanneal
MATLAB
options = saoptimset
options = saoptimset('param1',value1,'param2',value2,...)
' '
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 182/193
options = saoptimset(oldopts,'param1',value1,...) options = saoptimset(oldopts,newopts)
options = saoptimset(optimfunction)
MATLAB Temperature Options: Temperature options specify how the temperature will be
iteration over the course of the algorithm.
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 183/193
InitialTemperature — Initial temperature at the start of the algorithm. The defa
TemperatureFcn — Function used to update the temperature schedule. Let i de
number. The options are:
@temperatureexp — The temperature is equal to InitialTemperature * 0.95^i. Thi
@temperaturefast — The temperature is equal to InitialTemperature / i.
@temperatureboltz — The temperature is equal to InitialTemperature / ln(i). @myfun — Uses a custom function, myfun, to update temperature. See the functions
ReannealInterval — Number of points accepted before reannealing. The defa
MATLAB
Algorithm Settings: Algorithm settings define algorithmic specific pa
generating new points at each iteration.
f f
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 184/193
Parameters that can be specified for the simulated annealing and tacceptance algorithms are:
AnnealingFcn — Function used to generate new points for the next
choices are: @annealingfast — The step has length temperature, with direction uniformly at rand
@annealingboltz — The step has length square root of temperature, with direction u
@myfun — Uses a custom annealing algorithm, myfun. The syntax is:
newx = myfun(optimValues,problem)
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 185/193
SIMULATED ANNEA
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 186/193
_______________________
APPLICAT
Applications of SA 187
Aerospace Vehicle Design
Graph partitioning & graph coloring
T li l bl
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 187/193
Traveling salesman problem
Quadratic assignment problem
VLSI and computer design
Scheduling
Image processing
Layout design
A lot more…Find one!...
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 188/193
REFEREN
REFERENCE BOOKS
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 189/193
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 190/193
QU
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 191/193
ASSIGNM
ASSIGNMENT Study any paper on implementation of SQP, GA,
Identify Problem Statement
Identify Problem Formulation
Id tif D i V i bl
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 192/193
Identify Design Variables
Identify Design Objectives
Identify Design Constraints
Identify Control Parameters
Explain Results
Solve any CONSTRAINED optimization problem ofusing MATLAB
USE AIAA Paper format please
SUBMISSION DEADLINE:
7/21/2019 Msdo 2015 Lecture 9 Sa
http://slidepdf.com/reader/full/msdo-2015-lecture-9-sa 193/193
THANK YOU FOR YOUR INT