Title: Basics of problem Solving-Evaluation Function
1MAE 552 Heuristic Optimization Lecture
8 February 8, 2002
2http//www.statslab.cam.ac.uk/richard/tmp/mcp/jav
a/ANNEAL/annealing.html
3- Start with a ball at point A. Shake it up and
it might jump out of A and into B. - Give it another shake (adding energy) and it
might go to C. - This is the general idea behind SAs.
4The SA Algorithm
T0 m10, m20, m30, m40, mm0 T1 m11,
m21, m31, m41, mm1 T2 m12, m22,
m32, m42, mm2 T3 m13, m23, m33,
m43, mm3 T4 m14, m24, m34, m44,
mm4 T5 m15, m25, m35, m45,
mm5 .. Tn m1n, m2n, m3n, m4n,
mmn nnumber of levels in cooling
schedule mnumber of transitions in each Markov
chain
5Simulated Annealing Parts of the SA
- The following musty be specified in implementing
SA - 1. An unambiguous description for the objective
function f (analogous to energy) and possible
constraints. - 2. A clear representation of the design vector
(analogous to the configuration of a solid) over
which an optimum is sought. - 3. A cooling schedule this includes the
starting value of the control parameter, To, and
rules to determine when the current value of the
control parameter should be reduced and by how
much (the decrement rule) and a stopping
criterion to determine when the optimization
process should be terminated.
6Simulated Annealing Parts of the SA
4. A move set generator which generates
candidate points. 5. An acceptance criterion
which decides whether or not a new move is
accepted. 4 and 5 together are called a
transition mechanism which results in the
transformation of a current state into a
subsequent one.
7Simulated Annealing Cooling Schedule
- SA generates a series of points towards the
optimum as it proceeds - X0, X1, X2, X3.
- With corresponding function values
- f(X0), f(X1), f(X2), f(X3).
- Because of the stochastic nature of SA, the
sequence of the fs is random and not monotonic. - However it does drift towards the optimum because
of the gradual reduction in the control
parameter.
8Cooling Schedules
- A cooling schedule is used to achieve convergence
to a global optimum in function optimization. - Cooling schedule describes how control parameter
T changes during optimization process. - First let us look at the concept of acceptance
ratio, X(Tk). - X(Tk) ( of Accepted Moves / of Attempted
Moves) - If T is large almost all moves are accepted
- X(Tk)-gt1
- As T decreases
- X(Tk)-gt1
- For maximum efficiency, it is important to set
the proper value of To.
9Simulated Annealing Cooling Schedule
- 3 Parts in a cooling schedule
- 1. Choose the starting value of the control
parameter, T0. - It should be large enough to melt the objective
function, to leap over all peaks. - This is accomplished by ensuring that the initial
X(T0) is close to 1.0 (most random moves are
accepted). - Start the SA Algorithm
- At some T0 and execute for some number of
transitions and check X(T0). - If not close to 1.0 multiply Tk by a factor
greater than 1.0 and execute again. - Repeat until X(T0) close to 1.0.
10Simulated Annealing Cooling Schedule
- 2. The decrement rule.
- Two parts to this - the time when the control
parameter reduction should occur and the rate by
which it should be reduced. - If using fixed length Markov Chains of fixed
length, that is once the total number of
attempted moves at each value of the control
parameter (i.e. inner loop) reaches a
predetermined value, it is time to reduce the
control parameter. - A frequently used decrement function is
- Tk1rTk k0,1,2,........
- r control parameter reduction coefficient.
- Generally this is a constant between.8 and .99.
11Simulated Annealing Cooling Schedule
- rt can also be set based on the problem size and
characteristics. - SPEARS set r 1/(Num_dvsk)
- k current step in the cooling schedule
- All settings of Simulated Annealing will entail a
tradeoff between searching thoroughly at a
particular level of T and the number of steps in
the cooling schedule.
12The SA Algorithm
Increase the number of transitions in each Markov
Chain
Number of steps in the Cooling Schedule
T0 m10, m20, m30, m40, mm0 T1 m11,
m21, m31, m41, mm1 T2 m12, m22,
m32, m42, mm2 T3 m13, m23, m33,
m43, mm3 T4 m14, m24, m34, m44,
mm4 T5 m15, m25, m35, m45,
mm5 nnumber of levels in cooling
schedule mnumber of transitions in each Markov
chain
13Simulated Annealing Cooling Schedule
- No matter how sophisticated the decrement rule -
important to reach a balance between rapid
decrement of the control parameter and short
length of Markov Chains. - 3. Stopping criterion.
- Rule of thumb if the improvement in objective
function after a period of execution remains
fairly constant then stop the algorithm. - If the last configuration of several consecutive
inner loops have been very close to each other
then it is time to stop
14Simulated Annealing Transition Mechanism
- A transition mechanism transforms a current state
into a subsequent one. It consists of two parts
- (a) move set generator and
- (b) an acceptance criterion
15Simulated Annealing Move Set Generator
- a move set generator
- Generates a random point X from the neighborhood
of xc. - Its move (step) generation depends on the data
type and the corresponding value of the control
parameter Tk. - For high values of Tk, almost all attempted moves
are accepted and it is inefficient to use a small
neighborhood because it will cause slow progress
of the algorithm. - On the contrary, for small values of Tk, more
attempted moves are rejected if a neighborhood is
used. - The size of the move should decrease as the
control parameter is reduced. This improves
computational efficiency.
16Simulated Annealing Move Set Generator
- Large Value of T, large neighborhood.
x2
vc
x1
17Simulated Annealing Move Set Generator
- Small Value of T, small neighborhood.
x2
g1
x1
18Simulated Annealing Move Set Generator
Choose a candidate from the neighborhood based
on a gaussian distribution.
x2
g1
x1
19Simulated Annealing Move Set Generator
- Depending on the type of representation
controlling the size of the neighborhood is going
to entail different things. - For the SAT problem the representation is a
string on binary numbers TRUE, FALSE - A one-flip neighborhood is defined as all of the
points that could be arrived at by flipping one
of the bits. - X010111100011-gtX110111100011
- Two-flip neighborhood
- X010111100011-gtX100111100011
- Less than one-flip neighborhood
- X010111100011-gtX100111100011
20Simulated Annealing Move Set Generator
- For the NLP there are an infinite choice of move
directions and magnitudes. - One approach is to generate a random move each
time along a single design variable keeping all
others constant. - Xcx1,x2,x3,x4-gt Xnx1new,x2,x3,x4
- Another approach is to change all design
variables simultaneously. - Xcx1,x2,x3,x4-gt Xnx1new, x2new, x3new,
x4new
21Simulated Annealing - Constraint Handling
- Exterior Penalty Function
- Where rp generally starts small and is gradually
increased to ensure feasibility. - Interior Penalty Function
- Here rp for the second term is the same as before
but for the - first terms it starts large and is gradually
decreased.