You are on page 1of 14

Basics, Terminologies

GENETIC ALGORITHM

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


The genetic algorithm is a method for solving both constrained and unconstrained
optimization problems that is based on natural selection, the process that drives biological
evolution.

The genetic algorithm repeatedly modifies a population of individual solutions.

At each step, the genetic algorithm selects individuals at random from the current
population to be parents and uses them to produce the children for the next generation.

Over successive generations, the population "evolves" toward an optimal solution.

You can apply the genetic algorithm to solve a variety of optimization problems that are
not well suited for standard optimization algorithms, including problems in which the
objective function is discontinuous, non-differentiable, stochastic, or highly nonlinear.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Rules at each step to create the
next generation from the current
population
Selection • Selects the individual called parents
that contribute to population at next
Rules generation

Crossover • Combine two parents to form


Rules children for the next generation.

Mutation • Apply random changes to individual


Rules parents to form children

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Difference Between Classical
and Genetic Algorithm
Genetic Algorithm Classical Algorithm
 Generates a population of  Generates a single point at
points at each iteration. each iteration. The
The best point in the sequence of points
population approaches an approaches an optimal
optimal solution. solution.
 Selects the next population  Selects the next point in
by computation which uses the sequence by
random number deterministic computation.
generators.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Algorithm

The algorithm then


creates a sequence
of new populations.
The algorithm The algorithm stops
At each step, the
begins by creating a when one of the
algorithm uses the
random initial stopping criteria is
individuals in the
population. met.
current generation
to create the next
population.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Steps to create New Population

Some of the
individuals in Produces children
Scores each Scales the the current from the parents. Replaces the
Children are
member of raw fitness Selects population produced either current
the current scores to members, that have by making population
lower fitness random changes
population convert called with the
are chosen as to a single
by them into a parents, elite. These parent— children to
computing more usable based on elite mutation—or by form the
its fitness range of their fitness. combining the next
individuals are vector entries of a
value. values. passed to the pair of parents— generation.
next crossover.
population.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Stopping Conditions for the
Algorithm
Fitness limit — The algorithm
Generations — The algorithm Time limit — The algorithm stops
stops when the value of the
stops when the number of after running for an amount of
fitness function for the best point
generations reaches the value of time in seconds equal to Time
in the current population is less
Generations. limit.
than or equal to Fitness limit.

Stall generations — The Function Tolerance — The


Stall time limit — The algorithm
algorithm stops when the algorithm runs until the weighted
stops if there is no improvement
weighted average change in the average change in the fitness
in the objective function during
fitness function value over Stall function value over Stall
an interval of time in seconds
generations is less than Function generations is less than Function
equal to Stall time limit.
tolerance. tolerance.

Nonlinear constraint tolerance


— The Nonlinear constraint
tolerance is not used as stopping
criterion. It is used to determine
the feasibility with respect to
nonlinear constraints.
GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai
Terminologies

Fitness Function

Individuals

Populations and
Generations

Diversity

Fitness Values and Best


Fitness Values

Parents and Children


GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai
Fitness Function
 The fitness function is the function you want to
optimize. For standard optimization algorithms,
this is known as the objective function.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Individuals
 An individual is any point to which you can apply
the fitness function. The value of the fitness
function for an individual is its score. For
example, if the fitness function is
f (x1, x2, x3)  (2x1 1)2  (3x2 1)2  (x3  2)2
 the vector (2, -3, 1), whose length is the number
of variables in the problem, is an individual. The
score of the individual (2, –3, 1) is f(2, –3, 1) = 51.
 An individual is sometimes referred to as a
genome and the vector entries of an individual as
genes.
GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai
Populations and Generations

 A population is an array of individuals. For


example, if the size of the population is 100
and the number of variables in the fitness
function is 3, we can represent the population
by a 100-by-3 matrix.
 At each iteration, the genetic algorithm
performs a series of computations on the
current population to produce a new
population. Each successive population is
called a new generation.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Diversity

 Diversity refers to the average distance


between individuals in a population. A
population has high diversity if the average
distance is large; otherwise it has low
diversity.
 Diversity is essential to the genetic algorithm
because it enables the algorithm to search a
larger region of the space.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Fitness Values and Best
Fitness Values
 The fitness value of an individual is the value
of the fitness function for that individual.
 If we find the minimum of the fitness
function, the best fitness value for a
population is the smallest fitness value for
any individual in the population.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai


Parents and Children

 To create the next generation, the genetic


algorithm selects certain individuals in the
current population, called parents, and uses
them to create individuals in the next
generation, called children.
 Typically, the algorithm is more likely to
select parents that have better fitness values.

GA by S.Arunachalam, A.P/E.E.E St.Joseph's Chennai

You might also like