Page 350 - Applied Numerical Methods Using MATLAB
P. 350
UNCONSTRAINED OPTIMIZATION 339
N = 8, N = 2, N = [8 8]
p b
pool P population X fx
01100110 01100110 −1.0000 −1.0000 −10.00
01001111 10101011 −1.9020 −1.7059 −40.95
11110110 01101000 4.6471 −0.9216 44.67
01110111 11101111 −0.3333 4.3725 18.84
decode evaluate
10101101 10110011 1.7843 2.0196 −54.22
11011011 11110110 3.5882 4.6471 19.71
11011000 00000001 3.4706 −4.9608 85.84
10011100 00011110 1.1176 −3.8235 −12.54
reproduction
random pairing
a1 01111100 01111110 a2 −0.1209 −0.0466 0.28
b1 01010111 10101011 b2 −1.5527 1.7356 −36.40
c1 11000010 10011100 c2 2.6259 1.1550 − 50.62
d1 10010011 11001111 d2 encode 0.7713 3.1452 − 44.58
e1 10101101 10110011 e2 1.7843 2.0196 − 54.22
f1 11000010 11010010 f2 2.6360 3.2601 −74.73
g1 10101101 10110011 g2 1.7843 2.0196 − 54.22
h1 10100001 01001010 h2 1.3160 −2.0846 − 35.76
crossover/mutuation
a1 01111100 01111110 a2 −0.1373 − 0.0588 0.31
b1' 01000010 10101010 b2' −2.4118 1.6667 − 46.12
c1' 11001101 10011111 c2' 3.0392 1.2353 − 52.96
d1 10010011 11001111 d2 decode 0.7647 3.1176 − 44.73
e1 10101101 10110011 e2 1.7843 2.0196 − 54.22
f1' 11010111 11010011 f2' 3.4314 3.2745 − 69.94
g1' 10100010 10110000 g2' 1.3529 1.9020 − 43.50
h1 10100001 01001010 h2 1.3137 − 2.0980 − 35.88
Figure 7.9 Reproduction/crossover mutation in one iteration of genetic algorithm.
and is summarized in the box below. The reproduction/crossover process is illus-
trated in Fig 7.9. This algorithm is cast into the routine “genetic()”and we
append the following statements to the MATLAB program “nm717.m”in order
to apply the routine for minimizing the function defined by Eq. (7.1.25). Inter-
ested readers are welcome to run the program with these statements appended
and compare the result with those of using other routines. Note that like the
simulated annealing, the routine based on the idea of GA cannot always suc-
ceed and its success/failure depends partially on the initial guess and partially
on luck.