GSM Ga
GSM Ga
• Real-valued
• Integer
• Permutatio
n
GA REQUIREMENTS
• Objective function - Genetic representation - Genetic operator
• Process
• Each individual is assessed via fitness function – higher
fitness better the solution
• Based on their fitness, parents are selected to reproduce
offspring for a new generation
• Fitter individuals have more chance to reproduce
• New generation has same size as old generation – old gen
dies
• Offspring has combination of properties of two parents
• If well designed, population converges to optimal solution
POPULATION REQUIREMENTS
• Population initialization
• Random initialization
• Heuristic initialisation
• Population models
• Steady state
• Generational
OUTLINE OF GA
1. Algorithm begins by creating a random initial population.
2. Create a sequence of new populations. At each step, the algorithm uses the individuals in the
current generation to create the next population. To create the new population, the algorithm
performs the following steps:
1. Scores each member of the current population by computing its fitness value. These
values are called the raw fitness scores.
2. Scales the raw fitness scores to convert them into a more usable range of values. These
scaled values are called expectation values.
3. Selects members, called parents, based on their expectation.
4. Some of the individuals in the current population that have lower fitness are chosen
as elite. These elite individuals are passed to the next population.
5. Produces children from the parents. Children are produced either by making random
changes to a single parent—mutation—or by combining the vector entries of a pair of
parents—crossover.
6. Replaces the current population with the children to form the next generation.
3. The algorithm stops when one of the stopping criteria is met
4. The algorithm takes modified steps for linear and integer constraints.
5. The algorithm is further modified for nonlinear constraints.
KEY CONCEPTS OF GA
• Chromosome
• A possible solution (usually a string or array)
• Gene
• A part of a chromosome (e.g., a number or character)
• Fitness Function
• A function to evaluate how good a solution is
• Population
• A group of chromosomes
• Generation
• One cycle of selection, crossover, and mutation
• Individual
• An individual is any point to which you can apply the fitness
function. The value of the fitness function for an individual is
POPULATION
• an array of individuals.
• Ex. if size of population is 100, number of variables in the
fitness function is 3, you represent the population by a 100-
by-3 matrix.
• Sampling without Replacement
• Sampling with Replacement
• After selecting an individual, return them to population before
the next draw. So, same individual is selected multiple times
• Same individual appears more than once in the population.
• At each iteration, GA performs a series of computations on
the current population to produce a new population. Each
successive population is called a new generation.
• Suppose your population is [A, B, C], and you sample 3 times with replacement. A
possible sample could be [A, A, B]
POPULATION - DIVERSITY
• It's possible that the same solution (individual) appears
more than once in the population if:
• It was selected multiple times for reproduction.
• It survived multiple generations.
• There’s a lack of diversity or poor mutation/crossover
parameters.
• 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.
POPULATION MIGRATION
• Migration options specify how individuals move between
subpopulations.
• Migration occurs if PopulationSize is set as a vector of length > 1.
• When migration occurs, the best individuals from one
subpopulation replace the worst individuals in another
subpopulation.
• Individuals that migrate from one subpopulation to another are
copied. They are not removed from the source subpopulation.
• Migration Direction, Migration Interval, Migration
Fraction
CREATING THE NEXT
GENERATION
• At each step, the genetic algorithm uses the current population to
create the children that make up the next generation.
• The algorithm selects a group of individuals in the current
population, called parents, who contribute their genes—the entries
of their vectors—to their children.
• The algorithm usually selects individuals that have better fitness
values as parents.
SELECTION
• The process that determines which solutions are to be
preserved and allowed to reproduce and which ones
deserve to die out.
• The primary objective of the selection operator is to
emphasize the good solutions and eliminate the bad
solutions in a population while keeping the population
size constant.
• The crossover operator is used to create new solutions from the existing
solutions available in the mating pool after applying selection operator.
This operator exchanges the gene information between the solutions in
the mating pool.
ENCODING FOR CROSSOVER
• The process of representing a solution in the form of a string that conveys
the necessary information. Just as in a chromosome, each gene controls a
particular characteristic of the individual, similarly, each bit in the string
represents a characteristic of the solution. Most common method of
encoding is binary coded. Chromosomes are strings of 1 and 0 and each
position in the chromosome represents a particular characteristic of the
problem.
• Chromosomes
are strings of 1
and 0 and each
position in the
chromosome
represents a
particular
characteristic
of the problem.
CROSSOVER OPERATOR
• The most popular crossover
selects any two solutions
strings randomly from the
mating pool and some
portion of the strings is
exchanged between the
strings.
• The selection point is
selected randomly
• A probability of crossover is
also introduced in order to
give freedom to an
individual solution string to
determine whether the
solution would go for
crossover or not.
BINARY CROSSOVER
TYPES OF CROSSOVER
• Single point crossover
• Two point crossover - Two random points are chosen
• Multi point crossover
• Uniform crossover
• Matrix crossover
• Inversion
• Order 1 crossover
• Deletion
• Deletion and duplication, Deletion and regeneration
SINGLE POINT CROSSOVER
• A random
point is chosen
on individual
chromosome
and genetic
material is
exchanged at
this point
TWO-POINT CROSSOVER
• Two random points
are chosen on
individual
chromosomes and
genetic material is
exchanged at this
point
• Avoids cases where
genes at the
beginning and end
of a chromosome
are always split
• Even number of cross
sites
• Odd number of cross
sites
MULTIPOINT
CROSSOVER
UNIFORM CROSSOVER
MATRIX CROSSOVER
CROSSOVER - INVERSION
ORDER 1 CROSSOVER
CROSSOVER - DELETION
MUTATION OPERATOR
• Mutation is the occasional introduction of new features in
to the solution strings of the population pool to maintain
diversity in the population.
BINARY MUTATION
• Mutation operator changes a 1 to 0 or vise versa, with a
mutation probability
• The mutation probability is generally kept low for steady
convergence.
OTHER MUTATION
OPERATORS
• Binary
• Flip bitwise
• Random
resetting
• Swap
• Scramble
• Inversion
GA SURVIVOR SELECTION
• Elitist selection:
• Choose only the most fit members of each
generation.
• Cutoff selection:
• Select only those that are above a certain cutoff for
the target function.
• Age based Selection
• Fitness based Selection
ELITISM
• Crossover and mutation may destroy the best solution of
the population pool
• Elitism is the preservation of few best solutions of the
population pool
• Elitism is defined in percentage or in number
TYPES OF CHILDREN
Elite children are individuals in
current generation with best
fitness values. These
individuals automatically
survive to next generation.
Crossover children are
created by combining the
vectors of a pair of
parents.
Mutation children are
created by introducing
random changes, or
mutations, to a single
AGE BASED SELECTION
FITNESS BASED SELECTION
OVERALL PROCESS OF GA
STOPPING CRITERIA
•MaxGenerations —maximum number of iterations
•MaxTime —maximum time
•FitnessLimit —if the best fitness value is < = value
of FitnessLimit.
•MaxStallGenerations —if the avg. relative change in best
fitness function value over MaxStallGenerations is < =
FunctionTolerance.
•MaxStallTime —if there is no improvement in the best
fitness value for an interval of time
•FunctionTolerance —average relative change in best fitness
function value over MaxStallGenerations is