Title: Genetic Algorithm and its applications
1Genetic Algorithm andits applications
2INTRODUCTION
- Looking at the world around us, we see a
staggering diversity of life. - There are millions of species, each with its own
unique behavior patterns and characteristics and
yet, all of these plants and creatures have
evolved, and continue evolving, over millions of
years
3- They have adapted themselves to a constantly
shifting and changing environment in order to
survive. - The weaker members of a species tend to die away,
leaving the stronger and fitter to mate, create
offspring and ensure the continuing survival of
the species.
4- The laws of natural selection and Darwinian
evolution dictate their lives, and it is upon
these ideas that Genetic Algorithm is based. -
5Genetic Algorithm
- Genetic Algorithm starts with a population of
randomly generated solutions, chromosomes, and
advance toward better solutions by applying
genetic operators, modeled on the genetic
processes occurring in nature.
6- In these algorithms, we maintain a population of
solutions for a given problem. - This population undergoes evolution in a form of
natural selection.
7- In each generation, relatively good solutions are
reproduced to give offspring that replace the
relatively bad solutions, which die. - An evaluation of fitness function plays the role
of the environment to distinguish between good
and bad solutions.
8- Although there are many possible variants of the
basic Genetic Algorithm. - But, the fundamental mechanism operates on a
population of chromosomes (representing possible
solutions to the problem).
9- Genetic Algorithm is one of the stochastic search
algorithms based on the mechanics of natural
genetics. - A solution variable for the problem is first
represented using artificial chromosomes
(strings).
10- In other words, the problem is encoded to strings
that Genetic Algorithm can handle. - A string represents one search point in the
solution space. - Genetic Algorithm uses a set (population) of
strings (i.e. multiple search points).
11- Therefore, it can be a parallel search method.
- It modifies strings (searching points) using
selection and genetic operators such as crossover
and mutation. - After convergence, strings are decoded to the
original solution variables and the solutions are
obtained.
12- Genetic Algorithm consists of three
operations - Evaluation of individual fitness
- Formation of a gene pool
- Recombination and mutation
13Basic Genetic Algorithm Operations
-
- The three basic operators found in every genetic
algorithm. - Reproduction
- Crossover
- Mutation
- One other GA operator
- Elitism
14- Though some algorithms may not employ the
crossover operator, we refer to them as
evolutionary algorithms rather than Genetic
Algorithm.
15Reproduction
- The reproduction operator allows individual
strings to be copied for possible inclusion in
the next generation. - The chance that a string will be copied is based
on the string's fitness value, calculated from a
fitness function.
16Reproduction
- For each generation, the reproduction operator
chooses strings that are placed into a mating
pool, which is used as the basis for creating the
next generation.
17Example
18- From this table, it is obvious that the string
10000 is the fittest, and should be selected for
reproduction approximately 46 of the time. - 01001 is the weakest, and should only be selected
19 of the time.
19- There are many different types of reproduction
operators. - One always selects the fittest and discards the
worst, statistically selecting the rest of the
mating pool from the remainder of the population.
20- There are hundreds of variants of this scheme.
None are right or wrong and in fact, some will
perform better than others depending on the
problem domain being explored.
21- Common reproduction method is the Roulette Wheel
Method - Chooses the strings in a statistical fashion
based on the fitness values
22- When selecting the three strings that will be
placed in the mating pool, the roulette wheel is
spun three times, with the results indicating the
string to be placed in the pool. - It is obvious from the wheel that there's a good
chance that string 10000 will be selected more
than once.
23- Multiple copies of the same string can exist in
the mating pool. - This is even desirable, since the stronger
strings will begin to dominate, eradicating the
weaker ones from the population. - There are difficulties with this, as it can lead
to premature convergence on a local optimum.
24Crossover
- Once the mating pool is created, the next
operator in the Genetic Algorithm's arsenal comes
into play. - Remember that crossover in biological terms
refers to the blending of chromosomes from the
parents to produce new chromosomes for the
offspring. - The analogy carries over to crossover in Genetic
Algorithm.
25- The Genetic Algorithm selects two strings at
random from the mating pool. - The strings selected may be different or
identical, it does not matter. - The Genetic Algorithm then calculates whether
crossover should take place using a parameter
called the crossover probability. - This is simply a probability value p and is
calculated by flipping a weighted coin. - The value of p is set by the user, and the
suggested value is p0.6, although this value can
be domain dependant.
26- If the Genetic Algorithm decides not to perform
crossover, the two selected strings are simply
copied to the new population (they are not
deleted from the mating pool). - They may be used multiple times during crossover.
- If crossover does take place, then a random
splicing point is chosen in a string. - The two strings are spliced and the spliced
regions are mixed to create two (potentially) new
strings. - These child strings are then placed in the new
population.
27- As an example, say that the strings 10000 and
01110 are selected for crossover and the Genetic
Algorithm decides to mate them. - The Genetic Algorithm selects a splicing point at
bit 3. - The following then occurs
Example
100 00 100 10 011 10 011 00 Crossover in
Action
The newly created strings are 10010 and 01100.
28- Crossover is performed until the new population
is created. -
- Then the cycle starts again with selection.
- This iterative process continues until any user
specified criteria is met (for example, fifty
generations, or a string is found to have a
fitness exceeding a certain threshold)
29Mutation
- Selection and crossover alone can obviously
generate a staggering amount of differing
strings. - However, depending on the initial population
chosen, there may not be enough variety of
strings. - To ensure the Genetic Algorithm sees the entire
problem space or the Genetic Algorithm may find
itself converging on strings that are not quite
close to the optimum level it seeks, due to a bad
initial population.
30- Some of these problems are overcomed by
introducing a mutation operator into the Genetic
Algorithm. - The Genetic Algorithm has a mutation probability,
m, which dictates the frequency at which mutation
occurs. -
- Mutation can be performed either during selection
or crossover (though crossover is more usual).
31- For each string element, in each string in the
mating pool, the Genetic Algorithm checks to see
if it should perform a mutation. -
- If it should, it randomly changes the element
value to a new one. In our binary strings, ls
are changed to 0s and 0s to 1s.
32For example, the Genetic Algorithm decides to
mutate bit position 4 in the string 10000
Example
10000 Mutate 10010
The resulting string is 10010 as the fourth bit
in the string is flipped.
33- The mutation probability should be kept very low
(usually about 0.001). - High mutation rate will destroy fit strings and
degenerate the Genetic Algorithm into a random
walk, with all the associated problems.
34- But mutation will help prevent the population
from stagnating, adding "fresh blood", as it
were, to a population. - It must be taken note that Genetic Algorithm
comes from the fact that it contains a rich set
of strings of great diversity. - Mutation helps to maintain that diversity
throughout the Genetic Algorithm's iterations.
35Elitism
- There is also another important Genetic Algorithm
operation that is called Elitism. -
- When creating a new population by crossover and
mutation, there is a large risk that we might
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.
36- The rest of the population is constructed in ways
described earlier, that are reproduction,
crossover and mutation. -
- Elitism can rapidly increase the performance of
Genetic Algorithm, because it prevents a loss of
the best-found solution.
37Simple Genetic Algorithms Optimization Algorithm
Fitness Value i fi ?f Fitness
Function for String i in the String Population
- Expression of the Fitness Function in a String
Population
38Example Running GA using
y x2
1. Compute all the values in the table.
392. With these selections, our mating pool now
looks like this
403. Finally, the crossover probabilities need to
be calculated (two crossovers need to be
performed to create a new population of two).
41- 4. At the end of the first iteration, our new
population looks like the following
Note these new strings would be added in the
mating pool now for the selection of strings in
the new population set for the next generation
42Traditional Optimization Methods vs. Genetic
Algorithm
- Traditional optimization techniques showing both
their strengths and shortcomings when compared
with GA - Hill Climbing
- Enumerative
- Random Search Algorithms
- Randomized Search Techniques
43Hill Climbing
- Has its roots in the classical mathematics
developed in the 18th and 19th centuries - Finds an optimum by following the local gradient
of the function -
- Advantages
- searches multiple points in the problem space
- Disadvantages
- problem space being searched is continuous in
nature meanwhile the real world problems are not - takes the local optimum in the neighborhood of
the current point
44Enumerative
- Technique is simple
- Finds optimum value in a problem space which is
finite - Disadvantages
- inefficient
- computational task is massive
45Random Search Algorithms
- Performs random walks of the problem space,
recording the best optimum value - Disadvantages
- inefficiency
- does not perform no better than the enumerative
search - does not use any knowledge gained from previous
results and thus are both dumb and blind
46Randomized Search Techniques
- Random choice to guide itself through the problem
search space - Advantages
- not directionless
- knowledge gained from previous results in search,
it combines them with some randomizing features - can handle noisy, multimode search spaces with
some relative efficiency - most popular forms
- Simulated Annealing
- Genetic Algorithm
47Fuzzy with Genetic Algorithm
- Low mutation leads to premature convergence
- Fuzzy generates a proper mutation probability
- Example The air conditioning system
- These 5 values can be input sets for fuzzy
systems that can be used to generate a mutation
probability
very low Low (16 C - 19 C ) low Medium
(23 C) very high High (24 C to 30 C)
high
48Applications of Genetic Algorithm
- There are many applications of Genetic
Algorithms. - The two applications of Genetic Algorithm are
following. - Power Systems
- Computer Networks
49Power Systems
- Minimize power loss
- Whenever a power system network is reconfigured,
there will be some power loss due to reverse of
current or some other external factors. Genetic
Algorithm approach can be used to minimize power
loss.
50- Â Find the best reconfigured network
- - The best-reconfigured network here means
that, this reconfigured network has the most
minimum power loss.
51- Â
- Minimize time when network is reconfigured
- When a network is reconfigured, 200 generations
of networks are produced. And to choose the best
reconfiguration it takes a long time (maybe a few
days to executed or compile the program). So, it
is important to minimize the time taken to
execute the program.
52Computer Networks
- Minimize time delay of packets that are forwarded
- In a normal computer network there will be
some time delay (time taken to reach the
particular node or branch). Genetic Algorithm
approach can be used to minimize the time delay.
53- Find the best reconfigured network
- The best-reconfigured network here means that,
this reconfigured network has the most minimum
time delay.
54- Minimize time when network is reconfigured
- When a network is reconfigured, 200
generations of networks are produced. To choose
the best reconfiguration it takes a long time
(maybe a few days to execute the program). It is
important to minimize time taken to execute the
program.
55The End
56Thank You