Professional Documents
Culture Documents
Nontraditional Optimization
Algorithms
291
on
f(x ),
(L)
xi_
xt
(U) . _
~xi , ~ -1,2,
. .. ,N.
al
In order to use GAs to solve the above problem, variables xi's are
first coded in some string structures. It is important to mention
~re that the coding of the variables is not absolutely necessary.
There exist some studies where GAs are directly used on the variables
themselves, but here we shall ignore the exceptions and discuss the
working principle of a simple genetic algorithm. Binary-co~ed string
having 1's and9's are mostly used. The length of the string is usually
determined according to the desired solution accuracy. For example,
if four bits are used to code -each variable in a two-variable function
optimization problem, the strings .( 0000 0000) and ( 1111 1111)
would represent the points
(q:~L)' x~L)yT
(U) . (U))T
( xl '~2
'
292
(6.2)
Nontraditional
Optimiza~ion
Algorithm
298
G A operators
Fi
-n--,
EFi
i=l
294
F= EFifn.
i=l
_~
Point
Fitness
25.0
5.0
40.0
10.0
20.0
,f
0 010 0 0
' .,
'
0 011 1 1
:::}
111111
111000
296
1011
1101
0110
1100
Notice that a.ll four strings have a. 0 in the left-most bit posi~ion. If
the true optimum solution requires 1 in that position, then neither
fe"proauction nor crossover operator described above will be able to
create 1 in that position.- The inclusion of mutation introduces some
piOba.bilitYT NPm) ofturning o into 1.
The
reproduction operator selects good strings a.nd the crossover operator
recomljiiies -good substrings from good st_!J:ggs together to honefully
crea.te_a. better substrin$;_ 'l;:_he muta.ti~n operator alters a. .string
loca.lly to hopefully create a. better string. Even though none o
these cla.i~s ~ guaranteed a.nd}or t~st~d while crea.tin_g a. ~~&)t
is expected that if ba.d strings a.re created thE!Y will _be eliminated by
the re~duction operator in. the next genera.tio"ii"'and. If good s~r}ig
a.re ~t~g, they will be in.crea.singly emJth~~~terested readers
ma.y refer to Goldberg (1989) a.nd other GA literature given in the
references for further insight a.nd some mathematical foundations of
genetic algorithms.
-l----
--- -
-1
I
I
I
I
X max
xmin
Figure 6.2 A schema with three fixed positions divides the search
space into eight regions. The schema (10h*) is highlighted.
..._
Even though the best (1- Pc)100% of the current population can be copied
deterministically to the new population, this is usually performed at random.
2
Flipping of a coin with a probability p is simulated as follows. A number
between 0 to 1 is chosen at random . If the random number is smaller than p, th
ontcomc of coin- flipping is true, othcrwiAe th e outcome is false.
-~----
297
m(H, t
:F(H) [
+ 1) ~ m(H, t) --=y1-
IJ(H)
]
Pet=!- Pmo(H) J'
growth factor,
(6.3)
<P
the fit ness of all strings representing the schema, 8(!/) is the defining
length of the schema H calculated as the difference in the outermost
defined positions, and o(H) is the order of the schema H calculated
as the number of fixed positions in the schema. For example, the
schema H =10h* has a defining length equal to o(H) = 3- 1 = 2
and has an order o(H) = 3. The growth factor <P defined ;in the above
equation can be gre~ter than, less than, or equal to 1 depending
on the schema H and the chosen GA parameters. If for a schema
the growth factor <P 2: 1, the number of strings representing that
schema grows with generation, otherwise the representative strings
of the schema reduce with generation. The above inequality suggests
that the schema having a small defirung length (small o(H)), a few
fixed positions (small o(H)), and above-average fitness (F(H) >F),
the growth factor <P is likely to be greater than 1. Schemata for
which the growth factor is greater than 1 grows exponentially with
generation. These schemata usually represent a large, good region
(a region with many high fitness points) in the search space. These
schemata are known as building blocks in GA parlance. These
building blocks representing different good regions in the search space
get exponentially more copies and get combined with each other
by the action of GA operators and finally form the optimum o:r a
near-optimum solution. Even though this is the basic understanding
of how GAs work, there exists some mathematical rigour to this
hypothesis (Davis and Principe, 1991; Vose and Liepins, 1991).
Holland (1975) has shown that even though n population members
are modified in a generation, about n 3 schemata get processed in
a generation. This leverage comes without any extra book-keeping
(Goldberg, 1989) and provides an implicit parallelism in the working
of genetic algorithms. Even though there are a number of advantages
of using a coding of variables, there are also some disadvantages. One
of the drawbacks of using a coding representation is that a meaningful
and an appropriate coding of the problem needs to be used, otherwise
GAs may not converge to the right solution (Goldberg, et. al, 1989;
Kargupta, et, al, '1992). However, a general guideline would be to
use a coding that does not make the problem harder than the original
problem.
~
800
~
--
Global optimum
X
Figure 6.3 An objective function with one local optimum and one
global optiqmm. The point x(t) is in the local basin.
in the loc~l basin (point x(t) in the figure), the steepest descent
algorithm will eventually find the local optimum point. Since the
transition rules are rigid, there is no escape from these local optima.
The only way to solve the above problem to global optimality is to
have a starting point in the global basin. Since this information
is usually not known in any problem, the steepest-descent method
(and for that matter most traditional methods) fails .to locate the
global optimum. We show simulation results showing inability of
the steepest descent method to find the global optimum point on
a multimodal problem in Section 6.3. However, these traditional
methods can be best applied to a special class of problems suitable
for those methods. For example, the gradient .search methods will
outperform almost any algo~ithm in solving continuous, unimodal
problems, but they are not suitable for multimodal problem. Thus, in
general, traditional methods are not robust. A robust algorithm can
be designed in such a way that it uses the steepest descent direction
most of the. time, but also uses the steepest ascent direction (or any
other direction) with some probability. Such a mixed strategy may
require more number of function evaluations to solve "continuous,
unimodal problems, because of the extra computations involved in
trying with .non-descent directions. But this strategy may be able
to solve complex, multimodal problems to global optimalitY,. In the
muHimodal problem, shown in the above figure, the mixed strategy
may take the point x(t) into the global basin (when t:r.ied with
non-descent directions) and finally find the global optimum point.
GAs use similar search strategies by using probability in all their
operators. Since an initial random population is used, to start with,
the search can proceed in any direction and no major decisions are
made in the beginning. Later on, when the pQpulation begins to
.cl
I
I
I
-~-L____ _ ___________ __ _
~ Yz
.. cz
C\1
~
Ct
dt
I
Xt
t c2
Figure 6.4 The action of a single-point crossover operator on a twovariable search space. The points Pl and P2 are parent points and ~~
and c2 are children points.
'
30
lml'ion
along directions ( Ct and c2) shown in the figure (either along soHd
arrows or along dashed arrows). The exact locations of the children
points along these directions depend on the relative distance between
the parents (Deb and Agrawal, 1994). The points Yt and Y2 are the
two typical children points obtained after crossing the parent points
PI and p 2 Thus, it may be envisaged that point PI has moved in the
direction from di up to the point YI and similarly the point P2 has
moved to the point Y2.
Since the two points used in the crossover operator are chosen
at random, many such search directions are possible. Among them
some directions may lead to the global basin and some directions
may not . The reproduction operator has an indirect effect of filtering
the good search directions and help guide the search. The purpose
of the mutation operator is .to create a point in the vicinity of the
current point. The search in the mutation operator is similar to
a local search method such as the exploratory search used in the
Hooke-Jeeves method. With the discussion of the differences and
similarities of GAs with traditional methods, we are now ready to
present the algorithm in a step-by-step format.
Algorithm
Step 3 If t >
Terminate.
tmax
+1
EXERCISE 6. 1.1
,....
f(xt,x2)
,;'
in the interval 0 ;:;; x 1 , x 2 ;:;; 6. Recall that the true solution to this
problem is (3, 2f having a function value equal to ~ero.
'
30
'plim~'
'
tmax
Nr'"lrvadilin,.tal Opltmt
!104
......
0
......
.....
0
..., ......
0
"';:I ......
..0
U) 0
......
bo
.s
0
A.
bO
.::
::E
.::
0
-~
0
0
0
......
0
0
0
0
0
...... 0
0
0
00 0 0
...... 0
0
0
0 ...... ...... ......
......
...... ...... ......
...... ...... ...... ...... ...... ...... ......
...... 0 ...... 0 0 0 0
0 ...... ...... ...... ......
0 0
0
0
0
0
0
0
0
0 0 0 ...... ......
0 0 0 0 0
...... ......
...... 0 0
0 ...... ...... ...... ......
............
...... ...... 0
0 ...... ...... 0 0
0 ...... ...... 0 0
0 ...... ...... ...... ......
0 0 0 ...... ......
......
...... 0 0 0
"';:I
0 0 ...... 0 ......
00 0 00
............ ...... 0 0
U)
...... ......
0 0
0 ......
p...
k.
o--~o~-o-MoM--oo--~o
..0
0
0
0
0
0
0
0
0
0
0
0
0
~ 10
~ 0 ~ ~ ~ ~ ~ ~ ~ ,.......,.......,.......
~ M ~ ~ ~ ,.......,.......,.......
00 ~ 0
,....... M ~ ,.......,.......,.......,.......,.......
"'0
~~OO~M~-~~M~OOO~~~~~~~M
~o~~MM~-~oo~oo--o~oo~oo-
~~~~~~~~~~~~~~~~~~~~
00000000000000000000
C,)
"'
0
I:X:ll~ ~ ~
"'
Q)
~
....c:
p...
g;
;3 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
g g
8' ~
~~~~~~~~~~~~~~~~~~~~
00000000000000000000
~ IM 0
00 ~ ~.!";)
~ ~ ~ ~ ~ ~
~ ~ ~
~ ~ 00 M
.::
~~~~~~~~~~~~~~~~~~~~
-e
~-~ootn~~--~~-MM~M~0~~-
"'0
~~~~~~~~~~~~~~~~~~~~~
o-o-o--oo~o~oooo--~o
~000-o--oo~O~OOOO_O_O
;:I
~00000000000000000000
0
A.
.....
~oo>n~~OOMM~~~oo~~o~~-M>n
~00~00~~~~~1.!";)~-~~~0tn~Otntn
~~~~~~~~~~~~~~~~~~~~~
~tn~~~OOO~tn~~~OO~~~~M~~
"'0
.::
~--
"'
.::
~~~ ~
s
Q)
....c:
,_.-+>
Q)
.::
..0 -
S+>
;:I .::
0 g
bOU
.::
Q)
~~
;:I
~k.
~~
~ ~ ~ ~ ~ ~
00
M~~-
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
.::
o.::
-~ ""0
(.)
~rno"'
Q)
......0 .::Q)
:>.
Q)
~~
~..0
Q)
..0
0
.....
Q)
..... ..o
A.
Q)
s
;:I
> .::
~ 8
- ;:::1"'0
0
s .::
;:I
"'
0~
~~~M~~o~~~o~~~~~~~~~
;:I
"'I~ ~ ~ M
~.!";) M
~.!";) 0
~ ~ -
00 ~
M ~ M ~ -
~ ~
~~tn~-~~M~M~~tn~-~OOM~~M
M~~~~MO~~~OOMM~O~~OOMM
C,)~
~oMM~~~~Mo~oo~~~~M~~
0
0
0
~gc;~c;g~c;~c;~c;::::::g~ ......
~ 0
0 0 ...... 0 ...... 0 0
0 0 ............ 0
0 ...... ......
.-I
1 0 ...... 0 0 ...... 0
co
t!
tn
~M~-M~OtnMO~~M~OOO-tn-~
-~
Q)
tnO~~-~OOM~M-~-~00~~-~00
r
I~
~ - ~ ~ M 0 ~ - ~ ~ 00 ~ 00 ~ t- ~ - ~ 0
o~-o-o~~o~~~-~~~M~~o
~~~~~~~~~~~~~~~~~~~~
ooooooooooooooooooo-
.::
A.
bO
""3
A.
0
00
........................ 0 0 0 ...... 0
0 ............ 0
...... 0 ...... 0
...... 0 0 0
0 ...... 0 0
0 0 0 ......
tl.,.....,....oo.,.....,....o.,.....,.....,.....,....ooo.,.... ...... o o o o
,.oo.,.....,....o.,.....,....oo ...... o.,....oo.,....o 0 ...... 0 ...... ......
o ............ o ............ o .................. o ........................ 0 ...... 0 ...... ......
...... 0 ...... 0 ......
. . . o 0...... oooo.,....ooo.,.....,.....,....o
.sbO,E
V-' ...... 0
............ 0 0 .................. 0 0 ...... 0 ...... ............. 0 .............
~~o.,.....,....oo.,.....,....o.,....o.,.....,....o.,....o
U)
...... 0 0 0 ......
.....t-tO....-t....-t
...... 0 ...... 0 0
...... 0 0 0 0
...... o ...... oo
Ec;g~gc;~c;~:::~~::::::c;:::
0 0 0 ...... ......
J5:::g~~:::gc;:::~g:::gg;:~
0 ................... .......
............ 0 0 0
0 0 ...... 0 ......
...... 0
...... ......
.::
.9
...,
(.)
Q)
Q)
...,.::..._."'
;:I
8 ...,:>.
""0;..=
Q) ...,,.o
(.)
QJ,.o
"'
A.o
>< .....
~p...
-~M~~~~~~o-~M~~~~oo~o
,.......,.......,.......,.......,.......,.......,.......,.......,.......,.......C"'
~I:X:l
:101'1
,4,' /,IIJ) 1/ i\ t, t hlH Htop, wo tlolcct ~nt> d Ht,J'iu gH iu th o popul a.t i<l n to
for'rtl t. ho rtl l1t.luK pool. IH order to \I H(l th <l roulotto wltcol Hd octlon
pror(lduro, wo fir Ht calcul ate th e a.verago fitn ess of tho population.
Jly n,ddiu g t.h o fitn ess values of a.IJ strin gs a nd dividin g th e Hlllrl
by th e population size, we obtain :F = 0.008. T he next ll l cp is to
:ampule th e expected count of each string as :F(x)j:F. The values
are calculated and shown in column A of Table 6.1. In other word s,
we can compute the probability of each string being copied in th
mating pool by dividing these numbers with the population siz
(column B). Once these probabilities are calculated, the cumulati v
probability can also be computed. These distributions are also shown
in column C of Table 6.1. In order to form the mating pool, w
create random numbers between zero and one (given in column D)
and identify the particular string which is specified by each of thes
random numbers . For example, if the random number 0.472 is
created, the tenth string gets a copy in the mating pool, becaus
that string occupies the interval (0.401, 0.549), as shown in column C .
Column E refers to the selected string. Similarly, other strings ar
selected according to the random numbers shown in column D. After
this selection procedure is repeated n times ( n is the population
size), the number of selected copies for each string is counted. This
number is shown in column F. The complete mating pool is also
shown in the table. Columns A and F reveal that the theoretical
expected count and the true count of ~ach string more or less agree
with each other. Figure 6.5 shows the initial random population
and the mating pool after reproduction. The points marked with an
enclosed box are the points in the mating pool. The action of th
reproduction operator is clear from this plot. The inferior points have
been probabilistically eliminated from further consideration. Notic
that not all selected points are better than all rejected points. For
example, the 14th individual (with a fitness value 0.002) is selected
but the 16th individual (with a function value 0.005) is not selected.
Step 5 At. t.hi l'l Hl.op, the strings in the mating pool are used in
tll<l r.roRsovor O!Hif'll,t,lon . In a. single- point crossover, two strings ar
l'lclo<:l.llcl 1~t m nclom nml <' roHscd at a random site. Sin ce th e matin g
6~
~3
0 -- - - - - - - - - -
----
5
4
306
'
---------
.-----
~"' "\
c----..
--
-&::f-....
---
'
'\.
"
\
0
'
oint
\
lc
c\
I.
30.0
If 3
Initial population
Mating pool
2
1
I \
J. :. ~
5
..
.a\.
\ \
10.0
\
I
,~_
75.0
I
I
I
'
150.0
'\
o After orosaover
300.0
\ 0
'
M~.
,\\I
1rumum :
'
"
--
500.0
. ... a \ \ \
'.
........ .
~'\" \c\...
'L
0
6 r en :n . .-,J...... ~ ..... t :
;
t
t
............ o 1iatina pool
850.0
'
'o
. . . 1500.0
o.
'-.._0
ao
I
I
- ..
o~~~--~~~~--~~~~~~
Xt
Figure 6.5 The initial population (marked with empty circles) and
the mating pool (marked with boxes) on a contour plot of the objective
function. The best point in the population has a function value 39.849
and the average function value of the initial population is 360.540.
pool contains strings at random, we pick pairs of strings from the top
of the list. Thus, strings 3 and 10 participate in the first crossover
operation. When two strings are chosen for crossover, first a coin
is flipped with a probability Pc = 0.8 to check whether a crossover
is desired or not. If the outcome of the coin-flipping is true, the
crossing over is performed, otherwise the strings are directly placed
in an intermediate population for subsequent genetic operation. It
turns out that the outcome of the first coin-flipping is true, meaning
that a crossover is required to be performed. The next step is to
find a cross-site at random. We choose a site by creating a random
number between (0, .e- 1) or (0, 19). It turns out that the obtained
random number is 11. Thus, we cross the strings at the site 11
and create two new strings. After crossover, the children strings
are placed in the intermediate population. Then, strings 14 and 2
(selected at random) are used in the crossover operation. This time
the coin-flipping comes true again and we perform the crossover at
the site 8 found at random. The new children strings are put into
the intermediate population. Figure 6.6 shows how points cross over
and form new points. The points marked with a small box are the
points in the mating pool and the points marked with a small circle
are children points created af~er crossover operation. Notice that not
xl
all 10 pairs of points in the mating pool cross with each other. With
the flipping of a coin with a probability Pc = 0.8, it turns out that
fourth, seventh, and tenth crossovers come out to be false. Thus,
in th ese cases, the strings are copied directly into the intermediat
population. The complete population at the end of the crossover
operation is shown in Table 6.2. It is interesting to note that with
Pc = 0.8, the expected number of crossover in a population of size
20 is 0.8 X 20/2 or 8. In this exercise problem, we performed seven
~rosso vers and in three cases we simply copied the strings to the
ltttormediate population. Figure 6.6 shows that some good points
a.nd some not-so-good points are created after crossover. In some
ascs, points far away from the parent points are created and in
some cases points close to the parent points are created.
Optimi~tdion
308
.----.1
0 "<t' t- C"' 00 C"' C"' "<t' ..-< "<t' "<t' "<t' t- M ~ C"' 0 L<':> M "<t'
~L<':>OOO.-<O.-<.-<.-<.-<.-<.-<MOC"'.-<.-<OC"'C"'
~~~~~~~~~~~~~~~~~~~~~
309
In
Mutation Operation
~00000~00000000000000
co 00 0')
C"'"<t'O,...;.M 0') C"' M 0') 00 00 M CO C"' t- 00 C"'O')"<t'
.----.1
"<t' L<':> 00 C"'t-MOOCOCO 00 "<t' N C"' co
~ co
00 C"' 0
..__,
00
M C"' M 00 L<':> 0!~~1:-:<X?<X? t-:t-:0! ...... 0') ~t.q<X?
.......
oocic0.,;~ MOt-C"'OO L<':> 00 C"' OL<':> 0') C"' 0')
00 M"<t'O')L<':>C"'
......
00 t- 00 t- t- t- C"' ...... "<t' 00 0') .-<"<t'M
C"'
M
C"' ...... L<':>
"<t'
"'I
"<t' 0
tC"'
t......
"<t' "<t' t- "<t' L<':> L<':> C"' ...... ~ M "<t' C"' C"' 0
~t-OOOOO"<t'OMCO.-<"<t'L<":>L<':>O')~.-<C"'L<':>OOC"'O
I ..
J. . .. . J.. .. .. ..... I
o After crossover
o After Mutation
- --
COOMO.-<L<':>M.-<.-<O~"<t't-M"<t'.-<L<':>O')"<t'O
4 ................................. ..
~.,;d~.,;~.,;.,;d~~~~~~d~~~.,.
---
.-<I L<':> t-. C"' M 0 t- ...... C"' L<':> t- M M "<t' "<t' 00 M co ...... 00 C"'
~.-<"<t'L<':>.-<L<':>MMOOMO"<t'"<t'COCOL<':>.-<Mt-L<':>CO
OO')"<t'"<t'O')MMO')OL<':>MMC"'MM"<t't-OOMO')
~~d~d~~~~~~~dd~~~~cici
~3
0
0
.......... 0
..... 0 0
..... 0 0 0:::::0 .... o ................ o
............................ o .... o o o o o o o .... o ....
0
00:::::0 .0
0
0
............... 0 0
..... ..... ........ o ........ o
.... o o o .... o o o o ............ .... .... 0 .... 0 .... .....
........ o o .... o
~g~g~dil:Jgc:g;:;:
o o o .... o ....
o.,....,....,...o.,....,...oo.,....,...~o oooa:::ooo
..... r::c::J:CJ ..... ..... ..... ..... . 0 0 ..... ..... ..... ..... .... 0 0 .............
.... g
11.1
c;
-<c;;
'r;J
OO.,...OG3JOoOOOO.,....,... .,..._a_.,...o.,...o
..... 0
0 ..................... 0
..... o . 0
0 ..... Oo::::1JO.,...O.,...
~
....
;=j
::E
-~
-<c;;
~o.,....,....,....,....,....,....,...o.,...ooooooo.,...o.,...
o::
..... 0
............... 0
.................... 0
.......... 0
~=~o.,...o.,...o
o~~.,...o.,....,....,...o.,....,...oo.,....,...ooooo.,...oo
;=j.,....,....,....,....,....,....,....,...oo.,....,....,....,....,...oo.,....,....,...
U~ooc;~gc;~~~~g~ggc;;:c;~C:~C:~
Q)
~!C"'c:gc:;:~g~~;:~sc:c:~c:~c:gc:g
~~~c;g;:~gc;gg~c:c:c:;:;:;:c;;:c:;:c:
s .s
..... 0
.....
...............
............... 0
<I)
.-<;:::
11.1
bO
.s
11.1
11.1
~~~c:c:~gc;;:~~~~;:;:c:c:c:~;:gc;c;
~
....
~.,....,...o.,....,....,....,....,...oo.,....,...ooooo.,...o.,...
00
~~;=jOOO.,...OOO.,....,...OOOOOOOOOOO
o.,...o.,...ooooo.,...ooooo.,....,....,...oo
~O')O')~~L<':>L<':>
\!:) ;;... ;;... ;;... ;;... ;;... ;;...
~~............
~~~~
.-<oo.,...oo.,....,...o.,...ooo.,... .,;....,...o.,....,....,...o
~.,...o.,....,....,....,....,....,....,...oooo
.s
~ ~
c: g ~ g g c: c: .............
c: ~ ~ ;:....
.... 0
.....
~000000000
-~
.... 0 0 0 0 0 ........
0 0 0 .... 0 0 ....
................. 0 .... 0
......... 0 0 ........ ....
0 ........ 0 0 .... 0
0 .0
0 ..... 0 0 .....
0 0 0 ..... 0 0 0
.---.
0
;;...
..__,
~
~
..,~
::E .s g 8' c: ;: g g g g ;: g g g ;: ;: ;: g ;: ~ ;: g J
....... oo.,....,....,...ooo.,....,....,....,....,...o.,...o.,....,...
o~o.,....,....,...o.,....,....,...oo.,....,...o
~~~c:~~;:;:;:c;c;;:;:gggc;c;~g~
~ooo.,...ooo.,....,...ooooooooooo
ooO.,...O.,...OOOOO.,...OOOOO.,....,....,...OO
l
Xt
ro~.-<ooo.,....,...o.,...oo.,...oo.,....,...o.,....,....,....,...o
':,\ \ ,"'\
oL-~._~~~~~~~~~~
~ ~---t-------------------------------------------------------i
~
\ liiil ... _
.,...G3J.,....,...oo~o.,...o.,....,....,...o.,...o.,...o.,...o
<I)
...I-..\
\!:)