Professional Documents
Culture Documents
Module - 9 Lecture Notes - 2 Genetic Algorithms
Module - 9 Lecture Notes - 2 Genetic Algorithms
4, x2
0 1 1 1
0 0 0 1
x1
x2
x3
An individual consists a genotype and a fitness function. Fitness represents the quality of the
solution (normally called fitness function). It forms the basis for selecting the individuals and
thereby facilitates improvements.
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
Start
Best
Individuals
R
E
G
E
N
E
R
A
T
I
O
N
Meets
Optimization
Criteria?
Yes
Stop
No
Selection (select parents)
Fig. 1
The initial population is usually generated randomly in all EAs. The termination condition
may be a desired fitness function, maximum number of generations etc. In selection,
individuals with better fitness functions from generation i' are taken to generate individuals
of i+1th generation. New population (offspring) is created by applying recombination and
mutation to the selected individuals (parents). Recombination creates one or two new
individuals by swaping (crossing over) the genome of a parent with another. Recombined
individual is then mutated by changing a single element (genome) to create a new individual.
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
Finally, the new population is evaluated and the process is repeated. Each step is described in
more detail below.
PARENT SELECTION
After fitness function evaluation, individuals are distinguished based on their quality.
According to Darwin's evolution theory the best ones should survive and create new offspring
for the next generation. There are many methods to select the best chromosomes, for example
roulette wheel selection, Boltzmann selection, tournament selection, rank selection, steady
state selection and others. Two of these are briefly described, namely, roulette wheel
selection and rank selection:
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
Table 1
Candidate
Fitness value
109
28.09
76
19.59
50
12.89
153
39.43
Total
388
100
Rank Selection:
The previous type of selection may have problems when the fitnesses differ very much. For
example, if the best chromosome fitness is 90% of the entire roulette wheel then the other
chromosomes will have very few chances to be selected. Rank selection first ranks the
population and then every chromosome receives fitness from this ranking. The worst will
have fitness 1, second worst 2 etc. and the best will have fitness N (number of chromosomes
in population). By this, all the chromosomes will have a chance to be selected. But this
method can lead to slower convergence, because the best chromosomes may not differ much
from the others.
CROSSOVER
Selection alone cannot introduce any new individuals into the population, i.e., it cannot find
new points in the search space. These are generated by genetically-inspired operators, of
which the most well known are crossover and mutation.
Crossover can be of either one-point or two-point scheme. In one point crossover, selected
pair of strings is cut at some random position and their segments are swapped to form new
pair of strings. In two-point scheme, there will be two break points in the strings that are
randomly chosen. At the break-point, the segments of the two strings are swapped so that
new set of strings are formed. For example, let us consider two 8-bit strings given by
'10011101' and '10101011'.
Then according to one-point crossover, if a random crossover point is chosen after 3 bits from
left and segments are cut as shown below:
100 | 11101
101 | 01011
and the segments are swapped to form
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
10001011
10111101
According to two-point crossover, if two crossover points are selected as
100 | 11 | 101
101 | 01 | 011
Then after swapping both the extreme segments, the resulting strings formed are
10001101
10111011
Crossover is not usually applied to all pairs of individuals selected for mating. A random
choice is made, where the probability of crossover being applied is typically between 0.6 and
0.9.
MUTATION
Mutation is applied to each child individually after crossover. It randomly alters each gene
with a small probability (generally not greater than 0.01). It injects a new genetic character
into the chromosome by changing at random a bit in a string depending on the probability of
mutation.
Example: 10111011
is mutated as
10111111
It is seen in the above example that the sixth bit '0' is changed to '1'. Thus, in mutation
process, bits are changed from '1' to '0' or '0' to '1' at the randomly chosen position of
randomly selected strings.
REAL-CODED GAs
As explained earlier, GAs work with a coding of variables i.e., with a discrete search space.
GAs have also been developed to work directly with continuous variables. In these cases,
binary strings are not used. Instead, the variables are directly used. After the creation of
population of random variables, a reproduction operator can be used to select good strings in
the population.
Hydrological modeling
Watershed Management
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
Groundwater modeling
Reservoir Operation
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
Fig. 2
Multi Objective Genetic Algorithms for Optimal Reservoir Operation Case Study
Bhadra Reservoir A multi-purpose reservoir located in the district of Chickmangalur,
Karnataka state, India; 75o3820 E longitude and 13o42 N latitude.
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
SQDV
Dl ,t
IRl ,t
t 1
12
Dr ,t
IRr ,t
t 1
12
k1 Rl ,t H l ,t
k2 Rr ,t H r ,t
k3 Rb ,t H b ,t
t 1
Subject to constraints in
(i) Reservoir storage continuity constraint
St
St
It
Smin
St
Smax
R1,t
R2,t
R3,t
Et Ot
pR1,t H1,t
E1,max
pR2 ,t H 2 ,t
E2 ,max
pR3 ,t H 3,t
E3,max
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
R1,t
C1,max
R2 ,t
C2 ,max
10
R1,t
D1max ,t
D2min ,t
R2 ,t
D2max ,t
R3,t
MDTt
f2
190
gen=50
gen=200
gen=500
180
170
160
150
10
f1
12
4
x 10
Fig. 4 Improvement in Pareto optimal front over the iterations. f1 is annual squared irrigation
deficit; f2 is hydropower generated MkWh
Model Application
MOGA model is solved for three different inflow scenarios into the reservoir
Scenario 1: Mean monthly inflows 0.5 * SD
Scenario 2: Mean monthly inflows
Scenario 3: Mean monthly inflows + 0.5 * SD
where SD is the standard deviation of monthly flows
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
11
Fig. 5 Pareto optimal front, showing the trade-off between irrigation ( f1) and hydropower (
f2) for different inflow scenarios. f1 = sum of squared irrigation deficits, (Mm3)2; f2 =
hydropower generated, (MkWh)
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
12
Fig. 6 Reservoir operating policies for different inflow scenarios, showing the initial storages
for different situations, viz., equal priority case, irrigation only priority case and hydropower
only priority case.
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
13
Fig. 7 Optimal release policy obtained for equal priority case, showing releases in Mm 3 for
Left bank canal (R1), Right bank canal (R2) and River bed (R3) for different inflow
scenarios.
Advantages of MOEAs:
MOEAs are easy to adopt and can provide efficient solutions for multi-objective problems.
They are capable of handling nonlinear objectives/ constraints, disconnected Pareto-fronts,
M9L2
Water Resources Systems Planning and Management: Advanced Topics Genetic Algorithms
14
non-convex decision space. They can find solutions to extremely complex and high
dimensional real-world applications in reasonable computation time. They have high
potential for multi-objective optimization of hydrological and water resources problems.
M9L2