Professional Documents
Culture Documents
net/publication/257634720
CITATIONS READS
40 1,064
2 authors:
Some of the authors of this publication are also working on these related projects:
Picking the Low-Hanging Fruits of Indigenous Energy Resources in Africa View project
All content following this page was uploaded by Nicolaos Theodossiou on 22 September 2015.
Received: 4 November 2010 / Accepted: 15 December 2011 / Published online: 4 January 2012
© Springer Science+Business Media, LLC 2012
Abstract During the last few years Harmony Search Algorithm (HSA), a new op-
timization technique, has been used effectively in solving large scale problems. In
this paper along with a brief presentation of HSA, an application on classic Dam
Scheduling problem is presented. This application concerns the optimum operation
of a four-reservoir system over 24 hours. The water released from each dam is used
for hydropower generation and irrigation. The objective is to maximize the daily ben-
efits gained from the reservoir system over 12 (two-hour) time steps.
Two programs were created in order to optimize this particular problem using
Visual-Basic and MATLAB respectively. Both programs converged successfully to
optimum management, and their main characteristics and results, are presented. The
comparison between them reveals some interesting differences regarding their effi-
ciency.
The purpose of this paper is to show the potential of HSA and prove its effi-
ciency to optimize complex optimization problems successfully. Major findings of
the present paper are the 15 different solutions leading to the same global optimum.
These 15 variations of the optimum management practices comprise all possible so-
lutions, as it is proven, and they are detected for the first time ever.
Abbreviations
HSA Harmony Search Algorithm
HM Harmony Memory
HMsize Harmony Memory Size
MaxIter Maximum number of iterations
HMCR Harmony Memory Considering Rate
PAR Pitch Adjusting Rate
1 Introduction
Even in ancient civilizations, the relation between music and mathematics was con-
sidered to be essential, but only recently scientists found an interesting connection
between optimization techniques and music. This technique, the music-inspired har-
mony search optimization algorithm, is based on the observation that the aim of music
creation is the quest of the perfect state of harmony. Just as the musicians try to im-
prove their music (based on aesthetic and acoustic criteria), the algorithm seeks for
certain values that optimize the objective function and at the same time satisfy the
problem’s constraints. And in the same way a music band improves rehearsal after
rehearsal, HSA improves iteration after iteration.
Dr. Zong Woo Geem presented the new optimization technique in a Water Re-
sources Conference in 2000. In the following year Geem et al. published HSA’s struc-
ture (Geem et al. 2001). At that point he believed that a new meta-heuristic algorithm
could still be developed and would be an attractive alternative among the already es-
tablished methods. Moreover, this new technique would be a robust tool, with even
better performance, that provides improved results after less iteration.
Every member of a music band has different options during a performance or a re-
hearsal. Firstly, the musician can play the famous melody, the well-known theme of
the song. Obviously all members of the music band know this theme and can play it
from memory. The second option is to play a variation of this theme. In this way the
theme is enriched with new music material. Finally, the musician can always start an
improvisation creating new—sometimes random—melodies.
Harmony Search Algorithm consists of 3 basic mechanisms that imitate the above
options. After filling the Harmony Memory with random values:
Application of the Harmony Search optimization algorithm 333
(a) HSA chooses a variable’s value from Harmony Memory in order to create a new
harmony. This process is defined as Memory Consideration and it is very impor-
tant because it ensures that good harmonies (values that give good results) will be
considered through the solution. Moreover, these “good” harmonies will be the
material for the creation of new, even better harmonies.
In order to use this process effectively, Harmony Memory Considering Rate
(HMCR) is defined. This index will specify the probability that the New Harmony
will include a value from the historic values stored in the HM.
(b) Every component of the New Harmony, chosen from HM, is likely to be pitch-
adjusted. This procedure is the local-search mechanism. Pitch Adjusting Rate
(PAR), indicates the probability that algorithm will choose neighboring values
for the PAR% of the components chosen from HM. Component xinew will be:
xinew = xi ± Random · bw
After the first successful applications of the new method, it was obvious that HS Al-
gorithm presents the characteristics of a powerful and efficient tool, with the extra ad-
vantage of having a simple structure. This simple structure allows the combination of
HSA with other optimization techniques. Furthermore, HSA does not require initial
value settings of the decision variables, it imposes fewer mathematical requirements
and, as a stochastic algorithm, it doesn’t require derivative information. Programming
HSA applications, which is the main issue of this paper, is simple. As a result, code
is usually shorter and runs faster compared to other meta-heuristics (Geem 2006).
For the reasons mentioned above, there has been sustained and increasing inter-
est in HSA applications since its first presentation in 2001. During the following
years Geem et al. published articles regarding Fluid Mechanics (Kim et al. 2001) and
Drinking Water Network Design (Geem et al. 2002). Besides, HSA was designed
during a Ph.D. research focusing in pipe network design. Very soon HSA attracted
the interest of scientists from different fields as Structural Engineering and Soil Me-
chanics. In the current international literature one can find a vast variety of imple-
mentations, from solution of Sudoku puzzles (Geem 2007a, 2007b) to the design of
satellite components (Geem and Hwangbo 2006).
Similar progress can be found in the number of publications regarding HSA. Af-
ter extensive search in several scientific databases and updating previous researches
334 I.P. Kougias, N.P. Theodossiou
Fig. 1 Growth of annual HSA publications, since the creation of the Algorithm (number of publica-
tions/year)
(Kougias and Theodossiou 2010b; Ingram and Zhang 2009), we found some interest-
ing results. Until 2004 the annual number of publications was modest, but from 2005
and onwards there is a remarkable increase in HSA activity. Recently, Information
Technology (IT) scientists included HSA among their optimization techniques. As a
result in 2009 the number of publications is 9 times greater than 2005 & 2006, and it
is safe to say that the growth in HSA literature is significant (Fig. 1).
According to a research we completed regarding HSA implementations (Kougias
and Theodossiou 2010b), Water Management applications are a main research activ-
ity, with a percentage of 15% (Fig. 2).
Application of the Harmony Search optimization algorithm 335
Until 2005, half the published HSA studies were devoted to the design of water
distribution networks. Since then the range of applications has expanded.
In the present paper, the optimization of a complex four-reservoir system using Har-
mony Search Algorithm is presented. This particular problem was presented for the
first time in 1968 by Robert Larson who solved it using Dynamic Programming (Lar-
son 1968). Since then many scientists worked on this. In Murray and Yakowitz (1979)
solved it using Constrained Differential Dynamic Programming. Chow and Cortes-
Rivera (1974) introduced a variation of the problem which uses non-integer decision
variables. More recently Wardlaw and Sharif (1999) created a program based on a Ge-
netic Algorithm, which verged on the global optimum. Few years later the operation
of multi-reservoir systems was optimized with a combination of Genetic Algorithm
with stochastic dynamic programming (Huang et al. 2002). In 2007 Geem published
a successful solution using Harmony Search Algorithm (Geem 2007a, 2007b). Geem
mentioned that the four reservoir problem has multiple global optima. However, his
application detected only a part of the possible solutions.
In this paper, we will present a successful solution of this “classic” problem. This
solution includes all possible values of the decision variables which lead to the opti-
mum scheduling.
The aim of this problem is to determine the optimum operation of the four-
reservoir system in Fig. 3, over 24 hours. The reservoir network contains both series
and parallel connections and the water supplies are used for hydropower generation
and irrigation. Flood control and recreation are also taken into account. Hydropower
generation is possible from all four reservoirs through the powerhouses. Outflow from
reservoir 4 is used to cover irrigation needs. The objective is to optimize the daily ben-
efits gained from the reservoir system over 12 (two-hour) time steps. This is a typical
linear, combinatorial problem, where decision variables can only take discrete, inte-
ger values.
Si (0) = 5, i = 1, 2, 3, 4
For flood control purposes, a maximum water level for each reservoir is included.
Obviously, storage values (Si ) are always greater or equal to zero. These constraints
are expressed as:
0 ≤ S1 ≤ 10, 0 ≤ S2 ≤ 10
0 ≤ S3 ≤ 10, 0 ≤ S4 ≤ 15
The decision variables of the problem are the quantities of water units flowing out of
each reservoir (Ri , i = 1–4) and take discrete, integer values. The maximum permit-
ted flow is determined by the capacity of the power generators while the minimum
336 I.P. Kougias, N.P. Theodossiou
flow is specified according to the needs of conservation and navigation. These limits
are expressed as:
0 ≤ R1 ≤ 3, 0 ≤ R2 ≤ 4
0 ≤ R3 ≤ 4, 0 ≤ R4 ≤ 7
There are constant inflows to the Reservoirs 1 and 2 equal to 2 & 3 water units re-
spectively, every two hours:
IN1 = 2, IN 2 = 3
As a result, the equations that express the storage values through the 12 time-steps
are:
The desired final state at the end of the day according to Larson (1968) is:
S1 (12) = 5, S2 (12) = 5
S3 (12) = 5, S4 (12) = 7
The Benefit criterion considers the use of water for power generation and irrigation.
There are five activities in this criterion, four for hydropower generation and one
irrigation activity. The objective function to be maximized is:
4
11
11
bi (t) × Ri (t) + b5 (t) × R4 (t) (5)
i=1 t=0 t=0
Table 1 includes the benefit coefficients (bi , i = 1–5) included in (5) as given by
Larson (1968). Optimization in a deregulated electricity market was studied by Zhang
and Ponnambalam (2006).
The problem is consisted of 12 time steps. Each time step corresponds to a two-
hour period and all four decision variables Ri take 12 values in one day.
Releases for time step 0 (Ri (0)) are the releases after the first 2 hours of the day
(00:00–02:00), while releases for time step 11 (Ri (11)—12th release for the four
reservoirs) refer to the last 2 hours of the day (22:00–24:00).
Storages for time step 0 (Si (0)) is the number of water units that each reservoir
contains at the beginning of the day, before the first release (Ri (0)). Storages after
the 12th release (Si (12)—13th storage) describe the final state of the reservoirs at the
end of the day, which obviously is the beginning state for the next day.
338 I.P. Kougias, N.P. Theodossiou
Firstly, an application was created in Visual Basic named ‘HSA-4Dams’ (Fig. 4).
In this program, user inputs HSA parameters and the MaxIter in the program mask.
After that the program is ready to run and create a text file which contains the results.
Harmony Search Algorithm finds better and better solutions through the procedure
and these optima are included in the text file.
The code of the program included sorting HM from the best Harmony to the worst.
In other words, during the solution the best harmony was stored in the 1st place
and the worst Harmony in HMsizeth place. Similar configuration (Visual Basic, sort-
ing mechanism) has been successfully used in a groundwater management problem
which optimizes the operation of a group of four wells in a square formation (Kougias
and Theodossiou 2010a). Pioneer in the application of HSA to Groundwater Man-
agement is M.T. Ayvaz who has already published studies regarding the optimum
aquifer—management and the identification of groundwater parameter structure (Ay-
vaz 2009a, 2009b).
As it is illustrated in Fig. 5, ‘HSA-4Dams’ reached the known global optimum
(401.3). It discovered more than one solutions and the duration of a typical run was
≈30 s in an Intel Celeron U2300 (1.2 GHz), completing 150–200 thousand iterations.
After the first results of ‘HSA-4Dams’ we adjusted the program according to
suggestions of researchers who created variations of the “classic” HSA as Im-
proved HSA and Global-Best HSA (Mahdavi et al. 2007; Omran and Mahdavi 2008;
Application of the Harmony Search optimization algorithm 339
Wang and Huang 2010). The performance of the program, although smooth, did not
show any remarkable improvement.
Solving this problem in Matlab and creating a program named ‘DArMony’ resulted
in some interesting observations. Generally, the creation of an independent applica-
tion in Matlab is more complicated than developing programs in VB and requires
the use of compilers. However, it is possible to run meta-heuristics inside Matlab
effectively. Scientists believe that Matlab is the appropriate tool for meta-heuristics
(Yang 2009). The authors agree with that, since ‘DArMony’ showed a significantly
improved performance.
First of all, Matlab is more effective in creating Graphs and Diagrams. These
Graphs reflect the solution and present HSA’s evolution towards the global optimum.
Their creation is simple and can be included in the code. In ‘DArMony’ a diagram
pops-up automatically after every run (Fig. 6).
Another important advantage of the Matlab implementation is that it shows an
ability to converge easier and quicker to the global optimum. Usually it takes less than
35000 iterations. Comparing Figs. 5 and 6, we concluded that DArMony’s Graph has
a higher gradient, which can be translated to that convergence to the global optimum
is quicker. This can be explained by the fact that Matlab uses Mersenne Twister,
a highly respected random number generator developed in 1997 by Makoto Mat-
sumoto, with very good statistical properties and an ultra-long period (Luke 2009).
According to Microsoft’s website, Visual Basic’s random number generator (‘rnd’
command), is using a linear congruential method, where the next random number is
a function of the previous one: xt+1 = (a × xt + c). Although this is a very common
340 I.P. Kougias, N.P. Theodossiou
method, it is known since the 1960s that it can lead to poor results. Harmony Search
Algorithm, as a stochastic algorithm, uses random numbers in every important step.
As a result, a better Random Number Generator contributes to a totally better perfor-
mance. Introducing scripts with even more complex and accurate Random Number
Generators and testing the way HSA corresponds (in both Visual Basic and Matlab
implementations), is one of our future targets.
The Four-Reservoir problem has a strong local optimum resulting to a value of
the objective function equal to 401.1. ‘DArMony’ showed a remarkable ability to
overcome this local optimum. On the contrary ‘HSA-4Dams’ occasionally failed to
attain global optimality. But even in successful runs, reaching global optimum would
take 5 times the iterations ‘DArMony’ needs.
roads etc. In that case, drilling wells in the ideal location might be impossible. Clas-
sified HM can be helpful and guide engineers to find out which solution very close to
the optimum (e.g. 99%) is applicable.
It is worth to mention that although duration of the convergence is identical with
Geem’s implementation (≈35000 iterations), the calibration of the Algorithm was
slightly different. In this specific problem, ‘DArMony’ performs better if HMsize ≈
11 instead of Geem’s suggestion for HMsize = 30–50. Although convergence is suc-
cessful even for values between 30 and 50, ‘DArMony’ converges considerably faster
if:
HMsize = 10–12, HMCR ≈ 0.98–0.99, PAR = 0.03–0.04
‘HSA-4Dams’ showed its best performance for even lower values of HMsize ≈ 7.
The most interesting information, derived from ‘DArMony’, is the variety of solu-
tions reaching the global optimum. One could say that a linear programming solver
would easily converge to global optimum solutions. This is partially true since the
particularity of this problem is that it presents several (15 to be exact) optimal solu-
tions with the same value for the objective function, resulting from a different com-
bination of the decision variables. A linear programming approach could easily find
the optimal solution but not all the combinations of the decision variables that lead to
the same optimum objective function. Only through a time-consuming change of the
initial values of the decision variables, could a linear programming algorithm result
in some of the other optimal solutions. And since this is a technical problem, it is
important to have all possible optimal solutions since they concern different options
of the multiple dam schedules.
Geem, for the first time, mentioned that more than one solution exist (Geem 2007a,
2007b). Indeed, although releases R1 , R3 and R4 take the same values through the 12
time steps in all solutions (Table 2), release R2 can have variations.
‘DArMony’, after several runs, discovered all 15 different solutions for R2 , which
result to the highest value of the objective function (401.3). Surprisingly, authors
realized that these 15 solutions are located in 3 ‘neighborhoods’ in the search space.
Each ‘neighborhood’ contains 5 different solutions (Table 3).
The authors tried to investigate the reason for this phenomenon, using the theory of
Fitness Landscapes. Frank et al. (1997) published a detailed research in local search.
They concluded that all combinatorial search problems with discrete objective func-
tions have plateaus that cause plateau moves during search. On the contrary they
believe that it is unlikely for problems with real-valued objective functions to have
plateaus. As a result, the 4 Reservoir problem has an objective function with sev-
eral plateaus, benches and local optima (Fig. 7). Watson (2010) describes this type of
342 I.P. Kougias, N.P. Theodossiou
0 1 0 0
1 0 0 2
2 0 4 7
3 2 4 7
4 3 4 7
5 3 4 7
6 3 4 7
7 3 4 7
8 3 4 7
9 3 4 7
10 3 4 0
11 0 0 0
0 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2
3 2 2 2 2 2 1 1 1 1 1 0 0 0 0 0
4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
5 3 3 4 4 4 3 3 4 4 4 3 3 4 4 4
6 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
7 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
8 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
9 3 4 2 3 4 3 4 2 3 4 3 4 2 3 4
10 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
11 4 3 4 3 2 4 3 4 3 2 4 3 4 3 2
In order to ensure that ‘DArMony’ located all possible solutions, authors created
a program named ‘Olon’ which, through an iterative procedure, finds all different
global optima. Obviously, ‘Olon’ needs several hours of computing time. In order to
decrease this demand, authors used information derived from ‘DArMony’.
Knowing that Releases R1 , R3 and R4 take constant values in all optimum solu-
tions, code was simplified. ‘Olon’ searched for optimum solutions among the possible
values for R2 . As a result the required computing time was decreased to less than one
hour.
Olon’s results are identical with DArMony’s outcome. These results confirm that
‘DArMony’ discovered all 15 variations of R2 which lead to the optimum Dam
Scheduling (Table 3).
4 Conclusions
References
Ayvaz MT (2009a) Application of Harmony Search algorithm to the solution of groundwater management
models. Adv Water Resour 32:916–924
Ayvaz MT (2009b) Identification of groundwater parameter structure harmony search algorithm. In: Geem
ZW (ed) Music-inspired harmony search algorithm, vol 191. Springer, Berlin, pp 129–140
Chow VT, Cortes-Rivera (1974) Applications of DDDP in water resources planning, Research report 78,
University of Illinois, Water Resources Center, Urbana
Frank J, Cheeseman P, Stutz J (1997) When gravity fails: local search topology. J Artif Intell Res 7:249–
281
Geem ZW (2006) Comparison harmony search with other meta-heuristics in water distribution network
design. In: Water distribution systems analysis symposium 2006, Proceedings of the 8th annual water
distribution systems analysis symposium, pp 1–9
Geem ZW (2007a) Harmony search algorithm for solving Sudoku. In: KES 2007, Part I. LNCS (LNAI),
vol 4692, pp 371–378
Geem ZW (2007b) Optimal scheduling of multiple dam system using harmony search algorithm. In: San-
doval F et al (ed) IWANN 2007. LNCS, vol 4507, pp 316–323
Geem ZW, Hwangbo H (2006) Application of harmony search to multi-objective optimization for satel-
lite heat pipe design. In: Proceedings of 2006 US-Korea conference on science, technology & en-
trepreneurship (UKC 2006), pp 1–3
Geem ZW, Kim JH, Loganathan GV (2001) A new heuristic optimization algorithm: harmony search.
Simulation 76(2):60–68
Geem ZW, Kim JH, Loganathan GV (2002) Harmony search optimization: application to pipe network
design. Int J Model Simul 22(2):125–133
Huang WC, Yuan LC, Lee CM (2002) Linking genetic algorithms with stochastic dynamic programming
to the long-term operation of a multi-reservoir system. Water Resour Res 38(12):40/1–40/9
Ingram G, Zhang T (2009) Overview of applications and developments in the harmony search algorithm.
In: Geem ZW (ed) Music-inspired harmony search algorithm, vol 191. Springer, Berlin, pp 15–37
Kim JH, Geem ZW, Kim ES (2001) Parameter estimation of the nonlinear Muskingum model using har-
mony search. J Am Water Resour Assoc 37(5):1131–1138
Kougias I, Theodossiou N (2010a) A new music-inspired harmony based optimization algorithm. Appli-
cation in water resources management problems. In: International conference: protection and restora-
tion of the environment X, pp 1–8
Kougias I, Theodossiou N (2010b) A new music-inspired harmony based optimization algorithm. Theory
and applications. In: International conference on protection and restoration of the environment X,
pp 1–8
Larson RE (1968) State increment dynamic programming. Elsevier, New York
Luke S (2009) Essentials of metaheuristics. Zeroth edn, pp 193–194
Mahdavi M, Fesanghary M, Damangir E (2007) An improved harmony search algorithm for solving opti-
mization problems. Appl Math Comput 188:1567–1579
Murray DM, Yakowitz S (1979) Constrained differential dynamic programming and its application to
multireservoir control. Water Resour Res 15(5):1017–1027
Omran MGH, Mahdavi M (2008) Global-best harmony search. Appl Math Comput 198:643–656
Wang CM, Huang YF (2010) Self-adaptive harmony search algorithm for optimization. Expert Syst Appl
37:2826–2837
Wardlaw R, Sharif M (1999) Evaluation of genetic algorithms for optimal reservoir system operation.
J Water Resour Plan Manag 125(1):25–33
Watson JP (2010) An introduction to fitness landscape analysis and cost models for local search. In: Hand-
book of metaheuristics. Springer, Berlin, pp 599–623
Yang XS (2009) Harmony search as a metaheuristic algorithm. In: Geem ZW (ed) Music-inspired harmony
search algortihm: theory and applications, vol 191. Springer, Berlin, pp 1–14
Zhang JL, Ponnambalam K (2006) Hydro energy management optimization in a deregulated electricity
market. Optim Eng 7:47–61