Professional Documents
Culture Documents
3 - Introduction To Genetic Algorithm
3 - Introduction To Genetic Algorithm
1 Selection Methods
b. Rank Selection
The previous type of selection will have problems when they are big differences
between the fitness values. For example, if the best chromosome fitness is 90% of
the sum of all fitnesses then the other chromosomes will have very few chances to be
selected. Rank selection ranks the population first and then every chromosome
receives fitness value determined by this ranking. The worst will have the fitness 1,
the second worst will have the fitness 2 etc. and the best will have the fitness PopSize
(number of chromosomes in population). The following picture describes how the
situation changes after changing fitness to the numbers determined by the ranking.
c. Steady-State Selection
This is not a particular method of selecting parents. The main idea of this type of
selection is that a big part of chromosomes can survive to next generation. The
steady-state selection GA works in the following way. In every generation a few
good (with higher fitness) chromosomes are selected for creating new offspring.
Then some bad (with lower fitness) chromosomes are removed and the new offspring
is placed in their place. The rest of population survives to new generation (Obitko,
1998).
d. Elitism
When creating a new population by crossover and mutation, we have a big chance,
that we will loose the best chromosome. Elitism is the name of the method that first
copies the best chromosome (or few best chromosomes) to the new population. The
rest of the population is constructed in ways described above. Elitism can rapidly
increase the performance of GA, because it prevents a loss of the best found solution
(Obitko, 1998).
2 Crossover
Parent B: 1 0 1 1 1 0 0 0 segment of B
Offspring 1 0 1 1 1 1 0 0 0
Offspring 2 1 0 1 0 1 0 1 1
Figure 5 : One point crossover
Offspring 0 1 1 1 1 0 1 1
Figure 6 : Two point crossover
From two point crossover, one can imagine three point crossover, four point,
five point, and so on. The logical conclusion of this is uniform crossover. In
uniform crossover, each symbol in the offspring’s chromosome is chosen randomly
to be equal to the corresponding symbol of the chromosome of either Parent A or
Parent B as shown in Figure 7.
Offspring 0 0 1 0 1 0 0 1
Figure 7 : Uniform crossover
For PMX operator, firstly we randomly select two cut points on both parents.
In order to create offspring, the substring between the two cut points in the first
parent replaces the corresponding substring in the second parent. Then, the inverse
replacement is applied outside of the cut points, in order to eliminate duplicates and
recover all cities. In Figure 8, the offspring is created by first replacing the subset {2,
3, 6} in parent 2 by the subset {5, 6, 4}. Hence, city 5 replaces city 2, city 6 replaces
city 3, and city 4 replaces city 6 (step 1). Since cities 4 and 6 are now duplicated in
the offspring, the inverse replacement is applied outside of the cut points. Namely,
city 2 replaces city 5, and city 3 replaces city 4 (step 2). In the latter case, city 6 first
replaces city 4, but since city 6 is already found in the offspring at position 4, city 3
finally replaces city 6. Multiple replacements at a given position occur when a city is
located between the two cut points on both parents, like city 6 in this example.
Parent 1 : 1 2 │ 5 6 4 │ 3 8 7
Parent 2 : 1 4 │ 2 3 6 │ 5 7 8
Offspring:
Step 1 : 1 4 │ 5 6 4 │ 5 7 8
Step 2 : 1 3 │ 5 6 4 │ 2 7 8
The cycle crossover focuses on subsets of cities that occupy the same subset
of positions in both parents. Then, these cities are copied from the first parent to the
offspring (at the same positions), and the remaining positions are filled with the cities
of the second parent. In this way, the position of each city is inherited from one of
the two parents. However, many edges can be broken in the process, because the
initial subset of cities is not necessarily located at consecutive positions in the parent
tours. In Figure 9, the subset of cities {3, 4, 6} occupies the subset of positions {2, 4 ,
5} in both parents. Hence, an offspring is created by filling the positions 2, 4 and 5
with the cities found in parent 1, and by filling the remaining positions with the cities
found in parent 2.
Parent 1 : 1 3 5 6 4 2 8 7
Parent 2 : 1 4 2 3 6 5 7 8
Offspring: 1 3 2 6 4 5 7 8
Figure 9 : Cycle crossover
Parent 1 : 1 2 │ 5 6 4 3 8 7
Parent 2 : 1 4 │ 2 3 6 5 7 8
Offspring: 1 2 4 3 6 5 7 8
Figure 10 : Modified crossover
Parent 1 : 1 2 │ 5 6 4 │ 3 8 7
Parent 2 : 1 4 │ 2 3 6 │ 5 7 8
Offspring (step 1): - - 5 6 4 - - -
Offspring (step 2): 2 3 5 6 4 7 8 1
This crossover focuses on the relative order of the cities on the parent
chromosomes. First, a subset of cities is selected from the first parent. In the
offspring, these cities appear in the same order as in the first parent, but at positions
taken from the second parent. Then, the remaining positions are filled with the cities
of the second parent. In Figure 12, cities 5, 4 and 3 are first selected in parent 1, and
must appear in this order in the offspring. These cities occupy positions 2, 4 and 6,
Parent 1 : 1 2 5 6 4 3 8 7
Parent 2 : 1 4 2 3 6 5 7 8
Offspring: 1 5 2 4 6 3 7 8
Here, a subset of positions is selected in the first parent. Then, the cities
found at these positions are copied to the offspring (at the same positions). The other
positions are filled with the remaining cities, in the same relative order as in the
second parent. The name of this operator is rather misleading, because it is the
relative order of the cities that is inherited from the parents (the absolute position of
the cities inherited from the second parent are rarely preserved). This operator can
be seen as an extension of the order crossover, where the cities inherited from the
first parent do not necessarily occupy the consecutive positions. In Figure 13,
position 3, 5 and 6 are first selected in parent 1. Cities 5, 4 and 3 are found at these
positions, and occupy the same positions in the offspring. The other positions are
filled one by one, starting at position 1, by inserting the remaining cities according to
their relative order in parent 2, namely the set {1, 2, 6, 7, 8}.
Parent 1 : 1 2 5 6 4 3 8 7
Parent 2 : 1 4 2 3 6 5 7 8
Offspring: 1 2 5 6 4 3 7 8
Another mutation operators are 2-opt, 3-opt and Or-opt. In the 2-opt operator,
two edges (a, b) and (c, d) are randomly selected from the tour and check if we can
connect these four nodes in a different manner that will give a lower cost. To do this
check if cab + ccd > cac + cdb. If this is the case, replace the edges (a, b) and (c, d)
with the edges (a, c) and (d, b). Note that it is assumed that a, b, c and d appear in
The Or-opt operator is similar to the 3-opt. A set of connected nodes are
randomly chosen and checking is made if the string can be inserted between two
other connected nodes to give a reduced cost. We can calculate this by finding the
total cost of the edges being inserted and the total cost of the edges being removed.
If the cost of the edges being removed is greater than the cost of those being inserted
the switch is made (Bryant, 2000).
It has long been acknowledged that the choice of operator settings has a
significant impact upon GA performance. These settings come in the form of
components and parameters such as chromosome representation, population sizes,
crossover and mutation operators, crossover and mutation probability, replacement
techniques, etc. However, finding a good choice is somewhat of a black art. The
most commonly used method is empirically through hand tuning. This is where the
GA’s settings are determined by first experimenting with a selection of combinations
of settings and then selecting the combination that gives the best results.
The crossover and mutation operators are considered to be two of the main
conduits by which to control exploration and exploitation of the search space of GA.
This is partly why most of the work performed on finding good configurations for a
GA consists of keeping the other settings constant and just looking for good operator
rates. In one of earliest works of variation of settings in a GA, Davis (1989) suggests
the division of operators into two categories based on the roles they play. In the first
category are those operators that directly improve a chromosome, while in the second
category, operators that set the stage for such improvement.
While classic GAs employ the use of settings that remain static throughout its
application run, some existing work was found that indicated that by varying these
settings appropriately during the GA’s application, improvements can be made to
overall performance of the GA in terms of both solution quality and the amount of
time required to find it. The adaptive variation approach, also known as online
approach (Spears, 1995) involves the utilization of information gained about the state
of the GA during the run of the GA, which may consist of information about the
population as a whole, individuals in the population or components of the GA, to
adaptively vary its settings there.