0% found this document useful (0 votes)
19 views25 pages

Unit III

The document provides an overview of Genetic Algorithms (GAs), highlighting their evolutionary nature and application in optimization problems, particularly in water resources management. It details the processes of creating an initial population, selecting parents, reproduction through crossover and mutation, and establishing termination criteria, emphasizing the importance of user-defined parameters. Additionally, it discusses methods for selection, population diversity, and the balance between selective pressure and diversity in the optimization search process.

Uploaded by

arasupadhmasini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views25 pages

Unit III

The document provides an overview of Genetic Algorithms (GAs), highlighting their evolutionary nature and application in optimization problems, particularly in water resources management. It details the processes of creating an initial population, selecting parents, reproduction through crossover and mutation, and establishing termination criteria, emphasizing the importance of user-defined parameters. Additionally, it discusses methods for selection, population diversity, and the balance between selective pressure and diversity in the optimization search process.

Uploaded by

arasupadhmasini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

UNIT III

Genetic Algorithm
Genetic Algorithm

• One of the best‐known evolutionary algorithms.

• Allows the best individual(s) from a generation to carry over to the next one, was introduced
by De Jong (1975). Other versions are the modified GA (modGA)

• Several authors have implemented the GA in water resources optimization, flood control
systems

• A decision‐making supporting system


Mapping the Genetic Algorithm (GA) to Natural Evolution

• Idea behind the GA is the Darwinian principle of survival of the fittest.

The characteristics of the GA.


Creating an Initial Population

• Each possible solution of the optimization problem generated by the GA is


called a chromosome.

• where X = a possible solution of the optimization problem, xi = ith decision variable


(or gene) of solution X, and N = number of decision variables.

• The population size, or the number of possible solutions, is denoted by M. The population of
generated possible solutions is represented as a matrix of chromosomes of size M × N:
Selection of Parents to Create a New Generation

• Selection in the GA is the procedure by which R (R < M) individuals are chosen from the
population for reproduction.

• The selected individuals are the parents of the next generation and constitute the parent
population.

• There are different methods for selection of the parents.

• The most common methods are proportionate selection, ranking selection, and
tournament selection.
Proportionate Selection

• Proportionate selection the probability of a solution being selected is evaluated as follows

• In which Pk = the probability of solution kth being selected


• F(X) = the fitness function of solution X.
• The probability of selection of each solution is evaluated.
• Each solution k belongs to the parent population with probability Pk.
• Based on the evaluated probabilities, a roulette wheel is made and turned to select
parents.
A roulette wheel is created by calculating a cumulative probability

in which Qj = cumulative probability of the jth solution.


• The selection of R parents following the creation of the roulette wheel is accomplished by
spinning the wheel R times.

• Each spin is tantamount to a generated random number (Rand) in the range [0,1]. If Rand
is less than Q1

• The first solution (X1) is selected; otherwise the jth solution is selected such that
Rand is greater than Qj‐1 and less or equal than Qj (Qj 1 Rand Qj).
Ranking Selection
• Ranking selection ranks all the solutions (also called chromosomes) based on their
fitness values.

• The best solution receives rank 1, and the worst is assigned the lowest rank.

• Solution is by liner function.

• Which Sk = the rank of the kth solution in the population, the term Sk = 1 indicates that
the kth solution is the best solution, and Z = a user‐defined value.
• Alternative approach ranks all the solutions according to their fitness
values.
• Then M − S copies of each solution are generated.
• For example, in a population of ten solutions (M = 10),
• for a solution of rank S = 3, 10 − 3 = 7 copies are made.
Tournament Selection

• The tournament selection Y (Y < M), solutions are randomly selected with the uniform
distribution.
• When applying the uniform distribution, the probability of selecting any solution is the
same.
• The best solution in the selected set is chosen as a parent.

• This process is repeated until all parents are selected.


Population Diversity and Selective Pressure
• Population diversity and selective pressure are important factors in the search process of
the GA.

• These factors are inversely related so that increasing one reduces the other (Whitley,
1989).

• A high selective pressure may lead to premature convergence, while a low selective
pressure may lead to stagnation in the optimization search.
• Proportionate selection gives convergence errors.
• Premature convergence of the GA may occur when the probability P of selecting a solution
is estimated from its fitness function value
• If there are large differences between the fitness values of the solutions of a population.
• Stagnation may occur if there are small differences between the fitness function values of
the solutions
• These scaling functions are employed with proportionate selection and include linear
scaling (Michalewicz, 1996)
• sigma truncation (Michalewicz, 1996)
• power law scaling (Michalewicz, 1996)
• logarithmic scaling (Grefenstette and Baker, 1989)
• exponential scaling (Grefenstette and Baker, 1989)
• Boltzmann selection (Back, 1994
• Ranking selection allows the users to adjust the selective pressure of the
algorithm.
• If Z = 0 (and consequently, U = 1/M), there is no selection pressure.
• In this condition, all individuals have the same probability of selection. The
maximum selective pressure is achieved
• when U = 2/M and Z = 2/(M(M − 1)).
• Large values of Y increase the selective pressure in tournament selection. A
value Y = 2 is commonly used.
Reproduction

• The GA algorithm must generate new solutions to progress toward an optimal


solution.
• The parents make children that constitute the whole or a part of the
next generation.

• The ratio of parents to offspring is a user‐defined parameter.


• Children (offspring) are new solutions from old parent solution.
• R solutions are selected as the population of parents based on their fitness. From this
population parents are randomly selected
• Once more with a crossover probability (PC) that is a user‐defined parameter of the
algorithm.

• A random number Rand from the range [0,1] is generated for each solution in the parent
population.

• If Rand is less than PC, that solution is selected for crossover.

• Not all parent solutions generate children.


• Among the selected parent solutions, some are chosen pairwise with the uniform
distribution to produce offspring.
• This process is called crossover. Offspring or children, which constitute solutions, are
modified by the mutation operator.
Crossover
• Crossover occurs between two parent solutions.
• The crossover operator generates new offspring by exchanging genes between parents.
According to the crossover operation, some decision variables of two solutions are
exchanged.
• (1) one‐point crossover, (2) two‐point crossover, and (3) uniform crossover.
N‐dimensional parent solutions X (x1 ,x2 ,xN ) and X (x1 ,x2 ,xN ), let C denote
the crossover point.

Mutation
• Mutation is important because it introduces new genetic material to a
population.
• The mutation operator replaces randomly some genes of an offspring.
• One or more decision variables of a new solution are replaced with random
values while keeping the values of its other decision variables unaltered.
• Two methods of mutation for real‐valued variables are uniform and
Non uniform mutations.
• Uniform mutation replaces a parent gene with a randomly
generated gene that is within the feasible space of the solutions.

• X (x1 ,x2 ,xi ,xN ) and xi denote a solution (chromosome) and a


gene (decision variable), respectively, where the decision variable
ith (xi) is chosen for mutation.

• Uniform mutation produces a mutated X (x1 ,x2 ,xi ,xN )


whereby xi is evaluated as
• Non uniform mutation induces an increasingly localized search for optimal
solutions in which the sets of genes that are chosen for mutation are defined by
means of boundaries that become narrower as the run of the GA progresses

• In which xi = the new value of xi produced by mutation, xi^ U ( ) = the upper


bound of the ith decision variable
• xi^(L) = the lower bound of the ith decision variable, and Rnd(a,b) = a random
value chosen from the feasible range [a,b].
• X (x1 ,x2 ,xi ,xN ) be a solution of an optimization problem and its ith decision variable
(xi) be selected for mutation.
• Non uniform mutation produces a mutated solution X (x1 ,x2 ,xi ,xN ) whereby xi is
calculated as

• which d0 = initial value of d, t = current iteration, and T = maximum number


of iterations.
Termination Criteria
• The termination criteria determine when to end the algorithm’s iterations.
• Selecting a good termination criterion has an important role on the correct
convergence of the algorithm.
• The number of iterations, the amount of improvement of the objective function
between consecutive iterations, and the run time are common termination criteria for
the GA
User‐ Defined Parameters of the GA
• The size of the population of solutions (M), the number of parents (R), the
probability of crossover (PC), the probability of mutation (PM), and the
termination criterion are the user‐defined parameters of the GA.

• A good choice of the parameters is related to the decision space of a


particular problem, and in general the optimal parameter setting for one
problem may not perform equally as well for other problems.

• Mastering the choice of the GA parameters relies on practice and experience


with specific optimization problems.

You might also like