When a population converges, the solutions may be local optimal or global
optimal. Although the mutation operation can be used to help the genetic process
escape from local optimums, the escape speed is slow and depends on the mutation
rate. As mentioned above, the gene sets with a larger length will have larger variation.
An escape operator based on this characteristic can easily be designed as fallows. Let
the current gene-set length is m. If the genetic process for the length has converged,
but has not gotten to the assigned number of generations, the gene-set length will be
changed to a value bigger than m. The above escape operator, when used together
with the other genetic operators, will thus cause a large variation to help a population
escape from local optima. The escape operator is performed when the best solutions in
the current population converge. The gene-set crossover and mutation processes are
then run for the enlarged gene-set length for only one generation. After that, it is run
for the original length until the best solutions converge. The gene-set length is then
enlarged again. The above process is repeated until the predefined number of
generations is achieved. The next genetic phase for a half gene-set length then begins.
In addition, from the above theorem, using longer gene sets will cause a
population to produce less offspring. Longer gene sets will thus be allowed larger
mutation rates, thus being able to amend the shortcoming of the generated offspring
due to the longer gene-set size and evolve better solutions. There are thus two
principles for adjusting the mutation rates to be followed. The first one is that the
mutation rate at a longer gene set is larger than that at a smaller one; the second one is
that all the mutation rates can not be set too large to guarantee the performance
becomes poorer than that by the simple GA. In this paper, the proposed algorithm will
simultaneously consider the escape operation and the dynamic mutation rate to
effectively help the escape of local optimums.
The modified gene-set genetic algorithm with the escape operation and dynamic
mutation rates is described below.
The modified gene-set genetic algorithm with dynamic mutation rates:
INPUT: A population size P, a chromosome size n, an initial gene-set length l1, an
enlarged gene-set length l2 for the escape operation, a crossover rate rc, a set
generations in each phase, and two parameters δ and k.
OUTPUT: A nearly optimal solution.
Step 1: Define a suitable chromosome representation with size n for the problem to be
solved.
Step 2: Define a suitable fitness function for evaluating the individuals.
Step 3: Randomly generate a population of P individuals.
Step 4: Set l = l1, where l is used to keep the gene-set length currently being
processed.
Step 5: Set g = 1, where g is used to count the number of generations.
Step 6: Execute the gene-set crossover and mutation operations on the population
using the crossover rate rc and the mutation rate rmt for the gene-set length of
t.
Step 7: Evaluate the fitness value of each individual.
Step 8: Execute the selection mechanism to generate the next population.
Step 9: Set g = g+1.
Step 10: If g < N and the current generation is not (δ, k)-converging, go to Step 6.
Step 11: If g < N and the current generation is (δ, k)-converging, do the escape
operation as follows:
Substep 11-1: Set temp = l, where temp is used to keep the current gene-set
length.
Substep 11-2: Set the gene-set length l = l2.
Substep 11-3: Execute the gene-set crossover and mutation operations on the
population using the crossover rate rc and the mutation rate
rml for the gene-set length l.
Substep 11-4: Set g = g+1.
Substep 11-5: Set l = temp.
Substep 11-6: Go to Step 6.
Step 12: If g = N, set l = l/2.
Step 13: If l < 1, stop the algorithm and output the best chromosome in the current
generation as the result; otherwise, go to Step 5 for the next genetic phase.
After the process of the modified gene-set genetic algorithm with dynamic
mutation rates, a nearly optimal solution to the given problem can be found. Using the
escape operation, the proposed algorithm can help the escape of local optima through
the change of gene-set sizes to a large value. Using dynamic mutation rates, the
proposed algorithm can enlarge the searching region to amend the shortcoming of the
offspring due to large gene-set sizes. It can also cause the escape operator to escape
from local optimums more effectively.
Chapter 9
Experimental Results
This section reports on experiments made to show the performance of the
proposed genetic algorithm. They were implemented in C Language on an AMD K7
2200+ with the Linux OS. Also presented are experiments made to compare the time
required by the proposed genetic algorithm and by the simple genetic algorithm. The
following three problems were used for test:
(A) fA
( ) (
x =−350−x)
2 +500, find the maximum;(B) fB
( ) (
x = x−2.6) (
× −19−x) (
× x+56.5) (
× x−3)
, find the maximum;(C) fC
( )
x = x4×sin(
2xπ)
for 0 < x < 100, find the maximum.The first function is a simple one-peak function with only one local (also global)
optimal solution. The second one has two peaks, and the third one has multiple peaks.
In all the experiments, the chromosome length was 32 and the initial gene-set length
was 4. The termination criterion was the generation number, with each phase being
run for the same number of generations.
Experiments were first made for Function A. The problem could actually be
solved by calculus. It was used here to compare the performance of the modified
approach and the others. The population size was set at 100 and the total generation
number was set at 2100 (each phase had 700 generations). When the mutation rates
were set at 0.06, 0.08, 0.1 and 0.32 respectively for the gene-set length of 1, 2, 4 and
16, the relation between fitness values and generations for Function A is shown in
Figure 8, where SGA represents simple GA, HGSGA represents the gene-set SGA
without the escape operation, HGSGA(m) represents the modified HGSGA with the
escape operation, and HGSGA(m2) represents the modified HGSGA with the escape
operation and dynamic mutation rates.
Population size: 100, Mutation rate: 0.06, Function A
-10000 -8000 -6000 -4000 -2000 0 2000
0 300 600 900 1200 1500 1800 2100 2400
generations
fitness value
HGSGA(m2) HGSGA(m) HGSGA SGA
Figure 8: The fitness values along with different generations for Function A.
It can be observed from Figure 4 that the fitness values by all the four
approaches increased along with the increase of generations. It was quite consistent
with the characteristics of GAs. Besides, the gene-set genetic algorithms performed
better than SGA and the proposed gene-set genetic algorithm with dynamic mutation
rates performs best among the four. It can find the global optimal solution very fast.
The execution time along with generations by the four algorithms for Function A is
shown in Figure 9.
Population size: 100, Mutation rate: 0.06, Function A
0 20 40 60 80 100 120 140
0 350 700 1050 1400 1750 2100
generations
execution time (sec.)
HGSGA(m2) HGSGA(m) HGSGA SGA
It can be seen from Figure 9 that the gene-set genetic algorithms needed less
computational time than SGA. HGSGA(m) could even spend less computational time
than HGSGA due to the escape operations. HGSGA(m2) spent a little more
computational time than HGSGA(m) since the former might generate more offspring
to process. Experiments were then made for showing the relations between fitness
values and termination generations. For mutation rate set at 0.06, the results for
Function A are shown in Figure 10.
Population size: 100, Mutation rate: 0.06, Function A
-12000 -10000 -8000 -6000 -4000 -2000 0 2000
0 300 600 900 1200 1500 1800 2100 2400
termination generations
fitness value
HGSGA(m) HGSGA SGA
Figure 10: The fitness values along with different termination generations for
Function A.
It can be observed from Figure 10 that the fitness values by all the three
algorithms increased along with the increase of termination generations. When the
number of termination generations was small, convergence could not be achieved.
The gene-set genetic algorithms had a worse effect than SGA since the former ran
only 1/3 of total generations for each phase. But along with the number of termination
generations increased, HGSGA and HGSGA(m) generated better fitness values than
SGA. Besides, HGSGA(m) is better than HGSGA. The execution time along with the
number of termination generations for Function A by the three algorithms is shown in
Figure 11.
Population size: 100, Mutation rate: 0.06, Function A
0 20 40 60 80 100 120 140
0 300 600 900 1200 1500 1800 2100 2400
termination generations
execution time (sec.)
HGSGA(m) HGSGA SGA
Figure 11: The execution time along with different termination generations for
Function A.
It can be seen from Figure 7 that HGSGA(m) needed the least computational
time among the three algorithms for different termination generations. Next,
experiments were made to show the effect of the mutation rate on the proposed
algorithm. The genetic process was terminated at 600 generations. The final best
fitness values along with different mutation rates for Function A by the three
algorithms are shown in Figure 12.
Population: 100, Generation: 600, Function A
-12000 -10000 -8000 -6000 -4000 -2000 0 2000
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14
mutation rate
fitness value
HGSGA(m) HGSGA SGA
Figure 12: The fitness values along with different mutation rates for Function A.
It can be observed from Figure 12 that the fitness value increased along with the
increase of the mutation rates when the rates where lets then 0.12. Mutation rates were
thus very important to the final results of the algorithms. From the above experimental
results, the modified approach needed a higher number of generations and a higher
mutation rate to achieve a better performance. Experimental results for Function B are
shown in Figures 13 to 17, which are similar to those for Function A.
Population size: 100, Mutation rate: 0.06, Function B
400000 450000 500000 550000 600000 650000 700000
0 300 600 900 1200 1500 1800 2100 2400
generations
fitness value
HGSGA(m2) HGSGA(m) HGSGA SGA
Figure 13: The fitness values along with different generations for Function B.
Population size: 100, Mutation rate: 0.06, Function B
0 20 40 60 80 100 120 140
0 350 700 1050 1400 1750 2100
generations
execution time (sec.)
HGSGA(m2) HGSGA(m) HGSGA SGA
Figure 14: The execution time along with different generations for Function B
Note that in Figure 13, the gene-set sizes in the HGSGA and HGSGA(m) were
long at the beginning generations, which were regarded as a rough optimization phase.
In this phase, the offspring generated by the two gene-set algorithms lacked delicate
local search but focused on big escape movement. The fitness of HGSGA and
HGSGA(m) was thus worse than that of SGA in this phase. Along with the gene-set
size becoming smaller, the local search in HGSGA and HGSGA(m) were performed
more and more delicately and the escape effect was still better than that in simple GA.
HGSGA(m2) could further amend this shortcoming. It generated more offspring to
help search in the solution space, such that its fitness was better than the other
algorithms in each generation.
Population size: 100, Mutation rate: 0.06, Function B
400000 450000 500000 550000 600000 650000 700000
0 300 600 900 1200 1500 1800 2100 2400
termination generations
fitness value
HGSGA(m) HGSGA SGA
Figure 15: The fitness values along with different termination generations for
Function B.
Population size: 100, Mutation rate: 0.06, Function B
0 20 40 60 80 100 120 140
0 300 600 900 1200 1500 1800 2100 2400
termination generations
execution time (sec.)
HGSGA(m) HGSGA GA
Figure 16: The execution time along with different termination generations for
Function B.
Population size 100, Generations 600, Function B
400000 450000 500000 550000 600000 650000
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14
mutation rate
fitness value
HGSGA(m) HGSGA SGA
Figure 17: The fitness values along with different mutation rates for Function B
At last, experiments were made for Function C, which is a complex multi-peak
function. It has several local optimal solutions. The experimental results are shown in
Figures 18 to 22, where the population size was set at 300. The results are also similar
to those for the other two functions.
Population size: 300, Mutation rate: 0.1, Function C
8.9 9 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
generations
fitness value(e+7)
HGSGA(m2) HGSGA(m) HGSGA SGA
Figure 18: The fitness values along with different generations for Function C.
Population size: 300, Mutation rate: 0.1, Function C
0 50 100 150 200 250
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
generations
execution time (sec.)
HGSGA(m2) HGSGA(m) HGSGA SGA
Figure 19: The execution time along with different generations for Function C
Population size: 300, Mutation rate: 0.1, Function C
7.8 8 8.2 8.4 8.6 8.8 9 9.2 9.4 9.6 9.8
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
termination generations
fitness value(e+7)
HGSGA(m) HGSGA SGA
Figure 20: The fitness values along with different termination generations for
Function C.
Population size: 300, Mutation rate: 0.1, Function C
0 20 40 60 80 100 120 140 160 180
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
termination generations
execution time (sec.)
HGSGA(m) HGSGA SGA
Figure 21: The execution time along with different termination generations for
Function C
Population size 300, Generations 9000, Function C
9 9.1 9.2 9.3 9.4 9.5 9.6 9.7
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14
mutation rate
fitness value (e+7)
HGSGA(m) HGSGA SGA
Figure 22: The fitness values along with different mutation rates for Function C