Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Chapter 3: Introduction Ga: I. Objective

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

CHAPTER 3: INTRODUCTION GA

I. OBJECTIVE
What is Genetic Algorithm? Genetic Algorithm or in short GA is a stochastic algorithm
based on principles of natural selection and genetics. Genetic Algorithms (GAs) are a
stochastic global search method that mimics the process of natural evolution. Genetic
Algorithms have been shown to be capable of locating high performance areas in
complex domains without experiencing the difficulties associated with high
dimensionality or false optima as may occur with gradient decent techniques. Using
genetic algorithms to perform the tuning of the controller will result in the optimum
controller being evaluated for the system every time.
CHAPTER 4: GENETIC ALGORITHM

I. Introduction
Genetic Algorithms (GA’s) are a stochastic global search method that mimics the process
of natural evolution. It is one of the methods used for optimization. John Holland
formally introduced this method in the United States in the 1970 at the University of
Michigan. The continuing performance improvements of computational systems has
made them attractive for some types of optimezation. The genetic algorithm starts with
no knowledge of the correct solution and depends entirely on responses from its
environment and evolution operators such as reproduction, crossover and mutation to
arrive at the best solution. By starting at several independent points and searching in
parallel, the algorithm avoids local minima and converging to sub optimal solutions. In
this way, GAs have been shown to be capable of locating high performance areas in
complex domains without experiencing the difficulties associated with high
dimensionality, as may occur with gradient decent techniques or methods that rely on
derivative information [2].

II. Characteristics of Genetic Algorithm


Genetic Algorithms are search and optimization techniques inspired by two biological
principles namely the process of “natural selection” and the mechanics of “natural
genetics”. GAs manipulates not just one potential solution to a problem but a collection
of potential solutions. This is known as population. The potential solution in the
population is called “chromosomes”. These chromosomes are the encoded
representations of all the parameters of the solution. Each chromosome is compared to
other chromosomes in the population and awarded fitness rating that indicates how
successful this chromosome to the latter. To encode better solutions, the GA will use
“genetic operators” or “evolution operators” such as crossover and mutation for the
creation of new chromosomes from the existing ones in the population. This is achieved
by either merging the existing ones in the population or by modifying an existing
chromosome. The selection mechanism for parent chromosomes takes the fitness of the
parent into account. This will ensure that the better solution will have a higher chance to
procreate and donate their beneficial characteristic to their offspring. A genetic algorithm
is typically initialized with a random population consisting of between 20-100
individuals. This population or also known as mating pool is usually represented by a
real-valued number or a binary string called a chromosome. For illustrative purposes, the
rest of this section represents each chromosome as a binary string. How well an
individual performs a task is measured and assessed by the objective function. The
objective function assigns each individual a corresponding number called its fitness. The
fitness of each chromosome is assessed and a survival of the fittest strategy is applied. In
this project, the magnitude of the error will be used to assess the fitness of each
chromosome. There are three main stages of a genetic algorithm, these are known as
reproduction, crossover and mutation. This will be explained in details in the following
section.

III. Population Size


Determining the number of population is the one of the important step in GA. There are
many research papers that dwell in the subject. Many theories have been documented and
experiments recorded [7]. However, the matter of the fact is that more and more theories
and experiments are conducted and tested and there is no fast and thumb rule with
regards to which is the best method to adopt. For a long time, the decision on the
population size is based on trial and error [6]. In this project the approach in determining
the population is rather unsciencetific. From my reading of various papers, it suggested
that the safe population size is from 30 to 100. In this project an initial population of 20
were used and the result observed. The result was not promising. Hence an initiative of
40, 60, 80 and 90 sizing of population were experimented. It was observed that the
population of 80 seems to be a good guess. Population of 90 and above does not result in
any further optimization.
IV. Reproduction
During the reproduction phase the fitness value of each chromosome is assessed. This
value is used in the selection process to provide bias towards fitter individuals. Just like
in natural evolution, a fit chromosome has a higher probability of being selected for
reproduction. An example of a common selection technique is the ‘Roulette Wheel’
selection method as shown in Figure 2. Each individual in the population is allocated a
section of a roulette wheel. The size of the section is proportional to the fitness of the
individual. A pointer is spun and the individual to whom it points is selected. This
continues until the selection criterion has been met. The probability of an individual
being selected is thus related to its fitness, ensuring that fitter individuals are more likely
to leave offspring. Multiple copies of the same string may be selected for reproduction
and the fitter strings should begin to dominate. However, for the situation illustrated in
Figure 8, it is not implausible for the weakest string (01001) to dominate the selection
process.

Figure 1. Depiction of roulette wheel selection

There are a number of other selection methods available and it is up to the user to select
the appropriate one for each process. All selection methods are based on the same
principal that is giving fitter chromosomes a larger probability of selection.
V. Crossover
Once the selection process is completed, the crossover algorithm is initiated. The
crossover operations swaps certain parts of the two selected strings in a bid to capture the
good parts of old chromosomes and create better new ones. Genetic operators manipulate
the characters of a chromosome directly, using the assumption that certain individual’s
gene codes, on average, produce fitter individuals. The crossover probability indicates
how often crossover is performed. A probability of 0% means that the ‘offspring’ will be
exact replicas of their ‘parents’ and a probability of 100% means that each generation
will be composed of entirely new offspring. The simplest crossover technique is the
Single Point Crossover.

There are two stages involved in single point crossover:

1. Members of the newly reproduced strings in the mating pool are

‘mated’ (paired) at random.

2. Each pair of strings undergoes a crossover as follows: An

integer k is randomly selected between one and the length of

the string less one, [l,L-l]. Swapping all the characters

between positions k+1 and L inclusively creates two new

strings.

Example: If the strings lOOOO and OlllO are selected for crossover and the
value of k is randomly set to 3 then the newly created strings will be lOOlO
and OllOO as shown in Figure 2.

Figure 2. Illustration of Crossover.


More complex crossover techniques exist in the form of Multi-point and Uniform
Crossover Algorithms. In Multi-point crossover, it is an extension of the single point
crossover algorithm and operates on the principle that the parts of a chromosome that
contribute most to its fitness might not be adjacent. There are three main stages involved
in a Multi-point crossover.

1. Members of the newly reproduced strings in the mating pool are ‘mated’
(paired) at random.

2. Multiple positions are selected randomly with no duplicates and sorted


into ascending order.
3. The bits between successive crossover points are exchanged to produce
new offspring.
Example: If the string lllll and OOOOO were selected for crossover and the multipoint
crossover positions were selected to be 2 and 4 then the newly created strings will be
llOOl and OOllO as shown in Figure 3.

Figure 3. Illustration of Multi-Point Crossover.

VI. Mutation
Using selection and crossover on their own will generate a large amount of different
strings. However there are two main problems with this:

1. Depending on the initial population chosen, there may not be enough diversity in
the initial strings to ensure the Genetic Algorithm searches the entire problem space.

2. The Genetic Algorithm may converge on sub-optimum strings due to a bad choice
of initial population.

These problems may be overcome by the introduction of a mutation operator into the
Genetic Algorithm. Mutation is the occasional random alteration of a value of a string
position. It is considered a background operator in the genetic algorithm The probability
of mutation is normally low because a high mutation rate would destroy fit strings and
degenerate the genetic algorithm into a random search.

Mutation probability values of around 0.1% or 0.01% are common, these values 55
represent the probability that a certain string will be selected for mutation i.e. for a
probability of 0.1%; one string in one thousand will be selected for mutation. Once a
string is selected for mutation, a randomly chosen element of the string is changed or
‘mutated’. For example, if the GA chooses bit position 4 for

mutation in the binary string lOOOO, the resulting string is lOOlO as the fourth bit in the
string is flipped as shown in Figure 4.

Figure 4. Illustration of Mutation Operation

You might also like