Unit III
Unit III
Genetic Algorithm
Genetic Algorithm
• 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
• 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.
• The most common methods are proportionate selection, ranking selection, and
tournament selection.
Proportionate Selection
• 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.
• 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.
• 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
• A random number Rand from the range [0,1] is generated for each solution in the parent
population.
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.