Professional Documents
Culture Documents
net/publication/312087041
CITATION READS
1 1,613
1 author:
Abdellatif Baba
Türk Hava Kurumu Üniversitesi
100 PUBLICATIONS 37 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Genetic algorithm-based technique for predicting future generations of hazelnuts chromosomes. View project
Modeling, identification, and control of 2 DoF robot arm as a prelude study to mimic insects locomotion View project
All content following this page was uploaded by Abdellatif Baba on 05 January 2017.
12/6/2016 ababa@thk.edu.tr 1
Genetic Algo.
• A class of probabilistic optimization algorithms
• Inspired by the biological evolution process
• Uses concepts of "Natural Selection" and "Genetic
Inheritance" (Darwin 1859)
• Originally developed by John Holland (1975)
• Particularly well suited for hard problems where only
a little is known about the underlying search space
• Widely-used in business, science and engineering
12/6/2016 ababa@thk.edu.tr 2
Classes of Search Techniques
Search Techniques
Genetic Genetic
Programming Algorithm
Introduction to Genetic Algorithms 3
The main idea
A Genetic Algorithm maintains a population of candidate solutions for the
problem at hand
And
Makes it evolve by iteratively applying a set of stochastic operators
12/6/2016 ababa@thk.edu.tr 5
GA. Principal Conceptions
Let’s study a simple Example will help us to understand how a GA works.
Let us find the maximum value of the function where parameter x varies
between 0 and 15.
For simplicity, we may assume that x takes only integer values.
Thus, chromosomes can be built with only four genes:
𝐶ℎ𝑟𝑜𝑚𝐹𝑖𝑡𝑛𝑒𝑠𝑠
𝑁
1 𝐶ℎ𝑟𝑜𝑚𝐹𝑖𝑡𝑛𝑒𝑠𝑠
The average fitness of the initial population is 36. In order to improve it, the initial
population is modified by using selection, crossover and mutation, the genetic operators.
12/6/2016 ababa@thk.edu.tr 7
GA. Principal Conceptions
Example 1
Note : the size of the chromosome population remains unchanged from
one generation to the next.
But how can we maintain the size of the population constant, and at the
same time improve its average fitness?
12/6/2016 ababa@thk.edu.tr 8
Example 1
Selection:
In our example, we have an initial
population of six chromosomes. Thus,
to establish the same population in the
next generation, the roulette wheel
would be spun six times.
Crossover:
The crossover operator randomly
chooses a crossover point where two
parent chromosomes ‘break’, and then
exchanges the chromosome parts after
that point. As a result, two new
offspring are created. For example,
the chromosomes X6 and X2 could be
crossed over after the second gene in
each to produce the two offspring, as
shown in Figure
12/6/2016 ababa@thk.edu.tr 10
Example 1
Crossover:
• If a pair of chromosomes does not
cross over, then chromosome
cloning takes place.
• A value of 0.7 for the crossover
probability (Pc) generally produces
good results.
• After selection and crossover, the
average fitness of the chromosome
population has improved and gone
from 36 to 42.
12/6/2016 ababa@thk.edu.tr 11
Example 1
Mutation:
12/6/2016 ababa@thk.edu.tr 12
Example 1
Mutation:
• To guarantee that the search algorithm
is not trapped on a local optimum (The
sequence of selection and crossover operations
may stagnate at any homogeneous set of
solutions. Thus all chromosomes are identical,
and thus the average fitness of the population
cannot be improved)
Note:
GAs assure the continuous improvement of the average fitness of the population, and
after a number of generations (typically several hundred) the population evolves to a
near-optimal solution.
In our example, the final population would consist of only chromosomes 0111 and 1000.
12/6/2016 ababa@thk.edu.tr 14
The algorithm
• Step 1:
1. Represent the problem variable domain as a chromosome of a fixed length,
2. Initialize the size of a chromosome population N, the crossover probability Pc
and the mutation probability Pm.
• Step 2: Define a fitness function to measure the performance, or fitness, of an
individual chromosome in the problem domain.
• Step 3: Randomly generate an initial population of chromosomes of size N
• Step 4: Calculate the fitness of each individual chromosome
• Step 5: Select a pair of chromosomes for mating from the current population. Parent
chromosomes are selected with a probability related to their fitness. (Roulette wheel
selection)
• Step 6: Create a pair of offspring chromosomes by applying the stochastic
operators – crossover and mutation.
• Step 7: Place the created offspring chromosomes in the new population.
• Step 8: Repeat Step 5 until the size of the new chromosome population becomes
equal to the size of the initial population, N.
12/6/2016 ababa@thk.edu.tr 15
The algorithm
12/6/2016 ababa@thk.edu.tr 16
Example 2
In this example suppose it is desired to find the maximum of the "peak" function of
two variables. Where parameters x and y vary between -3 and 3
• Then, we choose the size of the chromosome population, for instance 6, and
randomly generate an initial population.
• The next step is to calculate the fitness of each chromosome. This is done for this
example in two stages.
1. First, a chromosome is decoded by converting it into two real numbers, x and y, in
the interval between -3 and 3.
2. Then the decoded values of x and y are substituted into the "peak" function.
12/6/2016 ababa@thk.edu.tr 17
Example 2
First, a chromosome, that is a string of 16 bits, is partitioned into two 8-bit strings:
x y
Then these strings are converted from binary (base 2) to decimal (base 10):
12/6/2016 ababa@thk.edu.tr 18
Example 2
Now the range of integers that can be handled by 8 bits, that is the range from 0 to 255,
is mapped to the actual range of parameters x and y, that is the range from -3 to 3:
To obtain the actual values of x and y, we multiply their decimal values by 0.0235294
and subtract 3 from the results:
12/6/2016 ababa@thk.edu.tr 19
Example 2
Chromosome locations on the surface and contour plot of the ‘peak’ function: (a) initial
population; (b) first generation; (c) local maximum solution; (d) global maximum solution
12/6/2016 ababa@thk.edu.tr 20
Example 2
12/6/2016 ababa@thk.edu.tr 21
Case Study : maintenance scheduling with genetic algorithms
Power system components are made to operate continuously throughout their life by
means of preventive maintenance. The purpose of maintenance scheduling is to find the
sequence of outages of power units over a given period of time (normally a year) such that
the security of a power system is maximised.
• Any outage in a power system is associated with some loss in security. The security
margin is determined by the system’s net reserve.
• The net reserve, is defined as "the total installed generating capacity of the system
minus the power lost due to a scheduled outage and minus the maximum load forecast
during the maintenance period." For Example: If we assume that the total installed
capacity is 150MW and a unit of 20MW is scheduled for maintenance during the period
when the maximum load is predicted to be 100MW, then the net reserve will be 30MW.
Conclusion; the maintenance scheduling must ensure that sufficient net reserve is provided
for secure power supply during any maintenance period.
Suppose, there are seven power units to be maintained in four equal intervals. The
maximum loads expected during these intervals are 80, 90, 65 and 70MW. The unit
capacities and their maintenance requirements are presented in the following table:
12/6/2016 ababa@thk.edu.tr 22
Case Study : maintenance scheduling with genetic algorithms
The idea:
Assigning to each unit a binary number and to let the chromosome be a sequence
of these binary numbers.
As we have 4 maintenance intervals the unit schedule can be easily represented as
a 4-bit string.
If a unit is to be maintained in a particular interval, the corresponding bit assumes
value 1.
Example: the string 0100 presents a schedule for a unit to be maintained in the
second interval. It also shows that the number of intervals required for
maintenance of this unit is equal to 1.
12/6/2016 ababa@thk.edu.tr 24
Case Study : maintenance scheduling with genetic algorithms
Traditionally, each gene is represented by only 1 bit and cannot be broken into smaller
elements.
• Crossover and mutation operators could create binary strings that call for
maintaining some units more than once and others not at all.
• They could call for maintenance periods that would exceed the number of intervals
really required for unit maintenance.
Solution
The GA can now create an initial population of chromosomes by filling seven gene
chromosomes with genes randomly selected from the corresponding pools
12/6/2016 ababa@thk.edu.tr 26
Case Study : maintenance scheduling with genetic algorithms
Fitness function
The evaluation of a chromosome starts with the sum of capacities
of the units scheduled for maintenance at each interval
12/6/2016 ababa@thk.edu.tr 27
Case Study : maintenance scheduling with genetic algorithms
Fitness function Then these values are subtracted from the total installed capacity of
the power system (in our case, 150MW):
And finally, by subtracting the maximum loads expected at each interval, we obtain the
respective net reserves:
Since all the results are positive, this chromosome does not violate any constraint, and
thus represents a legal schedule.
The chromosome’s fitness is determined as the lowest of the net reserves (20)
12/6/2016 ababa@thk.edu.tr 28
Case Study : maintenance scheduling with genetic algorithms
Crossover and mutation
12/6/2016 ababa@thk.edu.tr 29
To conclude
A typical process of the GA development includes the following
steps:
A larger population can achieve better solutions than a smaller one, but will
work more slowly. In fact, the most effective population size depends on the
problem being solved.
12/6/2016 ababa@thk.edu.tr 31
View publication stats