18 (1997) 117127
ELSEVIER
Computers
and electronics
in agriculture
anagement of water resources using improved
genetic algorithms
YuMing
Chen *
Tile Institute of Intelligent Machines, Academia Sinica, P.O. Box 1130, Hefei,
Anhui 230031, People’s Republic of China
Abstract
In this paper, definitions for several genetic algorithms and algorithm proceduresare
described. Some improvements in conventional genetic algorithms such as sequence
crossover, multipoints crossover and multipoints mutation methods are proposed. In
addition, the optimum managementof an irrigation problemwassolvedasan exampleof the
application of the above algorithms. Finally, the algorithms are implementedin C + +
language.0 1997Elsevier ScienceB.V.
Keywords:
Genetic algorithms;Irrigation optimization
1. Introduction
The management of irrigation plays an important role in a district’s lack of
water, especially in some northern parts of China (Xiong et al., 1995). It is an
urgent problem how to distribute the water resources in the most reasonable way.
The optimum management of irrigation is a problem of multigoals and multiconstraints. Conventionally, the hillclim.bing method is used to solve these kinds of
problems, but cannot satisfactorily make out the resolution because there are too
many factors involved. In our lab, we try to adopt some biologicalbased algorithms. Genetic algorithms are introduced.
* Tel.: + 86 0551 5107506; fax: + 86 0551 5591100; email: chengj@public.hf.ah.cn
01681699/97/$17.00 0 1997 Elsevier Science B.V. All rights reserved.
PII SO1 681699(97)00024O
!18
Y.M.
Chen /Computers
and Electronics
in Agriculture
18 (1997)
117127
Genetic algorithms (GAS) are search alg,orithms based on the mechanism of
natural selection and natural genetics. They have become increasingly popular in
recent years as a approach to solving complex search problems in many computer
application fields.
In this paper, the improvement of conventional genetic algorithms is investigated
for a task of the irrigation optimization.
The advantage and the shortcoming also
are discussed. At last, based on the blind, Iparallelism and robustness of GAs, a
schedule of water resource management can be implemented.
2. Genetic algorithms
Genetic algorithms have been developed by John Holland (Holland, 1971), his
colleagues and his students at University of Michigan. GAS are an example of a
search procedure that use random choices as a tool to guide a highly exploitative
search through the coding of a parameter space. They combine the survival of the
fittest among string structured yet randomized information
exchange to form a
search algorithm with some of the innovative flair of human search, Goldberg
(1989).
GAs differs from other optimum seeking methods in some fundamental ways:
1. GAS work with a coding parameter set, not the parameter themselves.
2. GAS search from a population of the points, not a simple point.
3. GAS only use payoff (objective function) information,
not other auxiliary
knowledge such as derivative, etc.
4. GAS use probability transition rules, not deterministic rules.
The efficiency and the simplicity of the operation are two main attractions of the
genetic algorithms approach.
Generally, genetic algorithms are composed of three operations:
1. reproduction
2. crossover
3. mutation
3. Irrigation
optimization
model and fitness function
The first step applying GAS to the irrigation optimization
problem is to figure
out the fitness. In our lab, a project on the irrigation optimization
in Shijing
Irrigation Network was under way. The fitness function of the problem will be
defined through analysis of the irrigation model.
ShiJing Irrigation Networks is located at the eastern foot of TaiHang Mountain,
southern part of Hebei plain. There are good soil and temperate climate that are fit
for growing wheat and cotton. This area is the important agriculturebase in China.
But in recent years, the water in the reservoir is lacking seriously due to the
longtime dry weather. So, how to distribute reasonably limited water resources
become a muchconcerned problem.
Y.M.
Chen /Computers
and Electronics
in Agriculture
18 (1997)
117127
119
From March to April every year in the ShiJing Irrigation Networks, there are six
areas distributed in 13 counties where the Spring wheat and cotton mainly need. to
be irrigated. To manage the water source reasonably, an irrigation plan must be
made by the irrigation management station #ahead of time (see Fig. 1).
Through analysis of the irrigation networks and discussion with the dornain
experts, a model of economic profit and irrigation management can be made out.
For the irrigation model, some parameters are assumed as follows:
Q
sj
the total quantity of water that the reservoir can offer
i= l,..., 6, the total area of district i
Rj
i= l,... ,6, the proportion
of the area of wheat field to the total area of
district i, thus 1  Ri represents the proportion of the cotton
C, the price of water per unit volume that the irrigation management station
sold to the user
C, the price of water per unit volume that the irrigation management station
bought from the reservoir
Lj i= l,... ,6: the ratio of loss water to the total water quantity on the way
from the station to district i, respectively
Wj i=l ,...,6: the total water quantity of well irrigation which can be applied
in district i, respectively
Some variables, used in the model, are shown as follows:
Xi,
i
X2.
i =
= 1,...,6: the quantity of water distributed to each district i
l,..., 6: the ratio of water distributed into wheat field to total area in
’ district i
X3; i = 1,. . .,6: the ratio of irrigated area to the total area in wheat field of
district i
station
16: six districts
/
I
LID
1
2
Fig. 1. Sketch map of shiJing irrigation networks.
120
Y.M. Chen /Computers and Electronics in Agriculture 18 (1997) 117127
x,
i= 1,. . .,6: the ratio of irrigated area to the total area in cotton field of
district i
i=l ,. . .,6: the economic profit of district i, respectively
the total economic profit of six districts
Ei
E
The model about irrigation
follows:
optimization
for economic
profit is expressed as
6
E= CE,
i=l
Ei =‘((x’kJs;3T)
Gq
+
Rsjx3,
w,>(l

+f(“)RiSi(l

x3i>
&J
C1
(l


)six4i
+
g(“)(l

Ri)siC1

x4i)
KISiXdi
with a constraint
*1
“<Q
j=lc 1 Li
In the first formula the total economic profit equals the sum of economic profit
of each district.
In the second formula the economic profit of every district equals the economic
profit in the irrigated area plus the economic profit in the unirrigated area minus
the cost of water, and f(x) and g(x) above are the economic profit function of
wheat and cotton respectively when x is the irrigated water quantity per unit area.
According to the analysis of statistical data in previous years, f(x) and g(x) are
approximately a quadratic curve. In addition, j(O) and g(0) are the economic profit
of the unirrigated area in the wheat field and cotton field (see Fig. 2).
Thus, these economic profit functions can be regarded as the fitness function in
the genetic algorithm.
4. Gasbased irrigation
optimization
Through the analysis of the irrigation optimization problem, it can be found that
the search space of the irrigation optimization model is very large, which involves
24 variables (six districts, and there are four variables in each district). The
conventional GA appears to be incompetent in actual operation when confronted
Y.M.
Chen /Computers
and Electronics
in Agriculture
18 (1997)
117 127
121
Yield
4
Fig. 2. Economic profit functions.
by so many variables. The direct use of conventional crossover will cause a slow
increase in the numbers of the strings which involves useful information in every
generation and slow convergence in the process of searching optimum solutions” In
order to reduce the searching time and the complexity of the problem, the selection
of a good initial population becomes much more important. The initial population
which involves sufficient information and uniform distribution will be in favor of
the better resolution. So, the whole problem will be divided into six local subproblems where it is assumed that only the local irrigation management will be
considered. After these local optimum solutions are obtained, they will be included
in the initial population.
4.1. Local irrigation optimization problem
Tn the optimization
of local irrigation management, the respective econiomic
profit function will be regarded as their fitness function. Then the genetic algorithms are used to solve these local irrigation optimization problems. But instead
of directly using the simple genetic algorithm, the conventional genetic algorithms
are improved by a number of steps to fit this kind of problem. The approaches
which are called sequence crossover and homocrossover will be introduced.
Suppose the district i will be considered. The first stage of GA is establishin,g the
initial population of the problems.
(a) A total of ,V experience values of previous years, each are represented as (X1(,
X,, X3, and X,), are selected to form initial population of the local optimization
problem, searching can begin with this population.
(b) When the initial population is obtained, each decision variable XI.: X2,, XSl
and X4, in the initial population is coded as a unsigned binary string with length
Lh:, i = 1, 2, 3 and 4, respectively. The solution strings are constructed to link all
the coded variables together. The length of the solution string is Cq= 1 LN,. Thus,
the solution set that includes 2 C:= I LN, possible solutions is obtained.
122
Y.M.
Chen /Computers
and Electronics
in Agriculture
18 (1997)
117127
After the preparatory steps of the genetic algorithm, the main searching procedure can be going with the three operators: reproduction, crossover and mutation.
4.1.1. Reproduction
Reproduction begins from initial population. According to their objective function values (E,), reproduction is a process in which each string is copied, and strings
with higher fitness value have higher probability contributing one or more offspring
in the new population. For example: Let String 1 and String 2 be the two members
of the initial population; Fl is the fitness of String 1; F2 is the fitness of String 2; n,
is the offspring number of String 1; n, is the offspring number of String 2, then in
the population after reproduction, the distributing of the strings comply with the
ratio:
The reproduction operator may be implemented by creating a biased random
generator where each current string in the population has a probability sized in
proportion to its fitness (Ei). In this way, strings with higher fitness have a higher
number of offspring in the new population.
Once a string has been selected for reproduction, an exact replica of the string is
made. This string is then entered into a mating pool, a new population, for further
genetic operator action. Here the number of the population after reproduction in
kth generation is defined as Nk.
4.1.2. Sequence crossover and homocrossover
In the process of actual operating, the simple crossover was not suitable for fast
created new strings due to only new strings being created in an action. Since that,
two new crossover approaches proposed by the author, which are called sequence
crossover and homocrossover, are adopted to deal with this problem.
For sequence crossover, firstly, two integer series S, and S, are produced. S, is
an integer series with length Nk. All the members of S, are produced by selecting
randomly among the integer numbers 1,2,. . .: Z;= I LN,S2
is a permutation of
1,2 ,..., Nk.
After the two series are produced, the whole population may undergo sequence
crossover as follows: Integer i,, the mth member among S,, represents the position
where the crossover may take place along the mth string. Integer j,, the m th
member among S,, represents from which string in the population the mth string
will absorb information. Utilizing the order integer pairs (i,, j,), the new string m
is created by replacing all the characters between i, + 1 to Zf= lLNi to from string
A,,.
In the process of sequence crossover, homocrossover will take place in the mth
string when j,,, happens to equal m. .Homocrossover is a kind of crossover that
changes information with itself: suppose j, is in the range [LN, + 1, LN(, + I& the
creation of the new string may be created by sweeping all characters in the range
[LN, t 1, m] to the range [m, LN(,+ 1J for string m.
Y.M.
Chen /Computers
and EItctronics
in Agriculture
18 (1997)
117127
123
The following example will give further explanation. Suppose the two series S,
and S, have been produced by a uniform random generator.
S1 = {3,5,10,7,12)
Sz = WA%11
and there are five strings in the population.
A, = 10110 00100 1010 101+4
A,= 1111 010111 1000 000+2
A,=0001
10101 01011 01143
A,=0101
010111 1100 100+5
A,=0011
11001 01010 llO+l
In the above strings, the dependence of four variables X,1, X,, X,, and X, are
maintained and they are separated by space. The members of S,’ are’indicated by
the separator symbol ‘I’ according to its corresponding position along each string
and the numbers following each string are the members of S,.
Following the definition, the strings A,, A, and A, will be processed as a
crossover with the sequence indicated in S, and S,. For example, the integer order
pairs corresponding to string A, is (3,4). An offspring of string A, will be created
by combining all the characters before the 3rd position of string A, with all the
characters after the 3rd position of string A,. The string A, and the string A, will
generate their offspring similarly. However, for the integer order pairs of string A,
and string A, are (5,2) and (10,3), they will undergo a crossover with themselves
which is called a homocrossover. For it to be more reasonable, and not to destroy
the independence of each variable, the homocrossover is constrained to being
processed within the same variable. The offspring of string A, is created by
swapping all the characters between the position range [4,5] to the characters
between the position range [5,9], string A, is same as A,.
After the action, the new changed population were obtained:
A, = 1011 01011 1100 100
taz= 1111 01110 1000 000
A,=0001
10101 0110 011
A, = 0101 01001 0100 110
A,=0011
11001 0100 101
The implementation
of sequencecrossover overcomes the limitation of conventional GA where the numbers of strings in each generation must be even. Comparing the offspring of the population with its upper generation in the sequence
crossover, the similarity between them is very low due to large changing made in
every crossover action, which manifests that information
of each string is exchanged sufficiently during this kind of crossover. In this way better strings can be
found easily.
4.1.3. Mutation in the home crossover
Mutation plays an important role in the operator of conventional GA. Generally,
the initial population which is selected randomly or artificially from the solution set
cannot involve all the probability solutions in the solution space. Occasionally, they
may lose some potentially useful genetic material (at particular locations), even
:24
Y.M.
Chen /Computers
and Electronics
in Agriculture
18 (1997)
117127
though reproduction and crossover effectively search and recombine extant notions.
In artificial genetic systems, the mutation operator can protect against such an
irrecoverable loss.
Conventional
mutation is the occasional alteration of the value with small
probability in a random position of a string.
In our system, the conventional mutation is omitted. To some extent the above
homocrossover has contained this mutation process. Homocrossover, that randomly exchanges the characters by itself, protects it successfully against the defect
of important loss of material. This procedure is favorable for the population to get
a string involving the new information, these information are not involved in the
upper population. Due to the homocrossover and the sequence crossover being
processed simultaneously and parallelly in our approach, the new generation is
produced more quickly.
Following reproduction, sequence crossover and homocrossover, the new generation is obtained. They will be decoded and tesSted. By decoding the new strings and
calculating the fitness function values E,, the unreasonable solutions which have
contradiction with constraints are wiped off. A. moderate threshold value is selected
to judge whether the average value oE the population fitness is converged.
Finally, through repeating these procedures, the local optimum solution population can be obtained.
4.2. Multipoints
crossover and mutation
After the local optimum solution of each district is selected, the initial population
of the whole problem has been formed. The heuristic information expressing the
experience of some experts is also included in it. In this initial population, each
string contains six substrings, which are the local optimum solutions for each
district, and the experience values, which are linked together randomly. After that,
operators called multipoints crossover and multipoints mutation have been introduced, Here, the total economic profit E is regarded as the fitness function.
Reproductions
are similar to the operation mentioned above. Multipoints
crossover is a kind of strategy, that not only a. single point but many points in the
string, selected for crossover. For example, suppose the string B, and B, in t.he
mating pool are selected to crossover
B, = (101. ! . 100)(100.
. 100)(010. . . Oll.)(lOl..
. 111)(00~0..
110)
(011.. . 1p1>
B, = (001. . ! . lll)(lOl.
. . OlO)(lOl.
. . lOl)(lll.
. OOO)(lO!l. . 010)
(100. .OOl)
The first and the fifth substring of B, and B, are selected according to a certain
probability P, to crossover. The separator symbol ‘I’ in theses substrings indicate
the randomly chosen positions. The new pairs of strings will be created by swapping
all the characters behind ‘I’ in corresponding substrings.
Y.M.
Chen /Computers
and Electronics
En Agriculture
B, = (101.. . 111)(100.. . 100)(101.. .011)(101..
B, = (001. . . 100)(101. . . 010)(101. . . lOl)(lll.
18 (1997)
117127
. 111)(001.. .010)(011..
125
. 101)
. 000)(100. . . 1lO)(lOO. . . 001)
Multipoints mutation is also a process where more points are selected to mutate.
It is performed as follows, supposing that the string C, is the arbitrary string which
is going to mutate.
c, = (101. , . 100)(100. . . 100)(0~0. . . 01 l)(lOl.
. 11 l)(OOO. . . 110)
(011. . . 101)
In the above string, each substring can be chosen to participate mutation
according to the probability
P,. But in each selected substring, whether the
mutation happens or not is due to the mutation probability P,. Assume here that
the first and the third substring are chosen, the 3rd position in the first substring
and the 2nd position in the third substring; are selected randomly, and mutation
only takes place in the first substring. The new string is created as follows:
c, = (100. . . 100)(100. . . 100)(010. . . onl)(lol.
. . 11 l)(OOO. . . 110)
(011.. . 101)
In each generation, the new strings are decoded and the fitness function values
are calculated. The average values, the maximum values and the changing rate are
calculated and compared with those of previous generations. Some constraints
according to the experts views also can be put forward to reasonably restrain the
strings.
Through analyzing the strings fitness of each generation, it has been found that
the maximum and average economic profit values have a gradually increasing
tendency. Finally, after several generations, the satisfactory results are obtained.
4.3. Program’s
flow
chart
The problem of irrigation optimization in ShiJing Irrigation Network has been
solved using this improved GAS and implemented by C + + language in the lab,
the flow chart of the program is shown in Fig. 3.
5. Conclusions
The irrigation optimization
problem using the improved GAS are described in
this paper. The methods that divide the whole searching space into several
subspaces and that process the actions simultaneously are adopted. Through that
the period of searching is decreased. On the other hand, in the process of the
searching algorithm approach, the selection of constraints are more important that
more fieldsknowledge and heuristic information are introduced to make the system
perfect. In the next step, we will go further into the genetic algorithm applica.tions.
26
Y.M. Chen / Computers and Electronics in Agriculture 18 (1997) 117127
L
Fig. 3. The program
flowchart.
Y.M. Chen /Computers and Electronics in Agriculture 18 (1997) 117127
121
References
Goldberg, D.E., 1989. Genetic Algorithms in Search, Optimization and Machine Learning, AddisonWesley, US.
Xiong, F.L., Chen, Y.M., Li, M., 1995. The management of water resourcesusing the improvsed
genetic algorithms. Proc. PacificAsian Conference on Expert Systems, HuangShan, China. 15 18
May 1995, pp. 578583.
Chen, Y.M., Jing, D., Xiong, F.L., 1995. Genetic algorithms for irrigation optimization, Proc. 2nd
IFAC/IFIP/EuragEng
Workshop in Agriculture, Wageningeng, Netherlands, 2931 May 1995, pp.
155160.
Grefenstette, J.J., 1989. A system for learning control strategies with genetic algorithms, Proc. IJCAI’89,
Morgan Kaufman, Fairfax, VA.
Dejong, K.A., Spears, W.M., Gordon, D.F., 1996. Using Genetic Algorithms for Concepts Learning,
pp. 161188.
Liepins, G.E., Wang, L.A., 1991. Classifer system learning of Boolean concepts, Proc. IJCAI’&,
Morgan Kaufman, San Mateo, CA, pp. 318323.
Tcherg, D., Lambert, B., Lu.. S., Rendell, R., 1989. Building robust learning system by combining
induction and optimization, Proc. IJCAI’89, Morgan Kaufman, Detroit, MI, pp. 806812.
Holland, J.H., 1971. Proc. and processors for Schemata. In: Jacks, E.L. (Ed.), Associative information
processing. Elsevier, New York, pp: 127146.