Zong Woo Geem Recent Advances in Harmony Search Algorithm
Studies in Computational Intelligence, Volume 270 Editor-in-Chief Prof. Janusz Kacprzyk Systems Research Institute Polish Academy of Sciences ul. Newelska 6 01-447 Warsaw Poland E-mail:
[email protected] Further volumes of this series can be found on our homepage: springer.com Vol. 249. Wesam Ashour Barbakh, Ying Wu, and Colin Fyfe Non-Standard Parameter Adaptation for Exploratory Data Analysis, 2009 ISBN 978-3-642-04004-7 Vol. 250. Raymond Chiong and Sandeep Dhakal (Eds.) Natural Intelligence for Scheduling, Planning and Packing Problems, 2009 ISBN 978-3-642-04038-2 Vol. 251. Zbigniew W. Ras and William Ribarsky (Eds.) Advances in Information and Intelligent Systems, 2009 ISBN 978-3-642-04140-2 Vol. 252. Ngoc Thanh Nguyen and Edward Szczerbicki (Eds.) Intelligent Systems for Knowledge Management, 2009 ISBN 978-3-642-04169-3 Vol. 253. Roger Lee and Naohiro Ishii (Eds.) Software Engineering Research, Management and Applications 2009, 2009 ISBN 978-3-642-05440-2 Vol. 254. Kyandoghere Kyamakya, Wolfgang A. Halang, Herwig Unger, Jean Chamberlain Chedjou, Nikolai F. Rulkov, and Zhong Li (Eds.) Recent Advances in Nonlinear Dynamics and Synchronization, 2009 ISBN 978-3-642-04226-3 Vol. 255. Catarina Silva and Bernardete Ribeiro Inductive Inference for Large Scale Text Classification, 2009 ISBN 978-3-642-04532-5 Vol. 256. Patricia Melin, Janusz Kacprzyk, and Witold Pedrycz (Eds.) Bio-inspired Hybrid Intelligent Systems for Image Analysis and Pattern Recognition, 2009 ISBN 978-3-642-04515-8 Vol. 257. Oscar Castillo, Witold Pedrycz, and Janusz Kacprzyk (Eds.) Evolutionary Design of Intelligent Systems in Modeling, Simulation and Control, 2009 ISBN 978-3-642-04513-4 Vol. 258. Leonardo Franco, David A. Elizondo, and Jos´e M. Jerez (Eds.) Constructive Neural Networks, 2009 ISBN 978-3-642-04511-0 Vol. 259. Kasthurirangan Gopalakrishnan, Halil Ceylan, and Nii O. Attoh-Okine (Eds.) Intelligent and Soft Computing in Infrastructure Systems Engineering, 2009 ISBN 978-3-642-04585-1
Vol. 260. Edward Szczerbicki and Ngoc Thanh Nguyen (Eds.) Smart Information and Knowledge Management, 2009 ISBN 978-3-642-04583-7 Vol. 261. Nadia Nedjah, Leandro dos Santos Coelho, and Luiza de Macedo de Mourelle (Eds.) Multi-Objective Swarm Intelligent Systems, 2009 ISBN 978-3-642-05164-7 Vol. 262. Jacek Koronacki, Zbigniew W. Ras, Slawomir T. Wierzchon, and Janusz Kacprzyk (Eds.) Advances in Machine Learning I, 2009 ISBN 978-3-642-05176-0 Vol. 263. Jacek Koronacki, Zbigniew W. Ras, Slawomir T. Wierzchon, and Janusz Kacprzyk (Eds.) Advances in Machine Learning II, 2009 ISBN 978-3-642-05178-4 Vol. 264. Olivier Sigaud and Jan Peters (Eds.) From Motor Learning to Interaction Learning in Robots, 2009 ISBN 978-3-642-05180-7 Vol. 265. Zbigniew W. Ras and Li-Shiang Tsay (Eds.) Advances in Intelligent Information Systems, 2009 ISBN 978-3-642-05182-1 Vol. 266. Akitoshi Hanazawa, Tsutom Miki, and Keiichi Horio (Eds.) Brain-Inspired Information Technology, 2009 ISBN 978-3-642-04024-5 Vol. 267. Ivan Zelinka, Sergej Celikovsk´y, Hendrik Richter, and Guanrong Chen (Eds.) Evolutionary Algorithms and Chaotic Systems, 2010 ISBN 978-3-642-10706-1 Vol. 268. Johann M.Ph. Schumann and Yan Liu (Eds.) Applications of Neural Networks in High Assurance Systems, 2010 ISBN 978-3-642-10689-7 Vol. 269. Francisco Fern´andez de de Vega and Erick Cant´u-Paz (Eds.) Parallel and Distributed Computational Intelligence, 2010 ISBN 978-3-642-10674-3 Vol. 270. Zong Woo Geem Recent Advances in Harmony Search Algorithm, 2010 ISBN 978-3-642-04316-1
Zong Woo Geem
Recent Advances in Harmony Search Algorithm
123
Dr. Zong Woo Geem iGlobal University 7700 Little River Tpke. #600 Annandale, Virginia 22003 USA E-mail:
[email protected]
ISBN 978-3-642-04316-1
e-ISBN 978-3-642-04317-8
DOI 10.1007/978-3-642-04317-8 Studies in Computational Intelligence
ISSN 1860-949X
Library of Congress Control Number: 2009943375 c 2010 Springer-Verlag Berlin Heidelberg
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilm or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typeset & Cover Design: Scientific Publishing Services Pvt. Ltd., Chennai, India. Printed in acid-free paper 987654321 springer.com
Preface
Nowadays, music-inspired phenomenon-mimicking harmony search algorithm is fast growing with many applications. One of key success factors of the algorithm is the employment of a novel stochastic derivative which can be used even for discrete variables. Instead of traditional calculus-based gradient, the algorithm utilizes musician’s experience as a derivative in searching for an optimal solution. This can be a new paradigm and main reason in the successes of various applications. The goal of this book is to introduce major advances of the harmony search algorithm in recent years. The book contains 14 chapters with the following subjects: State-of-the-art in the harmony search algorithm structure by Geem; robotics (robot terrain and manipulator trajectory) by Xu, Gao, Wang, Xue, Tangpattanakul, Meesomboon, and Artrit; visual tracking by Fourie, Mills, and Green; web text data mining by Forsati and Mahdavi; power flow planning by Panigrahi, Pandi, Das, and Abraham; fuzzy control system by Coelho and Bernert; hybridization (with Taguchi method or SQP method) by Yildiz, Öztürk, and Fesanghary; groundwater management by Ayvaz; irrigation by Cisty; logistics by Bo, Huang, Ip, and Wang; timetabling by Al-Betar, Khader, and Liao; and bioinformatics (RNA structure prediction) by Mohsen, Khader, and Ramachandram. This book collects the above-mentioned theory and applications, which are dispersed in various technical publications, so that readers can have a good grasp of current status of the harmony search algorithm and foster new breakthroughs in their fields using the algorithm. Finally, I, as an editor and musician, would like to share the joy of the publication with all the people who like both music and computational optimization.
Zong Woo Geem Editor
Contents
State-of-the-Art in the Structure of Harmony Search Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zong Woo Geem
1
Harmony Search Optimization Algorithm: Application to a Reconfigurable Mobile Robot Prototype . . . . . . . . . . . . . . . . . . . . . He Xu, X.Z. Gao, Tong Wang, Kai Xue
11
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Panwadee Tangpattanakul, Anupap Meesomboon, Pramin Artrit
23
Visual Tracking Using Harmony Search . . . . . . . . . . . . . . . . . . . . . . Jaco Fourie, Steven Mills, Richard Green
37
Web Text Mining Using Harmony Search . . . . . . . . . . . . . . . . . . . . Rana Forsati, Mehrdad Mahdavi
51
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow with Non-Smooth Cost Function . . . . . . . B.K. Panigrahi, V. Ravikumar Pandi, Swagatam Das, Ajith Abraham A Harmony Search Approach Using Exponential Probability Distribution Applied to Fuzzy Logic Control Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Leandro dos Santos Coelho, Diego L. de A. Bernert Hybrid Taguchi-Harmony Search Approach for Shape Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ¨ urk Ali Rıza Yildiz, Ferruh Ozt¨
65
77
89
VIII
Contents
An Introduction to the Hybrid HS-SQP Method and Its Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mohammad Fesanghary
99
Solution of Groundwater Management Problems Using Harmony Search Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 M. Tamer Ayvaz Application of the Harmony Search Optimization in Irrigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Milan Cisty The Application of Harmony Search in Fourth-Party Logistics Routing Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Guihua Bo, Min Huang, W.H. Ip, Xingwei Wang A Harmony Search with Multi-pitch Adjusting Rate for the University Course Timetabling . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Mohammed Azmi Al-Betar, Ahamad Tajudin Khader, Iman Yi Liao An Optimization Algorithm Based on Harmony Search for RNA Secondary Structure Prediction . . . . . . . . . . . . . . . . . . . . . . . . 163 Abdulqader M. Mohsen, Ahamad Tajudin Khader, Dhanesh Ramachandram Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
State-of-the-Art in the Structure of Harmony Search Algorithm Zong Woo Geem
*
Abstract. The harmony search algorithm has been so far applied to various optimization problems. Also, the algorithm structure has been customized on a caseby-case basis by tweaking the basic structure. The objective of this chapter is to introduce the state-of-the-art structure of the basic harmony search algorithm.
1 Introduction For optimization, people have traditionally used calculus-based algorithms that give gradient information in order to find the right direction to the optimal solution. However, if variables are discrete instead of continuous, they cannot have derivatives. To overcome this situation, the harmony search (HS) algorithm has used a novel stochastic derivative [1] which utilizes the experiences of musicians in Jazz improvisation and can be applicable to discrete variables. Instead of the inclination information of an objective function, the stochastic derivative of HS gives a probability to be selected for each value of a decision variable. For example, if the decision variable x1 has three candidate values {1, 2, 3}, the partial stochastic derivative of the objective function with respect to x1 at each discrete value gives the selection probability for each value like 20% for 1; 30% for 2; and 50% for 3. While cumulative probability becomes unity (100%), the probability for each value is updated iteration by iteration. Desirably the value, which is included in the optimal solution vector, has higher chance to be chosen as the iterations progress. With this stochastic derivative information, the HS algorithm has been applied to various science and engineering optimization problems that include [2, 3]: Real-world applications • Music composition • Sudoku puzzle • Timetabling • Tour planning • Logistics Zong Woo Geem Environmental Planning and Management Program, Johns Hopkins University, Baltimore, Maryland, USA E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 1–10. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
2
Z.W. Geem
Computer science problems • Web page clustering • Text summarization • Internet routing • Visual tracking • Robotics Electrical engineering problems • Energy system dispatch • Photo-electronic detection • Power system design • Multi-level inverter optimization • Cell phone network Civil engineering problems • Structural design • Water network design • Dam scheduling • Flood model calibration • Groundwater management • Soil stability analysis • Ecological conservation • Vehicle routing Mechanical engineering problems • Heat exchanger design • Satellite heat pipe design • Offshore structure mooring Bio & medical applications • RNA structure prediction • Hearing aids • Medical physics In addition to the above-mentioned various applications, the HS algorithm also has various algorithm structures that can be applicable to so many different problems. Thus, this chapter arranges the basic structure of the HS algorithm so that users can easily customize the algorithm for their own optimization problems.
2 Basic Structure of Harmony Search Algorithm The HS algorithm was originally inspired by the improvisation process of Jazz musicians. Figure 1 shows the analogy between improvisation and optimization: Each musician corresponds to each decision variable; musical instrument’s pitch range corresponds to decision variable’s value range; musical harmony at certain
State-of-the-Art in the Structure of Harmony Search Algorithm
3
time corresponds to solution vector at certain iteration; and audience’s aesthetics corresponds to objective function. Just like musical harmony is improved time after time, solution vector is improved iteration by iteration.
Fig. 1 Analogy between Improvisation and Optimization
This section introduces each step of the HS algorithm in detail, including 1) problem formulation, 2) algorithm parameter setting, 3) random tuning for memory initialization, 4) harmony improvisation (random selection, memory consideration, and pitch adjustment), 5) memory update, 6) performing termination, and 7) cadenza.
2.1 Problem Formulation The HS algorithm was devised for solving optimization problems. Thus, in order to apply HS, problems should be formulated in the optimization environment, having objective function and constraints: Optimize (minimize or maximize) f (x)
(1)
hi (x) = 0;
i = 1, … , p ;
(2)
g i (x) ≥ 0;
i = 1, … , q .
(3)
xi ∈ X i = {xi (1),… , xi (k ), … , xi ( K i )} or x iL ≤ xi ≤ xiU
(4)
Subject to
4
Z.W. Geem
The HS algorithm searches entire solution area in order to find the optimal solution vector x = ( x1 , … , x n ) , which optimizes (minimizes or maximizes) the objective function as in Equation 1. If the problem has equality and/or inequality conditions, these can be considered as constraints in Equations 2 and 3. If the decision variable has discrete values, the set of candidate values for the variable becomes xi ∈ X i = {xi (1),… , xi (k ), … , xi ( K i )} ; and if the decision variable has continuous values, the set of candidate values for the variable becomes xiL ≤ xi ≤ xiU . The HS algorithm basically considers the objective function only. However, if a solution vector generated violates any of the constraints, 1) the algorithm abandons the vector or 2) considers it by adding certain amount of penalty to the objective function value. Also, HS can be applied to multi-objective problems by conjugating with Pareto set.
2.2 Algorithm Parameter Setting Once the problem formulation is ready, algorithm parameters should be set with certain values. HS contains algorithm parameters including harmony memory size (HMS), harmony memory considering rate (HMCR), pitch adjusting rate (PAR), maximum improvisation (MI), and fret width (FW). HMS is the number of solution vectors simultaneously handled in the algorithm; HMCR is the rate (0 ≤ HMCR ≤ 1) where HS picks one value randomly from musician’s memory. Thus, (1-HMCR) is the rate where HS picks one value randomly from total value range; PAR (0 ≤ RAR ≤ 1) is the rate where HS tweaks the value which was originally picked from memory. Thus, (1-PAR) is the rate where HS keeps the original value obtained from memory; MI is the number of iterations. HS improvises one harmony (= vector) each iteration; and FW is arbitrary length only for continuous variable, which was formerly called as bandwidth (BW). For more information of the term, a fret is the metallic ridge on the neck of a string instrument (such as guitar), which divides the neck into fixed segments (see Figure 2), and each fret represents one semitone. In the context of the HS algorithm, frets mean arbitrary points which divide the total value range into fixed segments, and fret width (FW) is the length between two neighboring frets. Uniform FW is normally used in HS. Originally fixed parameter values were used. However, some researchers have proposed changeable parameter values. Mahdavi et al. [4] suggested that PAR increase linearly and FW decrease exponentially with iterations:
PAR( I ) = PARmin + (PARmax − PARmin ) × ⎡ ⎛ FWmin FW ( I ) = FWmax exp ⎢ln⎜⎜ ⎣⎢ ⎝ FWmax
⎞ I ⎤ ⎟ ⎟ MI ⎥ ⎠ ⎦⎥
I MI
(5)
(6)
State-of-the-Art in the Structure of Harmony Search Algorithm
5
Fig. 2 Frets on the Neck of a Guitar
Mukhopadhyay et al. [5] suggested that FW be the standard deviation of the current population when HMCR is close to 1. FW ( I ) = σ (x i ) = var(x i )
(7)
Geem [6] tabulated fixed parameter values, such as number of variables, HMS, HMCR, PAR, and MI, after surveying various literatures. FW normally ranges from 1% to 10% of total value range. Furthermore, some researchers have proposed adaptive parameter theories that enable HS to automatically have best parameter values at each iteration [3, 7].
2.3 Random Tuning for Memory Initialization After problem is formulated and the parameter values were set properly, random tuning process is performed. In an orchestra concert, after oboe plays the note A (usually A440), other instruments randomly play any pitches out of playable ranges. Likewise, the HS algorithm initially improvises many random harmonies. The number of random harmonies should be at least HMS. However, the number can be more than HMS, such as twice or three times as many as HMS [8]. Then, top-HMS harmonies are selected as starting vectors. Musician’s harmony memory (HM) can be considered as a matrix:
⎡ x1 ⎢ 12 ⎢ x HM = ⎢ 1 # ⎢ HMS ⎢⎣ x1
x12
"
x1n
x 22
"
x n2
"
"
"
x 2HMS
" x nHMS
f ( x1 ) ⎤ ⎥ f (x 2 ) ⎥ ⎥ # ⎥ f (x HMS )⎥⎦
(8)
6
Z.W. Geem
Previously, the objective function values were sorted ( f (x1 ) ≤ f (x 2 ) ≤ … ≤ f (x HMS ) ) in HM, but current structure does not require it any more.
2.4 Harmony Improvization In Jazz improvisation, a musician plays a note by randomly selecting it from total playable range (see Figure 3), from musician’s memory (see Figure 4), or by tweaking the note obtained from musician’s memory (see Figure 5). Likewise, the HS algorithm improvises a value by choosing it from total value range or from HM, or tweaking the value which was originally chosen from HM.
Fig. 3 Total Playable Range of a Music Instrument
Fig. 4 Set of Good Notes in Musician’s Memory
Fig. 5 Tweaking the Note Chosen from Musician’s Memory
Random Selection: When HS determines the value xiNew for the new harmony x New = ( x1New , … , x nNew ) , it randomly picks any value from total value range ( {xi (1), … , xi ( K i )} or xiL ≤ xi ≤ xiU ) with probability of (1-HMCR). Random selection is also used for previous memory initialization.
State-of-the-Art in the Structure of Harmony Search Algorithm
7
Memory Consideration: When HS determines the value xiNew , it randomly picks any value xij from HM = {x1i , …, xiHMS } with probability of HMCR. The index j can be calculated using uniform distribution U (0,1) : j ← int(U (0,1) ⋅ HMS ) + 1
(9)
However, we may use different distributions. For example, if we use [U (0,1)]2 , HS chooses lower j more. If the objective function values are sorted by j , HS will behave similar to particle swarm algorithm. Pitch Adjustment: After the value xiNew is randomly picked from HM in the above memory consideration process, it can be further adjusted into neighbouring values by adding certain amount to the value, with probability of PAR. For discrete variable, if xi (k ) = xiNew , the pitch-adjusted value becomes xi (k + m) where m ∈ {−1, 1} normally; and for continuous variable, the pitch-adjusted value becomes xiNew + ∆ where ∆ = U (0,1) ⋅ FW (i ) normally. The above-mentioned three basic operations (random selection, memory consideration and pitch adjustment) can be expressed as follows:
xiNew
⎧⎧ xi ∈ {xi (1),..., xi (k ),..., xi ( K i )} ⎪⎨ xi ∈ [ xiLower , xiUpper ] ⎪⎩ ⎪ ← ⎨ xi ∈ HM = {xi1 , xi2 , ..., xiHMS } ⎪ ⎧ xi (k + m) if xi (k ) ∈ HM ⎪ ⎨ ⎪⎩ ⎩ xi + ∆ if xi ∈ HM
w.p.
(1 − HMCR )
w.p. HMCR ⋅ (1 − PAR) w.p.
(10)
HMCR ⋅ PAR
Especially for discrete variables, the HS algorithm has the following stochastic partial derivative which consists of three terms such as random selection, memory consideration and pitch adjustment [1]: n( xi (k )) n(x i ( k − m ) ) ∂f 1 = HMCR (1 − PAR) + (1 − HMCR ) + HMCR PAR Ki ∂xi HMS HMS
(11) Also, the HS algorithm can consider the relationship among decision variables using ensemble consideration just as there exists stronger relationship among specific musicians (see Figure 6). The value xiNew can be determined based on x New j if the two has the strongest relationship [9]: xiNew ← fn( x New ) j
where
{[
]}
max Corr (x i , x j ) 2 i≠ j
(12)
8
Z.W. Geem
∝ Fig. 6 Relationship between Specific Musicians
If the newly improvised harmony x New violates any constraint, HS abandons it or still keeps it by adding penalty to the objective function value just like musicians sometimes still accept rule-violated harmony (see Figure 7).
Fig. 7 Rule-Violated Harmony (Parallel Fifth)
2.5 Memory Update If the new harmony x New is better, in terms of objective function value, than the worst harmony in HM, the new harmony is included in HM and the worst harmony is excluded from HM: x New ∈ HM
∧
xWorst ∉ HM
(13)
State-of-the-Art in the Structure of Harmony Search Algorithm
9
However, for the diversity of harmonies in HM, other harmonies (in terms of least-similarity) can be considered. Also, maximum number of identical harmonies in HM can be considered in order to prevent premature HM. If the new harmony x New is the best one when compared with every harmony in HM, the new harmony can consider an additional process named accidentaling. In music, an accidental is a note whose pitch is not a member of a scale and the accidental sign raises (#) or lowers (b) the following note from its normal pitch as shown in Figure 8. Likewise, HS can further pitch-adjust every note of the new harmony if it is the ever-best harmony, which may find an even better solution:
⎧ x (k ± m) for discrete var. xiNew ← ⎨ i , i = 1, … , n ⎩ xi ± ∆ for continuous var.
(14)
Fig. 8 Accidental for the Note Sol
2.6 Performing Termination If HS satisfies termination criteria (for example, reaching MI), the computation is terminated. Otherwise, HS improvises another new harmony again.
2.7 Cadenza Cadenza is a musical passage occurring at the end of a movement. In the context of the HS algorithm, cadenza can be referred to a process occurring at the end of the HS computing. In this process, HS returns the best harmony ever found and stored in HM.
3 Conclusions This chapter arranged the up-to-date structure of the HS algorithm. Those, who are interested in applying the algorithm to their own optimization problems, may customize the structure into their problems. The HS algorithm is still growing. The author hopes other researchers to suggest new ideas to make better shape of the algorithm structure.
10
Z.W. Geem
References 1. Geem, Z.W.: Novel derivative of harmony search algorithm for discrete design variables. Applied Mathematics and Computation 199, 223–230 (2008) 2. Geem, Z.W.: Music-inspired harmony search algorithm: theory and applications. Springer, Berlin (2009) 3. Geem, Z.W.: Harmony search algorithms for structural design optimization. Springer, Berlin (2009) 4. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved harmony search algorithm for solving optimization problems. Applied Mathematics and Computation 188, 1567– 1579 (2007) 5. Mukhopadhyay, A., Roy, A., Das, S., Das, S., Abraham, A.: Population-variance and explorative power of harmony search: an analysis. In: Proceedings of 3rd IEEE International Conference on Digital Information Management (ICDIM 2008), pp. 13–16 (2008) 6. Geem, Z.W.: Optimal cost design of water distribution networks using harmony search. Engineering Optimization 38, 259–280 (2006) 7. Wang, C.M., Huang, Y.F.: Self-adaptive harmony search algorithm for optimization. Expert Systems with Applications (2009), doi:10.1016/j.eswa.2009.09.008 8. Degertekin, S.: Optimum design of steel frames using harmony search algorithm. Structural and Multidisciplinary Optimization 36, 393–401 (2008) 9. Geem, Z.W.: Improved harmony search from ensemble of music players. In: Gabrys, B., Howlett, R.J., Jain, L.C. (eds.) KES 2006. LNCS (LNAI), vol. 4251, pp. 86–93. Springer, Heidelberg (2006)
Harmony Search Optimization Algorithm: Application to a Reconfigurable Mobile Robot Prototype He Xu , X.Z. Gao , Tong Wang , and Kai Xue 1
2
3
Abstract. The terrain of the mobile robot provides the only and powerful thrust. Therefore, the optimal prototype design with respect to the terrain is important for the robot in the sandlot or soft soiled environments. In this chapter, a Harmony Search Multi-Objective Optimization (HSMOO) with constraints is proposed to the design of a reconfigurable mobile robot with respect to the terramechanics, and the optimal configuration prototype is then obtained. The actual condition shows that in the process of mobile robot design and manufacture, the HSMOO is effective to the issue of the mobile robot reconfiguration.
1 Introduction One of the most important requirements for the mission-oriented mobile robot is to be adaptive to different missions, such as various payloads, terrains, and stability margins. Reconfiguration is a necessary solution for the mobile robot to handle these difficulties. In the past decades, there are several representative resolutions. The Sojourner that was landed in Mars used the rocker-bogie locomotion with deploy and stow state [1], the mini rover Go-For had an active wheel-legged locomotion with reconfigurable postures [2-3], the Nano Rover utilized posable-truct chassis with different prototypes toward different terrains and mission conditions [4], and the Nomad made by the CMU maneuvered with diversified prototypes by the transformed chassis [5]. The rover SMC had the parent and daughter rovers [6]. A retractable chassis had the ability of changing He Xu and Kai Xue College of Mechanics and Electrics Engineering, Harbin Engineering University, Harbin 150001, China E-mail:
[email protected],
[email protected] X.Z. Gao Department of Electrical Engineering, Helsinki University of Technology, Otakaari 5A, FIN-02150 Espoo, Finland E-mail:
[email protected] Tong Wang College of Information and Communication, Harbin Engineering University, Harbin 150001, China E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 11–22. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
12
H. Xu et al.
the chassis length [7]. The in-wheel propulsion of a desert-traversing vehicle was studied with respect to the terrain [8], and a novel wheel with an unexpectedly large steering resistance was developed for simulating the features of camera feet [9]. A reconfigurable wheeled mobile robot was also developed with alternative sizes and different trafficability metrics to adapt to uneven terrain [10]. However, its parameters were not optimized. This paper is organized as follows. Details of the reconfigurable prototypes of the mobile robot are introduced in Section 2. The mass modeling of the robot is presented in Section 3. The stability model of the reconfigurable mobile robot is rendered in Section 4. The wheel resistance based on the terramechanics is investigated in Section 5. An emerging optimization method, namely Harmony Search (HS), is presented in Section 6. The optimal design of the reconfigurable prototype based on HSMOO with constraints is discussed in Section 7. Finally, some remarks and conclusions are drawn in Section 8.
2 Mission-Oriented Mobile Robot and Desired Prototypes The factors involved in the design process and characters of the aforementioned robot are shown in Fig. 1. Since there are too many factors, a synthesis and tradeoff design is needed in terms of the robot’s trafficability, stability, maneuver ability, etc. The wheels of the robot can be adjusted around two pivots of the wheel arms, and this structure makes the wheels generate the caster and camber similar to the ones in an automobile, and the aligning force is generated to guarantee the straight motion ability of the wheels. The robot’s wheelbase, wheel stance, clearance, caster, camber, longitudinal stability margin, and latitudinal stability margins are all adjustable, due to the T
reconfigurable variables: x = ⎡⎣l , h, α f , β f , α b , βb , d w , bw ⎤⎦ , where this component
consists of the adjustable rocker length l, the rocker height h, the front wheel caster & camber α f , β f , the rear wheel caster & camber α b , β b , and the wheel diameter & width d w , bw .
3 Mass Model of Reconfigurable Mobile Robot The mass distribution of a mobile robot is the most important factor to ensure lower cost, high trafficability, etc. The scopes of the parameters of the wheel have been determined by using the ANSYS in terms of the structure strength and stability, as illustrated in Fig. 2. From the Pro-E model of the wheel, the mass of our robot is:
m = 4(mw + mar + mst ) + mbox ,
(1)
where mw is the mass of the wheel, mar is the rocker mass, mst is the mass of the steering mechanism, and mbox is the mass of the robot body.
Harmony Search Optimization Algorithm
13
Fig. 1 Diagram of mission analysis, conceptual design, modeling, optimization, and manufacture of a reconfigurable mobile robot prototype
14
H. Xu et al.
Fig. 2 Wheel stress distribution
4 Model of Stability of Reconfigurable Mobile Robot The isometric view of the prototype of the mobile robot with coordinates is shown in Fig. 3.
Fig. 3 Robot prototype in 3-D coordinates
Harmony Search Optimization Algorithm
15
Coordinate ( X 1 − Y1 − Z1 ) denotes the front right wheel, axis X 1 , Y1 and Z1 are along the longitudinal, transverse, and latitudinal respectively. Similarly, ( X 2 − Y2 − Z 2 ), ( X 3 − Y3 − Z 3 ), and ( X 4 − Y4 − Z 4 ) represent the coordinates for front left wheel, rear right wheel, and rear left wheel, respectively. The meanings of these symbols are depicted in the above figures. More relevant details are given in literature [11]. From Fig.2 and Fig.3, we have calculation for the margin of robot stability.
4.1 Longitudinal Stability Margin The following condition is assumed to be satisfied: (L/2Hcog) > µlg, and (W/2Hcog) > µlt, where µlg and µlt represent the longitudinal and later attachment coefficients, respectively. L is the equivalent wheelbase. Hcog is the height of the robot gravity centre. The longitudinal stability margin of the robot is:
⎛ ⎜ ⎝
φlg = min ⎜ arctan
Lf H cog
, arctan
Lb H cog
⎞ ⎟⎟ , ⎠
(2)
where L f is the longitudinal front equivalent supporting length of the robot, Lb is the longitudinal rear equivalent supporting length of the robot, and H cog is the height of the center of gravity of the robot respectively.
4.2 Lateral Stability Margin The lateral crosswise stability margin is given as follows:
φlt = arctan(0.5
Weg H cog
).
(3)
5 Wheel Resistance Based on Terramechanics For our optimal design of the robot prototype, the motion of the mobile robot can be analyzed with the robot of rigid wheels rolling into the inclined soft terrain. The static stability is then determined for the worst case where a maximum acceleration vector is added as the transformation to the dynamic circumstance. Assume that the weight of the robot is supported by the two rear wheels, i.e., a 1/2 model of robot is used with the threshold of stability. This threshold is considered as the point, where the center of gravity of the machine crosses above the rear wheels’ point of contact. Fig.4 shows the relations of the inertia force, motion resistances, and mobile robot motion, etc.
16
H. Xu et al.
Fig. 4 Analysis of resistances of robot on sandy slope in 1/2 model
When robot climbs a sandy slope, the torque due to resistive forces is: Tdrw = ( Fa + Rc + Rb + Rr + Rg )
dw 2
(4)
where Fa denotes the inertia force; Rc denotes the soil compaction resistance; Rb denotes the bulldozing resistance; Rr denotes the rolling resistance; Rg denotes the gravitational resistance; and dw is the diameter of the rigid wheel.
6 Harmony Search (HS) Method The Harmony Search (HS) method is an emerging meta-heuristic optimization algorithm, which is inspired by the underlying principles of the musicians’ improvisation of the harmony [12]. When the musicians compose harmony, they usually try various possible combinations of the musical pitches stored in their memory. Such an efficient search for a perfect state of harmony is analogous to the procedure for finding the optimal solutions to engineering problems. Table 1 presents the comparison between the harmony improvisation and optimization. Fig.5 shows analogy and flowchart of the basic HS method.
Harmony Search Optimization Algorithm
17
Fig. 5 Analogy and flowchart of basic HS method Table 1 Comparison between harmony improvisation and optimization Comparison factors
Harmony improvisation
Optimization Objective function
Targets
Aesthetic standard
Best states
Fantastic harmony
Global optimum
Components
Pitches of instruments
Values of variables
Process units
Each practice
Each iteration
18
H. Xu et al.
● Step 1. Initialize the HS Memory (HM). The HM consists of a number of randomly generated solutions to the optimization problems to be solved. For an n-dimension problem, an HM with a size of N can be represented as follows:
⎡ x11 , x12 ,", xn1 ⎤ ⎥ ⎢ 2 2 x1 , x 2 ,", x n2 ⎥ ⎢ HM = , ⎥ ⎢# ⎥ ⎢ N N N ⎣⎢ x1 , x2 ,", x n ⎦⎥
(5)
where [x1i , x2i ,", xni ] ( i = 1,2, " , N ) is a candidate solution. Note that the HM stores the past search experiences, and plays an important role in the optimization performance of the HS method. ● Step 2. Improvise a new solution [x1′, x2′ ,", xn′ ] from the HM. Each component of this solution, x′j , is obtained based on the Harmony Memory Considering
Rate (HMCR). The HMCR is defined as the probability of selecting a component from the HM, and (1-HMCR) is, therefore, the probability of generating it randomly. If x′j comes from the HM, it is chosen from the j th dimension of a random HM member, and it can be further mutated depending on the Pitching Adjust Rate (PAR). The PAR determines the probability of a candidate from the HM to be mutated. The improvisation of [x1′, x′2 ,", xn′ ] is similar to the production of offspring in the Genetic Algorithms (GA) with the mutation and crossover operations. However, the GA usually create new chromosomes using only one (mutation) or two (crossover) existing ones, while the generation of new solutions in the HS method makes full use of all the HM members. ● Step 3. Update the HM. The new solution from Step 2 is evaluated. If it yields a better fitness than that of the worst member in the HM, it will replace that one. Otherwise, it is eliminated. ● Step 4. Repeat Step 2 to Step 3 until a termination criterion is met.
Similar to the GA, the HS method is a random search technique. It does not need any prior domain knowledge beforehand, such as the gradient information of the objective functions. Nevertheless, different from those population-based approaches, it utilizes only a single search memory to evolve. Hence, the HS method imposes few mathematical requirements, and has the distinguishing advantage of computation simplicity. On the other hand, it occupies some inherent drawbacks, e.g., weak local search ability. Mahdavi et al. propose a modified HS method by using an adaptive PAR to enhance its optimization accuracy as well as speed up the convergence [13]. To summarize, the features of multi-candidate consideration and correlation among the variables contribute to the flexibility of
Harmony Search Optimization Algorithm
19
the HS method, thus making it well suited for the constrained and multi-objective optimal design problems [14]. During the recent years, it has been successfully applied in the areas of function optimization, mechanical structure design, and pipe network optimization.
7 Optimal Design of Reconfigurable Prototype of Mobile Robot The Multi-Objective Optimization (MOO) of the reconfigurable mobile robot means, under certain constraints such as clearance, obtaining the optimal reconfiguration variables α f , α b , β f , β b , l , h , d w , and bw in order to minimize the objective function F(x) , which can be formulated as
⎧⎪ min max F(x)={ f1 , f 2 , f 3 } x f , ⎨ ⎪⎩s.t. G(x) ≤ 0; l b ≤ x ≤ U b
(6)
T
where x = ⎡⎣l , h, α f , β f , α b , βb , d w , bw ⎤⎦ is the optimal variable vector, l b , U b are the vectors with the variable scope, and G( x) gives the constraints of the linear equalities and inequalities. To put it into more details, the first objective f1 concerns the stability of our mobile robot, which is the first factor to ensure the trafficability. From (2) and (3), there is: f1 = w1 / φlg + w2 / φlt ,
(7)
where w1 and w2 are two given weights. We have w1 ≥ 0, w2 ≥ 0, w1 + w2 = 1 . The second objective f 2 concerns the resistance torque of the rear propulsive wheel to ensure the traction of the mobile robot. From (4), there is: f 2 = Tdrw .
(8)
The third objective f 3 concerns the mass of the robot. From (2), there is: f3 = m .
(9)
Obviously, this is a typical MOO problem, and the ranges of the design variables are as follows: 0.52 ≤ l ≤ 0.658; − 0.103 ≤ h ≤ 0.036; − 12 ≤ α f ≤ 20; −12 ≤ β f ≤ 28; − 28 ≤ α b ≤ 12; − 12 ≤ β b ≤ 28;
0.076 ≤ d w ≤ 0.3; 0.04 ≤ bw ≤ 0.2;
The constraints due to the stability are θ − φlg ≤ 0 , and the constraints due to the clearance must ensure H c 0 − H c ≤ 0 .
20
H. Xu et al.
The parameters of the terramechanics are given in Table 2. Table 2 Parameters of Terramechanics Item (Unit) Exponent of soil deformation n Cohesion of soil c (kPa) Angle of internal friction of the soil φ (°)
Value 1.0 3.0 40
Velocity (m/s) cohesive coefficient k (kN/mn+1) c Frictional module of soil deformation kφ
10 850
Coefficient of rolling resistance f r (°)
0.05
We employ the HSMOO with constraints method to deal with the above Multi Objective Optimization design of the configuration of the mobile robot. More precisely, two separate HMs are used in the HS method: one is for the evolution of the harmony members, and the other is considered as an external repository storing the Pareto optimal solutions that have been found. The Pareto optimality is used as the ranking criterion for sorting the members in the first HM. If a new solution candidate is better than the worst HM member, it will be replaced with this new solution. At each iteration step, all the non-Pareto-dominated HM members in the first HM are migrated to the second HM. In the simulations, a total of five Pareto optimal solutions can be obtained in our HS method as given in Table 3. Table 3 Optimal configurations of mobile robot prototype obtained by HS method Item
l
h
αf
βf
αb
βb
dw
bw
f1
f2
f3
1 0.5856 -0.0931 -9.1216 26.4915 -23.5787 11.3027 0.0995 0.1819 53.5208 11.1125 35.18 2 0.5678 -0.0962 -11.4766 1.1594 -15.2913 17.0498 0.2054 0.0798 46.9499 18.4725 35.18 3 0.5339 -0.0903 -11.5635 3.1792 -13.6655 3.6762 0.2035 0.0542 45.8246 19.8231 35.18 4 0.5519 -0.0676 10.1818 14.8644 3.8979
5.2018 0.0880 0.1601 56.1625 10.9106 35.18
5 0.5392 -0.0748 -5.6409 12.1517 -17.1125 -4.0474 0.0794 0.1595 58.4153 10.5465 35.18
Note that the optimal f 3 is always 35.1800. The approximated Pareto front of this MOO problem is illustrated in Fig. 6. Compared with the conventional Minimum-Maximum method, the HS-based approach can provide us with multiple Pareto optimal solutions as in Table 3. Therefore, an appropriate compromise needs to be made when choosing the best prototype. As an example, the optimal solution is F(xopt) = {46.2810°, 17.5091Nm, 35.1800kg}. Apparently, we can get the optimal x : l = 0.52m , h = −0.103m , α f = −12D , β f = −12D ,
α b = −28D , βb = −12D , d w = 0.2m , and bw = 0.1m .
Harmony Search Optimization Algorithm
21
20
Sandlot Resistance Torque f2 (N.m)
19 18 17 16 15 14 13 12 11 10 45
50
55
60
Stability f1 (degree)
Fig. 6 Pareto optima of mobile robot configuration acquired by HSMOO
8 Summary and Conclusions In this chapter, the design synthesis frame work of a reconfigurable mobile robot traversing over the sandlot or sandy terrain is firstly presented in terms of the mission requirements, terramechanics and the performance of mobile robot. Then the quantitative model of the robot stability, robot mass and wheel resistance torque was built with respect to Pro-E model, terramechanics and the robot performance constraints such as the stability and clearance. A HS-based MOO technique is next employed to obtain the optimal reconfigurable robot prototype. The result showed that optimal prototype by HSMOO is effective.
Acknowledgements The authors would like to thank all the collaborators in this joint research project. This work was supported by the National Science Foundation of China under Grant 60775060, the Foundation Research Fund of Harbin Engineering University under Grant HEUFT07027, Natural Science Foundation of the Heilongjiang Province of China under Grant F200801, and Specialized Research Fund for the Doctoral Program of Higher Education under Grant 200802171053. X. Z. Gao’s work was also funded by the Academy of Finland under Grant 214144.
References 1. Apostolopoulos, D.: Systematic configuration of robotic locomotion. Technical Report CMU-RI-TR-96-30, The Robotics Institute, Carnegie Mellon University, Pittsburgh, PA (1996)
22
H. Xu et al.
2. Jet Propulsion Laboratory. Mars Pathfinder. News Online (1998), http://mars.jpl.nasa.gov/MPF/index1.html (accessed 8 April 1998) 3. Jet Propulsion Laboratory. Mars Exploration Program. News Online (2000), http://mpfwww.jpl.nasa.gov/ (accessed November 2000) 4. Sreenivasan, S.V., Wilcox, B.H.: Stability and traction control of an actively actuated micro- rover. Journal of Robotic Systems 11, 487–502 (1994) 5. Kubota, T., Kuroda, Y., Kunii, Y.: Micro planetary rover Micro5. In: 5th International Symposium on Artificial Intelligence, Robotics and Automation in Space (ISAIRAS 1999), Noordwijk, Netherlands, June 1-3 (1999) 6. Shigeo, H.: Super-mechano-colony and SMC rover with detachable wheel units. In: COE Workshop 1999, Tokyo, Japan, August 20-24 (1999) 7. Apostolopoulos, D.: Analytical configuration of wheeled robotic locomotion. Technical Report CMU-RI-TR-01-08, The Robotics Institute, Carnegie Mellon University, Pittsburgh, PA (2001) 8. Zhuang, J.D.: Biomimetics wheel simulating a camera feet. In: Zhuang, J.D. (ed.) dvanced Technology of Tire. Beijing Machine Industry Press, Beijing (2001) 9. Chen, Z.: Research of a compound walking wheel having retractile laminas with application to lunar rover. Master thesis, Jilin University (2007) 10. Fu, Y., Xu, H., Ma, Y.: A navigation robot with reconfigurable chassis and bionic wheel. In: IEEE International Conference on Robotics and Biomimetics (ROBIO 2004), Shenyang, China, August 22-25 (2004) 11. Xu, H., Tan, D.W., Zhang, Z.Y.: Optimization of mobile robot based on projection method and harmony search. In: IEEE International Conference on Robotics and Biomimetics (ROBIO 2004), Bangkok, Thailand, February 21-26 (2008) 12. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 13. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved harmony search algorithm for solving optimization problems. Applied Mathematics and Computation 188, 1567– 1579 (2007) 14. Gao, X.Z., Wang, X., Ovaska, S.J.: Harmony search methods for multi-modal and constrained optimization. In: Geem, Z.W. (ed.) Music-Inspired Harmony Search Algorithms. Springer, Berlin (2009)
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms Panwadee Tangpattanakul, Anupap Meesomboon, and Pramin Artrit
1
Abstract. This research proposes a method of obtaining an optimal trajectory of robot manipulator by using Harmony Search (HS). Despite the fact that the Sequential Quadratic Programming (SQP) is popular as a solving method for optimum trajectory problems, SQP needs a suitable initial value. The HS algorithm does however not require such process of setting initial value. Two results are compared using minimum traveling time as the objective function since time is the vital key for productivity particularly in the industrial sector. The state variables of 6-DOFs robot arm are simulated and the kinematics constraints are also considered. The results show that HS obtains the better solution than SQP method with the unsuitable initial value. Moreover, the hybrid HS and SQP method, Hybrid Harmony Search Algorithm (HHSA) is effective and acceptable for solving the optimal trajectory problem without its initial value finding process. Therefore, the important role of HS is that it can be applied to assist SQP to converge to the global optimum.
1 Introduction In a robot manipulator application, a trajectory refers to a time history of position, velocity, and acceleration for each robot’s joint. At the present, many researches are developing algorithms for obtaining the optimal trajectory planning. Their works are different in three aspects: I) the objective function of the optimization problem, II) the trajectory form, and III) the optimization technique. The first aspect considers the objective function of the optimization problem consisting of: traveling-time [1], energy [2], and jerk minimization. The latest objective function requires for smoothing trajectory and reducing damage on actuators [3]. The second one is the trajectory forming in which certain points must be achieved. Thus, the trajectory is an interpolated function whose polynomial [4] or spline functions are commonly used. However, the polynomial function may occur the Runge’s phenomenon if the number of specified points is large because the high order polynomial leads to obtain the oscillation and overshoot. Hence, the spline function is chosen because it can avoid the Runge’s phenomenon. The last Panwadee Tangpattanakul, Anupap Meesomboon, and Pramin Artrit Department of Electrical Engineering, Faculty of Engineering, Khon Kaen University, Khon Kaen, Thailand E-mail:
[email protected], {anupap,pramin}@kku.ac.th Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 23–36. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
24
P. Tangpattanakul, A. Meesomboon, and P. Artrit
aspect is the optimization technique for solving the constrained optimization problem. There are many precedent researches developing in this problem: the DOT (Design Optimization Tool) program that combines the Lagrange Multiplier method, Golden Section, and Polynomial One-Dimension Search method [5]; Genetic Algorithm (GA) and Simulated Annealing (SA) [4]; Sequential Weight Increasing Factor Technique (SWIFT) and GA [6]; and Sequential Quadratic Programming (SQP) [7-9] are used for solving the optimization technique. In Chettibi’s work [7] suggests that SQP may obtain the local minimum. To converge the global minimum, changing initial value is thus needed. The SQP method and initial value finding algorithm are used in Gasparetto and Zonotto’s works [8-9]. The jerk minimization is applied when the objective function of the optimization problem and the traveling time are fixed. Their results show a major drawback of SQP technique as it only obtains a global minimum if the suitable initial value is set.
Fig. 1 The 6-DOFs robot manipulator
The Harmony Search (HS) and Hybrid Harmony Search Algorithm with SQP (HHSA) which do not require the initial value are employed for solving the optimization problem of the minimum time trajectory in this work. The minimumtime simulations of the 6-DOFs robot manipulator trajectory are illustrated, as seen in Fig. 1. The kinematics constraints (each joint velocity, acceleration, and jerk limitations) are also considered. Two types of spline functions, a cubic spline and a 5th degree B-spline, are employed to cover various trajectory forms. The cubic spline is used for a simple trajectory which has continuity in position, velocity, and acceleration while the 5th degree B-spline is a more complex trajectory where jerk pattern smoothness is also considered. The HS algorithm has the advantage that it does not require the suitable initial value and it is a global optimum search algorithm [10]. However, SQP method has the exactness and speed for converging to the local optimum. The SQP and HS results are presented and they show their advantages. Hence, the HHSA is a good alterative to be chosen to apply in this area because it has the strengths of both HS algorithm and SQP method.
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
25
This work is organized as follows. In Section 2, the research methodologies are explained. They consist of the formulation of spline trajectory, the constrained optimization problem and constraints. Section 3 describes the Harmony Search Algorithm in term of the optimization process. In Section 4, the simulation model of 6-DOFs robot arm minimum time trajectory is our test system. The results between the best solutions which are obtained by SQP and HS are compared and the hybrid method is also applied to this simulation. Finally, the work is concluded in Section 5.
2 Research Methodologies 2.1 Formulation of the Trajectory Clamped with Splines The cubic spline and the 5th degree B-spline are employed to the robot joint trajectories forms. They clamp a set of specified robot joint position values qj,i, where j and i represent a joint and a knot sequences, respectively. The knot is a set of position points that one joint moves from the initial position (knot 1) to the terminal position (knot n) and the joint arrives its series of knot at the time t1, t2,…, ti,…, tn, respectively. n is the number of via-points from the initial to the terminal. The joint position is also called a joint vector. Let hi (= ti+1 - ti) be the interval time [ti, ti+1]. In this section, the cubic spline and the 5th degree B-spline formulations are shown. • Cubic spline formulation The cubic spline is a piecewise 3rd degree polynomial function. The velocities and accelerations of the initial and terminal conditions (v1, vn, a1, and an) are specified to be zero. These conditions cause two equations of the cubic spline algorithm becoming zero and the path pattern cannot be solved. Therefore, two extra knots (position values at time t2 and tn-1) are added and their position values are not specified. Let Qj,i(ti) be the cubic polynomial for the j-th joint in the interval time [ti, ti+1]. The second derivative of Qj,i(t) is a linear interpolation, as seen in Fig. 2.
(t ) Q (t ) Q j ,i i+1
(t ) Q j ,i i
ti
t i +1
t
hi Fig. 2 Second derivative of cubic spline on time interval [ti, ti+1]
26
P. Tangpattanakul, A. Meesomboon, and P. Artrit
The second derivative of cubic spline can be written as [9]:
(t ) = ti +1 − t Q (t ) + t − ti Q (t ) ; i = 1, … , n − 1. Q j ,i j ,i i j ,i i +1 hi hi
(1)
Integrating equation (1) for the given points Qj,i(ti) = qj,i and Qj,i(ti+1) = qj,i+1, the following interpolation functions are obtained:
(t ) (t ) Q Q 2 2 Q j ,i (t ) = − j ,i i (ti +1 − t ) + j ,i i+1 (t − ti ) 2hi 2hi (t ) ⎤ ⎡ q (t )⎤ ⎡q hQ hQ + ⎢ j ,i+1 − i j ,i i+1 ⎥ − ⎢ i , j − i j ,i i ⎥ 6 6 ⎥⎦ ⎢⎣ hi ⎥⎦ ⎢⎣ hi
(2)
and
Q j ,i (t ) =
(t ) Q j ,i i 6hi
(ti+1 − t )3 +
(t ) Q j ,i i +1 6hi
(t − ti )3
(t ) ⎤ ⎡q hQ + ⎢ j ,i+1 − i j ,i i+1 ⎥ (t − ti ) 6 ⎢⎣ hi ⎥⎦ (t )⎤ ⎡q hQ + ⎢ i , j − i j ,i i ⎥ (ti+1 − t ) 6 ⎦⎥ ⎣⎢ hi
(3)
Using the continuity conditions on velocities and accelerations, a system of n-2 (t ), i = 2, 3, … , n − 1 is obtained linear equations solving for n-2 unknowns Q j ,i i as [5];
[
]
(t ) Q (t ) " Q (t ) AQ j ,2 2 j ,3 3 j , n −1 n −1
T
=B
(4)
In (4), the matrix A is non-singular matrix and entries of the matrix B are changed for each joint. Then, the extra knots position values can obtain from 2
q j , 2 = q j ,1 + h1v1 +
2
h1 h a1 + 1 Q j , 2 (t 2 ) 3 6 2
q j ,n−1 = q j ,n − hn −1vn +
(5)
2
hn−1 h (t ) . an + n−1 Q j ,n −1 n −1 3 6
(6)
Each joint of cubic spline trajectories and their derivatives are illustrated in Fig. 3-8.
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
27
Fig. 3 Cubic spline trajectory of joint 1
Fig. 4 Cubic spline trajectory of joint 2
Fig. 5 Cubic spline trajectory of joint 3
Fig. 6 Cubic spline trajectory of joint 4
Fig. 7 Cubic spline trajectory of joint 5
Fig. 8 Cubic spline trajectory of joint 6
Where
and
are position patterns (deg), are velocity patterns (deg/s), are acceleration patterns (deg/s2), are jerk patterns (deg/s3).
• 5th degree B-spline formulation The 5th degree B-spline is an interpolated function which is between the specified knots or via-points. The velocities, accelerations, and jerks of the initial and terminal conditions are specified to be zero. Therefore, two extra knots (position values at time t2 and tn-1) are added and their position values are not
28
P. Tangpattanakul, A. Meesomboon, and P. Artrit
specified similar to the cubic spline trajectory. Let Ni,p(t) be the pth degree base or blending function and CPQi, CPVi, CPAi, and CPJi are the control points of displacement, velocity, acceleration and jerk, respectively, which are weight coefficients. From the B-spline property, the nodes Uq1, Uq2,…, Uqm+1 are added for B-spline calculation and m = n+p+1. Where m+1, n+1, p are number of nodes, control points and degree of B-spline, respectively. The 5th degree B-spline trajectory is formulated as; n+1
q(t ) = ∑ CPQi N i , p (t )
(7)
i =1
where p = 5 and
ti + p+1 − t t − ti N i , p−1 (t ) + N i +1, p−1 (t ) ti + p − ti ti + p +1 − ti +1
N i , p (t ) =
⎧ 1 ; ti ≤ t ≤ ti+1 N i ,0 (t ) = ⎨ ⎩0 ; elsewhere. The 4th degree function of velocity is obtained as; n
v(t ) = ∑ CPVi N i , p−1 (t )
(8)
i =1
where
CPVi =
p (CPQi +1 − CPQi ) Uqi+ p +1 − Uqi +1
i = 1, 2, … , n. The acceleration function is obtained as; n−1
a (t ) = ∑ CPAi N i , p−2 (t )
(9)
i =1
CPAi =
where
p −1 (CPVi+1 − CPVi ) Uvi+ p − Uvi+1
i = 1, 2,…, n − 1. And the jerk function is obtained as; n −2
j (t ) = ∑ CPJ i N i , p −3 (t )
(10)
i =1
where
CPJi =
p−2 (CPAi+1 − CPAi ) Uai+ p−1 − Uai+1
i = 1, 2,…, n − 2. Where Uq, Uv, and Ua are position, velocity, and acceleration’s nodes as seen in Fig. 9.
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
29
Fig. 9 Example of a node sequence where the number of specified knots is 4
The CPVi, CPAi, and CPJi can be derived from CPQi. Therefore, the CPQi values can be obtained from the equations of the specified velocities, accelerations and jerks of the initial and the terminal conditions and the specified position at via-points in Table 1. A system of n+1 linear equations solving for n+1 unknowns CPQi , i = 1, 2, …, n + 1 is obtained. These linear equations are;
CPV1 = vinitial = 0, CPVn = v final = 0 CPA1 = ainitial = 0, CPAn = a final = 0
(11)
CPJ1 = jinitial = 0, CPJ n = j final = 0 and n +1
∑ N (τ ) ⋅ CPQ k =1
p ,k
i
j ,k
= VPR j ,i
(12)
where i = 1, 2, …, vp , vp is the number of specified knots in each joint. VPRj,i is the defined displacement value in j-th joint and i-th knot. Each joint of 5th degree B-spline trajectories and their derivatives are illustrated in Fig. 10-15. Note that jerk pattern in 5th degree B-spline trajectory is smoother than cubic spline.
Fig. 10 5th degree B-spline trajectory of joint 1
Fig. 11 5th degree B-spline trajectory of joint 2
30
P. Tangpattanakul, A. Meesomboon, and P. Artrit
Fig. 12 5th degree B-spline trajectory of joint 3
Fig. 13 5th degree B-spline trajectory of joint 4
Fig. 14 5th degree B-spline trajectory of joint 5
Fig. 15 5th degree B-spline trajectory of joint 6
Where
are position patterns (deg), are velocity patterns (deg/s), are acceleration patterns (deg/s2), are jerk patterns (deg/s3).
and
2.2 Constrained Optimization Problem The important consideration to increase the productivity is traveling time of robot manipulator. Therefore, the minimization of traveling time is here the investigated objective function. It leads to trajectories with large value of the kinematics quantities (velocities, accelerations and jerks). They cause to oscillate and overshoot which is difficult to control the position tracking. Moreover, the actuator can be damaged by sudden motion. Thus, the velocities, accelerations, and jerks constraints must also be considered in the optimization process. Hence, the objective function and constraints for finding the optimal trajectory planning problem can be formulated as: n −1
min ∑ hi i =1
subject to q j (t ) ≤ VC j , q j (t ) ≤ AC j , qj (t ) ≤ JC j ; j = 1, 2,…, N
(13)
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
31
where VCj, ACj, and JCj are the velocity, acceleration, and jerk constraints for j-th joint, respectively. N is the number of robot joints. The interval times hi between via-points are computed by the constrained optimization problem (13).
2.3 Constraints Formulation of Spline • Constraint formulation of cubic spline The velocity constraints of the optimization problem are formulated as the maximum absolute value of velocities at the extreme points ti or ti+1 or ti* where * Q * j ,i = Q j ,i ti = 0 in each interval [9]. The velocity constraints become:
( )
{
}
max Q j ,i (t i ) , Q j ,i (t i +1 ) , Q * j ,i ≤ VC j ; j = 1, 2,… , N ; and i = 1, 2, …, n − 1.
(14)
The acceleration constraints are formulated from the acceleration linear function and the maximum absolute value exists at ti or ti+1. The acceleration constraints are
{
}
, … , Q ≤ AC ; j = 1, 2, … , N . max Q j ,1 j ,n j
(15)
The jerk constraints are formulated from the rate of change of acceleration.
Q j , i +1 − Q j , i hi
≤ JC j ;
j = 1, 2,… , N ; and i = 1, 2,… , n − 1.
(16)
The equations (14) to (16) are the constraints of the optimization problem in equation (13). • Constraints formulation of 5th degree B-spline th rd nd The velocity, acceleration and jerk functions are 4 , 3 and 2 degree polynomial, respectively. Their constraints cannot be determined for some points like cubic spline. Hence, sampling of some points from their functions is applied in the simulation. In this work, sampling rate is set to 0.01 sec/sample.
3 Harmony Search Algorithm Harmony Search (HS) is a heuristic optimization algorithm [10]. It has been shown that HS outperforms various optimization methods in many optimization problems [11]. HS mimics the improvisation of music players for searching the better harmony. The HS flowchart is shown in Fig. 16. The Harmony Search (HS) algorithm has been developed by combining features of others heuristic optimization methods. It preserves the history of past vectors similar to Tabu Search (TS) and ability to vary the adaptation rate as Simulated Annealing (SA). Furthermore, HS manages several vectors simultaneously in the
32
P. Tangpattanakul, A. Meesomboon, and P. Artrit
process similarly to the Genetic Algorithm (GA). However, the major difference between GA and HS is that HS makes a new vector from all existing vectors and can independently consider each component variable in a vector, while GA utilizes only two of the existing vectors and keep the structure of gene.
Fig. 16 Harmony Search flowchart
4 Simulation Results The simulation results of cubic spline and 5th degree B-spline trajectories compare two techniques, SQP and HS since SQP becomes more increasingly used in the area of robot trajectory path planning [8-9]. The knot positions (via-points) and kinematics constraints of the joints of 6-DOFs robot manipulator system are shown in Table 1 and 2, respectively.
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
33
Table 1 Knot positions of each robot manipulator joint Joint
Point1 (deg)
Point2 (deg)
Point3 (deg)
Point4 (deg)
Point5 (deg)
Point6 (deg)
1
-10
2
20
Extra knot
60
20 120
Extra knot
55
50
35
3
15
100
-10
30
4
150
100
40
10
5
30
110
90
70
6
120
60
100
25
Table 2 Kinematics constraints of each robot manipulator joint Joint
Velocity (deg/s)
Acceleration 2 (deg/s )
Jerk 3 (deg/s )
1
100
60
60
2
95
60
66
3
100
75
85
4
150
70
70
5
130
90
75
6
110
80
70
• Cubic spline simulation results For the SQP method, the Gasparetto and Zanotto’s initial value finding algorithm is employed for the minimum traveling time trajectory planning. Since the SQP method requires the suitable initial value for solving the optimization problem. The initial vector is H0 = [0.6820 0.6820 1.7651 0.7179 0.7179]. The SQP simulation results (objective function value) when the number of digits is varied are shown in Table 3. Table 3 The SQP simulation results of cubic spline Digit’s number of initial values
Initial values vector (H0)
[1
0
[0.7
1 2 3 4
[0.6820
8.5310
0.7 1.8 0.7 0.7]
8.5726
0.68 1.77 0.72 0.72]
8.5310
0.682 1.765 0.718 0.718]
8.5310
0.6820 1.7651 0.7179 0.7179]
8.5310
[0.68 [0.682
1 2 1 1]
Minimum value of the objective function (sec)
34
P. Tangpattanakul, A. Meesomboon, and P. Artrit
For the HS method which does not need the initial value, the simulation results are shown in Table 4. Table 4 The HS simulation results of cubic spline Number of iterations
Minimum value of the objective function (sec)
10,000 50,000 100,000 200,000
8.5718 8.5607 8.5586 8.5577
The cubic spline simulation results show that HS obtains the better solution than SQP with the unsuitable initial value. Moreover, it can eliminate the initial value finding process [12]. • 5th degree B-spline simulation results For the SQP method, the initial vector is taken from Gasparetto and Zonotto’s algorithm which is H0 = [1.4138 1.4138 3.6594 1.4883 1.4883]. The SQP simulation obtains 8.4935 sec for the minimum traveling time, when the initial value is set suitably. For the HS method, the simulation results are shown in Table 5. Table 5 The HS simulation results of 5th degree B-spline Number of iterations
Minimum value of the objective function (sec)
10,000 50,000 100,000 200,000
10.2646 9.0735 8.5976 8.5709
The 5th degree B-spline simulation results show that SQP method with the proper initial value obtains the better solution. Since the SQP and the HS have different advantages, the hybrid method as Hybrid Harmony Search Algorithm (HHSA) is implemented to take the advantages of both techniques. The HHSA is hybridizing the Harmony Search (HS) algorithm with the Sequential Quadratic Programming (SQP) [13]. The HS can find near global optimum while the SQP is used to speed up local search and has the precision to find the local solution. Thus, the HHSA is an effective method for searching the exact global optimum. The HHSA has procedures which base on the HS. In each iteration, after it obtains the new vector, the SQP method is inserted on this step. The new vector is set to be the initial value for SQP method. Then the SQP solution is compared with the worst objective function value in HM. After that, it follows the HS procedures. In
Optimal Trajectory of Robot Manipulator Using Harmony Search Algorithms
35
last iteration, the best vector in HM is set to be the initial solution of SQP method. In this final step the SQP solution is the result of the optimization problem. The HHSA simulation results for cubic spline and 5th degree B-spline are shown in Table 6. Table 6 The HHSA simulation results after 10 iterations Trajectory forms
Minimum value of the objective function (sec)
Cubic spline 5th degree B-spline
8.5310 8.4935
The results of three optimization techniques are compared for cubic spline and 5th degree B-spline trajectories. The simulation results show that if the SQP initial value is not set properly, the SQP obtains the worse solution than the HS. However, the HHSA provides the better. Moreover, HHSA obtains the best solution without the initial value finding process where as SQP method requires. The results show that HS and HHSA are efficient enough to solve the optimal trajectory problem. It yields the best solution that gives the minimum time trajectory and satisfies the kinematics limitation constraints of the optimization problem.
5 Conclusions The trajectory planning of a 6-DOFs robot manipulator is set as our problem for finding the minimum time trajectory using HS. The cubic spline and 5th degree Bspline are employed to be the trajectory forms because they represent various types of work. The objective function is the minimum traveling time with kinematics constraints (velocity, acceleration, and jerk limitations). Three optimization techniques (HS, SQP, and HHSA) are compared. The results show that if the initial value for SQP method is not set properly, HS obtains the better solution than SQP. The HHSA results are as good as the SQP with the suitable initial value. The HHSA operates together with HS and SQP advantages. Moreover, HS and HHSA can eliminate the initial value finding process and they can reduce the error that may occur by the unsuitable initial value setting. Therefore, an important conclusion to address is that a heuristic algorithm like HS is simple and can be applied together with a conventional optimization algorithm like SQP in order to find a global optimum.
References 1. Piazzi, A., Visioli, A.: A global optimization approach to trajectory planning for industrial robots. In: Proceedings of the 1997 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 1997s), Grenoble, France, September 7-11 (1997) 2. Spangelo, I., Egeland, O.: Generation of energy-optimal trajectories for an autonomous underwater vehicle. In: Proceedings of the 1992 IEEE International Conference on Robotics and Automation, Nice, France, May 12-14 (1992)
36
P. Tangpattanakul, A. Meesomboon, and P. Artrit
3. Piazzi, A., Visioli, A.: Global minimum-jerk trajectory planning of robot manipulators. IEEE Transactions on Industrial Electronics 47, 140–149 (2000) 4. Garg, D.P., Kumar, M.: Optimization techniques applied to multiple manipulators for path planning and torque minimization. Enginnering Applications of Artificial Intelligence 15, 241–252 (2002) 5. Saramago, S.F.P., Steffen Jr., V.: Optimization of the trajectory planning of robot manipulators taking into account the dynamics of the system. Mechanism and Machine Theory 33, 883–894 (1998) 6. Zhu, X., Wang, H., Zhao, M.: Using nonlinear constrained optimization methods to solve manipulators path planning with hybrid genetic algorithms. In: Proceedings of IEEE International Conference on Robotics and Biomimetics (ROBIO), Shatin, Hong Kong, 29 June-3 July (2005) 7. Chettibi, T., Lehtihet, H.E., Haddad, M., et al.: Minimum cost trajectory planning for industrial robots. European Journal of Mechnics A/Solids 23, 703–715 (2004) 8. Gasparetto, A., Zanotto, V.: A new method for smooth trajectory planning of robot manipulators. Mechanism and Machine Theory 42, 455–471 (2007) 9. Gasparetto, A., Zanotto, V.: A technique for time-jerk optimal planning of robot trajectories. Robotics and Computer-Integrated Manufacturing 24, 415–426 (2008) 10. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 11. Lee, K.S., Geem, Z.W.: A new meta-heuristic algorithm for continuous engineering optimization: harmony search theory and practice. Computer Methods in Applied Mechanics and Engineering 194, 3902–3933 (2005) 12. Tangpattanakul, P., Artrit, P.: Minimum-Time Trajectory of Robot Manipulator Using Harmony Search Algorithm. In: 6th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTICON 2009), Chonburi, Thailand, May 6-9 (2009) 13. Fesanghary, M., Mahdavi, M., Minary-Jolandan, M., et al.: Hybridizing harmony search algorithm with sequential quadratic programming for engineering optimization problems. Computer Methods in Applied Mechanics and Engineering 197, 3080–3091 (2008)
Visual Tracking Using Harmony Search Jaco Fourie , Steven Mills, and Richard Green 1
Abstract. In this chapter we present a novel method for tracking an arbitrary target through a video sequence using the Harmony Search algorithm called the Harmony Filter. The Harmony Filter models the target using a color histogram and compares potential matches in each video frame using the Bhattacharyya coefficient. Matches are found using the Improved Harmony Search (IHS) algorithm. Experimental results show that the Harmony Filter can robustly track targets in challenging environments while still maintaining real-time performance. We compare the runtime and accuracy performance of the Harmony Filter with other popular methods used in visual tracking including the particle filter and the Kalman Filter. We show that the Harmony filter performs better in both speed and accuracy than similar systems based on the particle filter and the Unscented Kalman Filter (UKF).
1 Introduction A visual tracking system is one that can correctly and robustly identify an arbitrary target’s location across the frames of a video sequence. In general, the target moves from frame to frame and is found at a different position in every frame. The target can also change its appearance between frames due to being obscured by other objects, motion blurring, rotation, and various other effects often encountered in video sequences. This is a challenging problem since it is difficult to predict where the target will appear in the next frame and since targets can only be approximately identified due to their changing appearance. An example of a visual tracking system tracking the trajectory of a ball is shown in Figure 1. One of the most popular methods used to design visual tracking systems is the Kalman Filter [1, 2]. The Kalman Filter is a statistical recursive filter that can estimate the state of a linear system from noisy measurements. When the problem cannot be accurately modeled as a linear system, as is often the case in visual tracking, the Kalman Filter can be adapted by using nonlinear approximations. Two examples of adapted Kalman Filters used successfully in visual tracking are the Extended Kalman Filter (EKF) and the Unscented Kalman Filter (UKF) [3]. Jaco Fourie, Steven Mills, and Richard Green Computer Science and Software Engineering, University of Canterbury, Christchurch, New Zealand E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 37–50. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
38
J. Fourie, S. Mills, and R. Green
Fig. 1 An example of a tracking system tracking the trajectory of a ball. The white circles indicate the position of the ball through a series of frames [10].
However, the Kalman Filter models the position of the target and the noise in the system as a Gaussian distribution. This is often an inaccurate assumption and causes the tracking system to lose the target in challenging environments. For this reason more robust algorithms that make no assumptions about the system noise or the target distribution are often preferable. The particle filter is one such algorithm and has become popular in visual tracking systems due to its accurate performance in challenging tracking problems [4]. The particle filter is an importance sampling method that models the target’s position distribution as a point cloud using Monte Carlo sampling. It makes no assumptions about the shape of the distribution and can accurately model nonGaussian distributions. However, the accuracy of the particle filter is dependent on the number of particles used to model the distribution. As more particles are used the accuracy improves but so does the computational costs. The high computational cost of the particle filter often makes it impractical for real-time tracking systems. An alternate approach that has recently been investigated by several researchers is to use heuristic optimization algorithms to find and track the target. Most of these methods involve the use of a genetic algorithm or the particle swarm algorithm [5, 6, 7]. The advantage of these algorithms is that no assumptions are made
Visual Tracking Using Harmony Search
39
about the system noise or the target’s distribution within a frame. As a result the designer is free to model the target and its predicted movement in any way, which gives this approach the potential for increased accuracy in situations where other methods would be constrained to linear, continuous, or differentiable approximations that might not model the target correctly. However, the high computational cost associated with most of these algorithms keep them from being used in many tracking problems where real-time performance is required. In this chapter we introduce a novel method for visual tracking based on the Harmony Search algorithm called the Harmony Filter. The Harmony Filter treats the visual tracking problem as a frame-by-frame optimization problem that uses the Improved Harmony Search (IHS) algorithm to find the approximated optimal target position at every frame. We show that the Harmony Filter can accurately find the target even when it is poorly modeled for the surrounding environment while still maintaining real-time performance. This chapter is an overview of the Harmony Filter and interested readers are referred to [8] for more technical details. In the section that follows the design of the Harmony Filter is discussed. The focus will be on the way in which the visual tracking problem can be interpreted as an optimization problem, and the use of Harmony Search to find this optimum. Specific ways that Harmony Search was adapted to improve tracking performance will also be discussed. Section 3 gives some tracking results and compares the Harmony filter’s accuracy and performance with that of the particle filter and the UKF.
2 Design of the Harmony Filter By interpreting the visual tracking problem as an optimization problem the IHS algorithm can be used to find the optimal target position. We do this by modeling the target as a color histogram and comparing this histogram with candidate histograms generated from different regions of the frame. Histograms are compared using the Bhattacharyya coefficient that measures the similarity between histograms and is defined as N
Β(t , c) = ∑ t (i )c(i ) , i =1
where N is the number of bins in the histograms, and t and c are the histograms being compared [9]. This approach of modeling targets as color histograms and comparing them using the Bhattacharyya coefficient has been used successfully by various other researchers and has proven to be robust to many of the appearance changes that targets can undergo in a video sequence [9, 10]. At each frame in the video sequence candidate histograms are generated from possible target locations in the frame. Each candidate histogram is then compared with the histogram originally generated from the target and the one that is closest to the target histogram represents the most likely target position in the current frame.
40
J. Fourie, S. Mills, and R. Green
The problem to be optimized is then to find the region in the frame that generates the histogram that is most similar to the target histogram. The search space of candidate regions is every pixel position in the frame and can be very large depending on the video resolution. The distribution of the evaluation function we are optimizing is generally not Gaussian and is often multi-modal with many local optima that make it difficult for traditional optimization algorithms to find the global optimum. The Harmony Search algorithm is therefore an appropriate solution since it makes no assumptions on the search space or target distribution and is fast enough to allow for real-time performance.
2.1 Architecture The Harmony Filter tracking system consists of two components and is illustrated in Figure 2. The main tracker component, shown on the left, receives a constant image stream that is augmented to indicate the target position and rendered to screen. The user starts the system by choosing a target to track by drawing a box around it. The tracker then generates a reference histogram from the indicated region and stores it for future reference. The position of the target is approximated in real-time by the second component that forms the core of the Harmony Filter, the Harmony Search optimizer (HSO). The HSO is initialized by filling the harmony memory (HM) with candidate solutions based on the approximated position from the previous frame. This ensures quick convergence and maintains real-time performance.
Fig. 2 The Harmony Filter algorithm
Visual Tracking Using Harmony Search
41
2.2 Harmony Search Adapted for Visual Tracking The HSO is based on the Improved Harmony Search (IHS) algorithm in which the pitch adjustment rate (PAR) and bandwidth (BW) parameters are updated dynamically to move the focus from exploration at the start of the search to accurate convergence near the end [11]. The IHS algorithm improves the original HS algorithm by decreasing the number of iterations needed for convergence while maintaining high accuracy. It does this with the minimum amount of computational overhead which makes it well-suited to our real-time visual tracking system. 2.2.1 Initialization of the HM As mentioned before, the HM is initialized based on the previous position of the target. A predicted target position is calculated using a simple motion model that assumes steady velocity of the target between frames. This predicted position is then randomly perturbed by small amounts to create initial candidate solution vectors to fill the HM. For this problem we choose the state solution vector that specifies the target’s location, velocity and scale as
xi = [ x, y, x, y , s ] , where x, y is the location of the target in pixel coordinates, x , y is the velocity of the target and s is a scaling parameter that controls the size of the box around the target. The simple motion model used to initialize the HM is defined by
1 xt +1 = xt + xt + a x 2 1 yt +1 = yt + y t + a y 2 xt +1 = xt + a x y t +1 = y t + a y , where
a x , a y are randomly generated accelerations in the x and y directions.
Once the HM has been initialized new candidate solutions are improvised using the standard HS algorithm and the HM is updated until convergence to the optimal solution is detected. Since the predicted target position can be calculated from its velocity and previous position, only the x , y and s components are explored during the improvisation process. This speeds up the convergence by limiting the search space to only solution vectors that are mathematically possible. 2.2.2
Convergence Testing
Convergence is detected using three separate tests. If any of the three tests indicate that the algorithm converged, the algorithm is terminated and the best solution vector found in the HM is returned as the optimal target position.
42
J. Fourie, S. Mills, and R. Green
The first test measures the spatial distance between the best solution in the HM and worst. If the distance is smaller than some threshold and the best solution has a sufficiently high fitness weight (determined by its histogram distance from the reference target histogram) the test passes and convergence is assumed. This test works by assuming that HS has converged when all the solution vectors in the HM become nearly identical. This is usually a good indication that HS found the optimal solution but it is also possible that during the initialization phase all vectors gets initialized to an area far from the true target position. Erratic target motion often causes this situation where all candidate solutions in the HM are equally bad but spatially close together indicating possible convergence. It is therefore necessary to test the weight of the best vector in the HM and ensure that it is sufficiently high to be confident that HS converged to the correct position before the search is terminated. Figure 3 illustrates how this test would detect convergence in three common situations. When the first convergence test fails the second test counts the number of consecutive iterations that have not updated the HM. These idle iterations indicate that no progress is being made and that the target cannot be found or that convergence is slow. After a specified number of consecutive idle iterations it is assumed that no further progress will be made and the search is terminated. When both the first and second test fails the final test bounds the search to a maximum number of iterations. If the number of iterations exceeds the maximum the search is terminated. The convergence tests prevent wasted computations by terminating the search early when no progress is being made or when they detect that the optimal solution has been found. It is important to keep wasted computations to a minimum to ensure real-time performance.
Fig. 3 The first convergence test will fail if the candidates are spread out in the search space or if the best candidate histogram is not sufficiently similar to the reference target histogram. In the first example the candidates are too spread out and the search will continue. The second example shows incorrect convergence or bad initialization and the search will continue due to the best candidate not being similar enough to the target. In the last example the test passes and the search is terminated.
Visual Tracking Using Harmony Search
43
2.2.3 Lost Tracker Recovery In challenging environments the tracker often loses the target momentarily. This is usually due to the target becoming partially or fully occluded by other objects in the frame or the target moving out of frame. An example of this is seen in Figure 4. Erratic, unpredictable movement can also cause the tracker to become unable to find the target. When the tracker loses its target it must recover quickly and the HSO is reset to search the entire frame instead of concentrating on the area predicted by the motion model. Detection of a lost tracker is done by comparing the fitness weight of the best candidate from the previous frame with a specified threshold value. If the weight is below the threshold the tracker is considered lost and the search process is adapted until the best candidate’s fitness is again above the threshold. The search process is adapted by ignoring the motion model and initializing the HM with random solutions from the entire search space (the whole frame). The distributions used to generate random improvisations are also changed from normal around the motion model predicted solution, to uniform covering the whole search space. This indicates that the target can be anywhere in the frame and that all previous knowledge should be disregarded. The ability to quickly recover when the target is lost is one of the novel advantages that the Harmony Filter has over other popular tracking methods like the Kalman Filter. Often when the target moves out of frame or becomes occluded the motion model, which plays a larger role in the Kalman and particle filters, will lead the tracker away from the target’s true position. The tracker then becomes lost and will likely never recover if it only relies on its motion model for direction. The Harmony Filter generally recovers much more quickly due to its weak reliance on a predictive motion model.
Fig. 4 In this example the target is an orange square on the wall. In the left image the tracker is successfully tracking the target indicated by the red square drawn around the correct target position. In a later frame the hand occludes the target completely causing the tracker to lose the target.
44
J. Fourie, S. Mills, and R. Green
In the section that follows the Harmony Filter is compared with a particle filter and a UKF based tracking system in challenging conditions. Its ability to quickly recover from occlusion and erratic movement is shown to be a main reason for its increased overall accuracy and performance.
3 Results In this section the accuracy and performance of the Harmony Filter is illustrated using two example video sequences. We also compare the results with those obtained from particle filter and UKF based visual tracking systems. The video sequences were captured using a low-cost webcam at a resolution of 352×288 at 15 frames/second. The low frame rate combined with the low resolution and poor image quality makes it difficult to accurately model the target and predict its movement. To further complicate the examples, targets were chosen to move erratically and are often occluded. Accuracy in both examples is tested by first manually labelling each frame of the video sequence with the correct position of the target. Tracker accuracy is then calculated by measuring the Euclidean distance from the true target position to the position estimated by the target for each frame in the sequence. Each algorithm’s performance is measured by the amount of time it takes to process a single frame and return an estimated target position. In our first example a man walking along a footpath is chosen as the target. The target and surrounding environment is shown in Figure 5. The sequence starts with the target standing still for several frames at one end of the path and then quickly running in a zigzag way to the end of the path. Near the end of the path the target becomes partially occluded by leaves from the tree in the foreground. He then changes direction and runs back the way he came. The transition from standing motionless to quickly running, combined with rapid changes in direction from the zigzag motion, causes the motion model to fail in accurately predicting the target’s next location. This often causes the tracker to lose the target which makes this example highly appropriate for testing the tracker’s ability to recover from losing the target. The results from this test are shown in Figures 6 and 7. In Figure 6 the accuracy, measured as Euclidean distance from the true position, is compared with a UKF based tracker and a particle filter based tracker. In Figure 7 the performance is compared using the same set of tracker implementations. Two versions of the particle filter is investigated, one with 300 particles and one with 500. Notice from Figure 6 how the particle filter implementations were unable to recover from losing the target near the start of the sequence while the UKF and Harmony Filter managed to track the target for much longer. Near the end of the sequence the Harmony Filter loses the target before the UKF does but immediately starts recovering and eventually accurately captures that target again. However, when the UKF loses the target it just drifts further away without ever recovering.
Visual Tracking Using Harmony Search
45
Fig. 5 In this example the target is a man walking along a footpath. Bad light conditions, glare from the building in the background and glare from the wet footpath make this a challenging environment for color histogram based visual tracking.
Fig. 6 The accuracy of the Harmony Filter is compared with three other tracker implementations. In this example the particle filter implementations suffer from early target loss without recovery while both the UKF and Harmony Filter performs well until almost the end of the sequence. Both trackers eventually lose the target due to occlusion but the Harmony Filter eventually recovers while the UKF does not.
46
J. Fourie, S. Mills, and R. Green
Fig. 7 The performance of the Harmony Filter is compared with three other tracker implementations. The particle filter implementations lag behind the Harmony Filter and UKF implementations by at least 20ms while the performance difference between the harmony filter and the UKF is negligibly small for this example.
In Figure 7 one notices that the performance of the Harmony Filter varies much more than it does with the other trackers. This is due to the convergence detecting tests that might terminate the search early or late depending on its confidence in the solution. The particle filter implementations are clearly slower than both the UKF and the Harmony Filter but the difference in speed between the UKF and the Harmony Filter is negligible in this example with the Harmony Filter only being slightly faster on average. In the second example an orange square is chosen as the target and is often occluded by a much larger but similarly colored object (a hand). The target and environment is shown in Figure 4. As in the previous example the Harmony Filter’s accuracy and performance is compared with that of the UKF and two particle filter implementations. In this example the target is occluded for several frames by moving a hand in front of the camera lens. At the same time the camera is pulled and rotated randomly in all directions to simulate the worst possible erratic motion. During the sequence the target also moves out of frame for several frames forcing all implementations to lose the target. However, the target itself, a simple orange square, is much better represented by a color histogram model than the person in the previous example. This makes it easier for all tracker implementations to find the target and recover it when lost. The results from the accuracy comparison are shown in Figure 8. Notice that all implementations performed well at the beginning of the sequence before the target
Visual Tracking Using Harmony Search
47
gets occluded. However, at approximately frame 70, occlusion causes all four trackers to lose the target and must recover when the target becomes visible again. The Harmony Filter recovers quickly in most cases while the UKF and particle filters never fully recover in this example.
Fig. 8 The accuracy of the Harmony filter is compared with two particle filter implementations and a UKF implementation. The sub-image is an enlarged section of the graph illustrating and comparing performance immediately following a long period of occlusion. The Harmony Filter is shown to recover quickly from occlusion while the UKF and particle filters only momentarily recover the target for one or two frames.
An example comparing the behavior of the four trackers during occlusion recovery and erratic motion is shown in Figure 9. In this example each column represents a frame from the sequence and each row represents a tracker implementation. The Harmony Filter is more accurate in both scale and position compared to the other trackers. The Harmony Filter’s speed for this example is compared with that of the UKF and particle filter trackers in Figure 10. As in the first example, the Harmony Filter’s speed varies depending on the situation but performs faster on average than the other tracking implementations. In both the first and second examples we saw that the performance of the Harmony Filter is not as stable as that of the UKF and particle filter. This is due to the convergence detection scheme of section 2.2.2 that causes the algorithm to terminate early or late depending on how difficult the target was to find. The Harmony Filter’s ability to detect convergence early results in good average performance
48
J. Fourie, S. Mills, and R. Green
Fig. 9 Two frames from a challenging tracking sequence are used to compare the Harmony Filter’s ability to accurately recover the target with that of the UKF and particle filter based trackers. The first image row shows the Harmony Filter accurately indicating the target’s position while the UKF and particle filter trackers still need to recover the target.
over all frames but does not guarantee good performance on every frame unless the maximum number of iterations is bounded to be low enough. One should note that when more stable performance is required the first two convergence tests can be disabled causing the maximum number of iterations to be performed at each frame. The speed of the algorithm can then be controlled by the maximum number of iterations in the same way that the number of particles is used to control the speed of the particle filter.
Visual Tracking Using Harmony Search
49
Fig. 10 The performance of the Harmony filter in the second example is compared with that of the UKF and particle filter trackers. In most cases the Harmony Filter converges faster than its competitors.
4 Conclusions Accurate visual tracking has been the subject of much research and has traditionally focussed on statistical methods. The most success in this field has been obtained using variations of the Kalman and particle filters. However, these methods suffer when the surrounding environment makes it difficult to accurately model the target. In this chapter a visual tracking system based on the Harmony Search algorithm was introduced that could accurately track a poorly modelled target under challenging conditions. Unlike the Kalman and particle filter, no assumption on Gaussian system noise is made making the tracker more robust in situations where this assumption cannot be made. The accuracy of the Harmony Filter under challenging conditions was compared with that of the UKF and the particle filter. The Harmony filter was shown to be more accurate in general and is able to recover from losing the target in situations were neither the UKF nor particle filter was able.
References 1. Gutman, P., Velger, M.: Tracking Targets Using Adaptive Kalman Filtering. IEEE Trans. On Aerospace and Electronic Systems 26, 691–699 (1990) 2. Li, M., Hong, B., Cai, Z., Luo, R.: Novel Rao-Blackwellized Particle Filter for Mobile Robot SLAM Using Monocular Vision. International Journal of Intelligent Technology 1(1), 63–69 (2006)
50
J. Fourie, S. Mills, and R. Green
3. Li, P., Zhang, T., Ma, B.: Unscented Kalman Filter for Visual Curve Tracking. Image and Vision Computing, 157–164 (2004) 4. Isard, M., Blake, A.: Condensation – Conditional Density Propagation for Visual Tracking. IJCV 29(1), 5–28 (1998) 5. Minami, M., Agbanhan, J., Asakura, T.: Manipulator Visual Servoing and Tracking of Fish Using a Genetic Algorithm. Industrial Robot: An International Journal 26(4), 278–289 (1999) 6. Morsley, Y., Djouadi, M.S.: Genetic Algorithm Combined to IMM Approach for Tracking Highly Maneuvering Targets. IAENG International Journal of Computer Science 35 (2008); advanced online publication 19 February 2008 7. Sulistijono, I.A., Kubota, N.: Human Head Tracking Based on Particle Swarm Optimisation and Genetic Algorithm. Journal of Advanced Computational Intelligence and Intelligent Informatics 11(6), 681–687 (2007) 8. Fourie, J., Mills, S., Green, R.: Visual Tracking Using the Harmony Search Algorithm. In: IVCNZ 23rd International Conference on Image and Vision Computing New Zealand, pp. 1–6 (2008) 9. Kailath, T.: The Divergence and Bhattacharyya Distance Measures in Signal Selection. IEEE Trans. On Comm. Technology 15(1), 52–60 (1967) 10. Comaniciu, D., Ramesh, V., Meer, P.: Kernel-Based Object Tracking. IEEE Trans. Pattern Anal. Mach. Intell. 25(5), 564–575 (2003) 11. Mahdavi, M., Fesanghary, M., Damangir, E.: An Improved Harmony Search Algorithm for Solving Optimization Problems. Applied Mathematics and Computation 188, 1567–1579 (2007)
Web Text Mining Using Harmony Search Rana Forsati and Mehrdad Mahdavi *
**
Abstract. The Harmony Search (HS) algorithm in recent years has been applied in many applications in computer science and engineering. This chapter is intended to review the application of the HS method in the area of web document clustering. Clustering is a problem of great practical importance that has been the focus of substantial research in several domains for decades. It is defined as the problem of partitioning data objects into groups, such that objects in the same group are similar, while objects in different groups are dissimilar. Due to the high-dimension and sparseness properties of documents the problem of clustering becomes more challenging when we apply it on web documents. Two algorithms in literature were proposed for clustering web documents with HS which will be reviewed in this chapter. Also three hybridization of HS based clustering with K-means algorithm will be reviewed. It will be shown that the HS method can outperform other methods in terms of solution quality and computational time.
1 Introduction This chapter deals with the application of Harmony Search (HS) in web document clustering. First, two algorithms based on HS will be presented for clustering where they differ in representation of solutions and application of pitch adjusting process. Then we turn into some hybridization of HS based clustering with Kmeans algorithm to combine explorative power of HS based algorithm with finetuning power of K-means. Recently, as the web developed rapidly, a large collection of full-text documents in electronic form is available and opportunities to get a useful piece of information from the web are increased. On the other hand, it becomes more difficult to get useful information from such giant amount of documents. This causes that research areas such as information retrieval, information filtering and text clustering have been studied actively all over the world. Rana Forsati Department of Electrical and Computer Engineering, Shahid Beheshti University, G. C. Tehran, Iran E-mail:
[email protected] Mehrdad Mahdavi Department of Computer Engineering, Sharif University of Technology, Tehran, Iran, E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 51–64. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
52
R. Forsati and M. Mahdavi
Clustering is one of the crucial unsupervised techniques for dealing with massive amounts of heterogeneous information on the web [1]. The clustering involves dividing a set of documents into a specified number of groups. The documents within each group should exhibit a large degree of similarity while the similarity among different clusters should be minimized. Initially, document clustering was evaluated for enhancing the results in information retrieval systems [2]. Then, clustering has been proposed as an efficient way of finding automatically related topics or new ones; in filtering tasks [3] and grouping the retrieved documents into a list of meaningful categories, facilitating query processing by searching only clusters closest to the query [4]. On the web, this task has other additional roles; it can be used for enhancing search engine results, enhancing web crawling, and organizing the knowledge. Some of the more familiar clustering methods are: partitioning algorithms based on dividing entire data into dissimilar groups, hierarchical methods, density and grid based clustering, some graph based methods and etc. [5, 6]. The aim of clustering is to find the hidden structure underlying a given collection of data points. The clustering methods proposed in the literature can be classified into two major categories: discriminative (or similarity-based) approaches and generative (or model-based) approaches [7]. In similarity-based approaches, one optimizes an objective function involving the pairwise document similarities, aiming to maximize the average similarities within clusters and minimize the average similarities between clusters. Model-based approaches, on the other hand, attempt to learn generative models from the documents, with each model representing one particular document group. Model-based clustering assumes that the data were generated by a model and tries to recover the original model from the data. The model that we recover from the data then defines clusters and an assignment of documents to clusters. Modelbased clustering algorithms are particularly attractive as each iteration is linear in the size of the input. Also, online algorithms can be easily constructed for modelbased clustering using competitive learning techniques [7, 8]. In an overall categorization, we can divide the web document clustering algorithms from another view into two main categories: hierarchal and partitional algorithms. Hierarchical algorithms [9-12] create a hierarchical decomposition of the given dataset forming a dendrogram—a tree which splits the dataset recursively into smaller subsets and represent the documents in a multi-level and tree-like structure [13]. The hierarchical algorithms can be further divided into agglomerative algorithms or divisive algorithms [14]. In the agglomerative algorithms, each document is initially assigned to a different cluster. The algorithm then repeatedly merges pairs of clusters until a certain stopping criterion is met [14]. On the other hand, the divisive algorithms divide the whole set of documents into a certain number of clusters. Meanwhile partitioning methods cluster the data in a single level instead of a clustering structure, such as the dendrogram produced by a hierarchical technique [15-18].
Web Text Mining Using Harmony Search
53
Although hierarchical methods are often said to have better quality clustering results, usually they do not provide the reallocation of pages, which may have been poorly classified in the early stages of the text analysis [5]. Moreover, thetime complexity of hierarchical methods is quadratic [18]. On the other hands, in recent years the partitioning clustering methods are well suited for clustering a large document dataset due to their relatively low computational requirements [15-19, 13]. Partitioning methods try to partition a collection of documents into a set of groups, so as to maximize a pre-defined fitness value. The clusters can be overlapped or not. It seems that in recent years the partitioning clustering methods are well suited for clustering a large document dataset due to their relatively low computational requirements [11]. The time complexity of the partitioning technique is almost linear, which makes it widely used. In the field of clustering, Kmeans algorithm [20] is the most popularly used algorithm to find a partition that minimizes mean square error (MSE) measure, that, in a simple form, selects K documents as cluster centers and assigns each document to the nearest center. The updating and reassigning process can be kept until a convergence criterion is met. Although K-means is an extensively useful, simple, straightforward, easy to be implemented, and fast in most situations, it suffers from several major drawbacks that make it inappropriate for many applications [21]. The objective function of the K-means is not convex and hence it may contain local minima. Consequently, while minimizing the objective function, there is possibility of getting stuck at local minima (also at local maxima and saddle point). The performance of the Kmeans algorithm depends on the initial choice of the cluster centers. To deal with the limitations that exist in traditional partition clustering methods especially Kmeans, recently, new concepts and techniques have been entered into web data mining, with respect to increasing need for the web knowledge extraction. One major approach is to use machine learning [22, 6, 23] that includes several techniques. One of these techniques is optimization methods that try to optimize a predefined function, which can be very useful in web document clustering. The major challenges for document clustering consist currently in the following three domains [24]: very high dimensionality of the data (~ 10,000 terms), very large size of the databases (particularly the World Wide Web) and understandable description of the clusters. K-means [20] (or its variants) is a good choice for above challenges, because of its efficiency and effectiveness [18]. About the clustering of large document sets, a major part of efforts have been concerned to the learning methods such as optimization techniques. This is mostly owing to the lack of orthognality, and existing high dimension vectors. One of the advantages of partitional clustering algorithms is that they use information about the collection of documents when they partition the dataset into a certain number of clusters. So, the optimization methods can be employed for partitional clustering. Optimization techniques define a goal function and by traversing the search space, try to optimize its value. Regarding to this definition, K-means can be considered as an optimization method. Dividing n data into K clusters give rise to a huge number of possible partitions, which is expressed in the form of the Stirling number:
54
R. Forsati and M. Mahdavi
⎛K⎞ 1 K ∑ (− 1)K −i ⎜⎜ i ⎟⎟i n K ! i =1 ⎝ ⎠
(1)
This illustrates that the clustering by examining all possible partitions of n documents of t-dimensions into K clusters is not computationally feasible. Obviously, we need to resort to some optimization techniques to reduce the search space, but then there is no guarantee that the optimal solution will be found. Recently, the use of global optimization techniques, such as Genetic Algorithm (GA) [25], Self-Organizing Maps (SOM) [26] and Ant Clustering [27], has been used for document clustering. Particle Swarm Optimization (PSO) [28] is another computational intelligence method that has been applied to image clustering and other low dimensional datasets in [29, 30] and to document clustering in [31]. They are capable of searching for optimal or near-optimal solutions on complex, large spaces of possible solutions. Because of this advantage, it may represent another useful tool in the field of cluster analysis. Typically, these stochastic approaches take a large amount of time to converge to a globally optimal partition. Although various optimization methodologies have been developed for optimal clustering, the complexity of the task reveals the need for developing efficient algorithms to precisely locate the optimum solution. In this context, this study presents a novel stochastic approach for document clustering, aiming at a better time complexity and partitioning accuracy. In fact, in optimization problems, we want to search the solution space and with HS this search can be done more efficiently. Since stochastic optimization approaches are good at avoiding convergence to a locally optimal solution, these approaches could be used to find a globally optimal solution. Typically the stochastic approaches take a large amount of time to converge to a globally optimal partition. This chapter is organized as follows. In section 2 we concentrate on the modeling of documents as being suitable for clustering and the different measures for evaluation of clustering algorithm’s efficiency and quality. Then in sections 3 and 4 the HS based algorithms for document clustering will be presented.
2 Web Document Clustering: An Overview Clustering is defined as the problem of partitioning data objects into groups, such that objects in the same group are similar, while objects in different groups are dissimilar. This definition assumes that there is some well defined notion of similarity, or distance, between data objects. When the objects are defined by a set of numerical attributes, there are natural definitions of distance based on geometric analogies. These definitions rely on the semantics of the data values themselves. The definition of distance allows us to define a quality measure for a clustering. Clustering then becomes the problem of grouping together points such that the quality measure is optimized. In this section the process of transforming documents to vectors, similarity measures between document’s vectors and the clustering algorithm evaluation measures will be presented.
Web Text Mining Using Harmony Search
55
2.1 Document Representation and Similarity Computation In most document clustering algorithms, documents are represented using vectorspace model. In this model, each document d is considered to be a vector K d = {d1 , d 2 , …, d t } in term-space (set of document “words”) where d i is the weight of dimension i in vector space and t is the number of term dimensions. In text documents each weight d i represents the term weight of term i in the document. The most widely used weighting approach for term weights is the combination of Term Frequency and Inverse Document Frequency (TF-IDF) [32, 33]. In this approach the weight of term i in document j is defined as (2).
(
w ji = tf ji × idf ji = tf ji × log 2 n / df ji
)
(2)
Here tfji is the numbers of occurrences of term i in the document j; dfij is the total term frequency in data set and n is the number of documents. One of the major problems in text mining is that a document can contain a very large number of words. If each of these words is represented as a vector coordinate, the number of dimensions would be too high for the text mining algorithm. Hence, it is crucial to apply preprocessing methods that greatly reduce the number of dimensions (words) to be given to the text mining algorithm. In those document datasets, the very common words (e.g. function words: “a”, “the”, “in”, “to”; pronouns: “I”, “he”, “she”, “it”) are stripped out completely and different forms of a word are reduced to one canonical form by using Porter’s algorithm [28] . The similarity between two documents must be measured in some way if a clustering algorithm is to be used. The vector space model gives us a good opportunity for defining different metrics for similarity between two documents. The most common similarity metrics are Minkowski distances [34] and cosine measure [33-35]. Minkowski distances computes the distance of documents d and d ′ by (3) (for n = 2 it is converted to Euclidean distance). ⎛ t n⎞ Dn (d , d ′) = ⎜⎜ ∑ d i − d i′ ⎟⎟ ⎝ i =1 ⎠
1/ n
(3)
Cosine measure is defined by (4) where d T ⋅ d ′ is the inner product (dot-product) of two vectors. cos( d , d ′) =
dT • d′ d d′
(4)
where “ • ” denotes the dot product of two vectors, and “ • ” denotes the length of a vector. This measure becomes one if the documents are identical, and zero if there is nothing in common between them (i.e., the vectors are orthogonal to each other). Both metrics are widely used in the text document clustering literatures. But it seems that in the cases where the number of dimensions of two vectors differs
56
R. Forsati and M. Mahdavi
largely, the cosine is more useful. In cases which two vectors have almost the same dimension, Minkowski distance can also be useful.
2.2 Quality Measures To evaluate the performance of different clustering algorithms, we need some measures to evaluate them. Objective clustering evaluation criteria can be based on external, internal, or relative measures [36]. External measures use statistical tests in order to quantify how well a clustering matches the underlying structure of the data. An external quality measure evaluates how well the clustering is working by comparing the groups produced by clustering techniques to known classes. The most important external methods are entropy-based methods, confusion matrix, classification accuracy, average purity [25, 29], and F-measure [16]. In absence of an external judgment, internal clustering quality measures must be used to quantify the validity of a clustering. Internal quality measures are used to compare different sets of clusters without reference to external knowledge. Relative measures can be derived from internal measures by evaluating different clusterings and comparing their scores. However, if one clustering algorithm performs better than other clustering algorithms on many of these measures, then we can have some confidence that is truly the best clustering algorithm for the situation being evaluated. The F-measure tries to capture how well the groups of the investigated partition at the best match the groups of the reference. F-measure compute based on the harmonic means of precision and recall from information retrieval domain. If P and R show Precision and Recall respectively, this measure is defined by precision and recall obtained by (5). In the formulas nij shows the number of members of class j in cluster i (the number of the overlapping member), ni shows the number of members of cluster i and n j shows the number of members in class j. P (i , j ) =
nij ni
,
R(, i, j ) =
nij nj
(5)
The precision, P(i, j ) , is the fraction of the documents in the cluster i that are also in the class j. Whereas the recall, R(i, j ) , is the fraction of the pages in the class j that are in the cluster i. P(i, j ) and R(i, j ) take values between 0 and 1 and, intuitively, P(i, j ) measures the accuracy with which cluster i reproduces class j, while R(i, j ) measures the completeness with which i reproduces class j. The F-measure for a cluster i and class j combines precision and recall with equal weight on each as follows:
F (i, j ) =
2 × ( P(i, j ) R (i, j )) P (i , j ) + R (i , j )
(6)
Web Text Mining Using Harmony Search
57
The F-Measure of the whole clustering is: F =∑ j
nj n
max{F (i, j )}
(7)
The F-Measure tries to capture how well the groups of the investigated partition at the best match the groups of the reference. A perfect clustering matches the given partitioning exactly and leads to an F-Measure value of 1. The second evaluation measure used is the entropy measure, which analyzes the distribution of categories in each cluster. The measure entropy looks at how the various classes of documents are distributed within each cluster. First, the class distribution is calculated for each cluster, then this class distribution will be used to calculated the entropy for each cluster. The entropy E of a cluster ci is defined as:
E (ci ) = −∑ nij log(nij ) j
(8)
where nij is the probability that a member of cluster j belongs to class i and then the summation is taken over all classes. After the entropy is calculated, the summation of entropy for each cluster is calculated using the size of each cluster as weight. In other words, the entropy of all produced clusters is calculated as the sum of the individual cluster entropies weighted according to the cluster size, i.e., k
E=∑ i =1
ni × E (c i ) n
(9)
where ni is the size of cluster i, n is the total number of documents, and k is the number of clusters. The best clustering solution will be the one that leads to clusters that contain documents from only a single class, in which case the entropy will be zero. Because the entropy measures the amount of disorder in a system, the smaller the entropy values, the better the clustering solution is [37]. The purity measure evaluates the degree to which each cluster contains documents from primarily one class. In other words, it measures the largest class for each cluster. In general, the larger the value of purity, the better the clustering solution is. Note that each cluster may contain documents from different classes. The purity gives the ratio of the dominant class size in the cluster to the cluster size itself. The value of the purity is always in the interval ⎡ 1 ,1⎤ . A large purity val⎢⎣ K + ⎥⎦ ue implies that the cluster is a ‘‘pure” subset of the dominant class. In similar way as entropy, the purity of each cluster ci is calculated as P (c i ) =
1 max nij ni j
(10)
58
R. Forsati and M. Mahdavi
The purity of all produced clusters is computed as a weighted sum of the individual cluster purities and is defined as k
ni ∗ P ( ci ) i =1 n
P=∑
(11)
While entropy and the precision measures compare flat partitions (which may be a single level of a hierarchy) with another flat partition the F-measure compares an entire hierarchy with a flat partition.
3 HS Based Clustering: Continuous Representation In [38] the first HS based algorithm for document clustering was proposed. In this algorithm each cluster centroid is considered as a decision variable; so each row of harmony memory, which contains K decision variables, represents one possible solution for clustering. On the other hand, each row contains a number of candidate centroids that represents each cluster. In this case, each solution contains K vectors and forms a matrix row, (C1, C2, …, Ci , …, Ck), where Ci is the ith cluster centroid vector and K is the number of clusters. The objective function is to maximize intra-cluster similarity while minimizing the inter-cluster similarity. The centroid of documents belong to same cluster is computed as: n
∑ (aij )x j ci =
j =1
n
∑ aij
,
1≤ i ≤ K
(12)
j =1
According to improvising step in the HS algorithm, the new vector is generated in each generation. Fitness value of each row, which corresponds to one potential solution, is determined by Average Distance of Documents to the cluster Centroid (ADDC) represented by each solution. This value is measured by equation: ⎧ ni ⎫ ⎪ ∑ D(ci , d ij ) ⎪ k ⎪ j =1 ⎪ ⎬ ∑⎨ n i i =1 ⎪ ⎪ ⎪ ⎪ ⎩ ⎭ f = K
(13)
where K is the number of clusters, ni is the numbers of documents in cluster i, D is distance function, and d ij is the jth document of cluster i. The new generated solution is replaced with a row in harmony memory, if the locally optimized vector has better fitness value than those in HM.
Web Text Mining Using Harmony Search
59
Table 1 F-measure values of different algorithms Dataset
K-means
HS based clustering
DATASET1
0.65348
0.72250
DATASET1
0.70639
0.76560
DATASET3
0.6214
0.70465
The proposed algorithm is compared to K-means algorithm based on F-measure quality measure on three datasets [38]. DATASET1 is collected from Politics area and contains 176 web documents that are selected randomly in some topics of Politics. It is collected in 2006. DATASET2 is collected from News sites and contains 424 different news texts. This dataset is collected in 2006, as well. DATASET3 is selected from DMOZ collection and contains 697 documents. As is evident from Table 1, HS based clustering algorithm outperforms K-means in all datasets. The main drawback of the algorithm developed in [38] is its continuous representation. Continuous representation of clusters’ centroid decreases the efficiency of pitch adjusting process.
4 HS Based Clustering: Discrete Representation In [39] an algorithm called HKA with discrete representation is proposed for document clustering which codify the whole partition P of the document set in a vector of length n, where n is the number of the documents. Thus, each element of the solution is the label where the single document belongs to; in particular if the number of clusters is K each element of the solution vector is an integer value in the range {1..., K}. Let us consider a data set formed by n documents {d i , i = 1,2,… , n} . Also let d ij denote the weight of jth feature of document d i . An assignment that represents K nonempty clusters is a legal assignment. Each assignment corresponds to a set of K centroids C = (c1 , c 2 , … , ci , … , c K ) . Thus, the search space is the space of all permutations of size n from the set {1..., K} that satisfy constraint in which each document must be allocated to exactly one cluster and there is no cluster that is empty. A natural way of encoding such permutations into a string, s, is to consider each row of HM an integer vector of n positions. Each position corresponds to a document, i.e., the i-th position represents the i-th document. In this encoding, each element corresponds to a document and its value represents the cluster number to which the corresponding document belongs. Due to the discrete representation the original PAR process of HS is not applicable so the authors proposed an efficient way to apply PAR process. In improvisation step each value is selected from harmony memory with probability HMCR and with probability (1– HMCR) is randomly selected from set {1,2, … , K } . After generating the new solution, the PAR process is applied. PAR is originally the rate of allocating a different cluster to a document. To apply pitch adjusting process to
60
R. Forsati and M. Mahdavi
document d i the algorithm proceeds as follow. The current cluster of d i is replaced with a new cluster chosen randomly from the following distribution: P j = Pr { cluster j is selected as new cluster} =
Dmax − D ( d i , c j ) K
∑ ( Dmax − D(d i , c j ))
(14)
j =1
where Dmax = max i {D ( NHV , ci )} . Considering the behavior of HKA, it was found that the proposed algorithm is good at finding promising areas of the search space, but not as good as K-means at fine-tuning within those areas, so it may take more time to converge. On the other hand, K-means algorithm is good at fine-tuning, but lack a global perspective. So a hybrid algorithm that combines two ideas is proposed. In the hybrid algorithm at each improvisation step a one-step K-means is included to fine-tune the new solution. The HKA is compared with other algorithms on five standard datasets [39]. Table 2 shows the comparison of F-measure values for K-means and HKA algorithms. The results in Table 2 reveal that HKA outperforms K-means algorithm in all of datasets. Table 2 Comparison of HKA and K-means algorithms based on F-measure Document Set
K-means
HKA
DS1
0.5632
0.7662
DS2
0.5202
0.7824
DS3
0.6117
0.8968
DS4
0.7236
0.8692
DS5
0.4236
0.6805
Figure 1 shows the execution time of HKA algorithms with other four algorithms including K-means, Genetic K-means (GA), Particle Swarm Optimization based clustering (PSO) and a Mises-Fisher Generative Model based algorithm (GM)1 on DS5 [39]. The evaluations were conducted for the document numbers ranging from 1000 to approximately 10,000. For each given document number, 10 test runs were conducted on different randomly chosen documents, and the final performance scores were obtained by averaging the scores from the all tests. Because K-means algorithm is not guaranteed to find the global optimum, it is beneficial to perform Kmeans algorithm a few times with different initial values and choose the trial with minimal ADDC. The GM algorithm has the lowest runtime in comparison to all of other algorithms because the model-based partitional clustering algorithms often 1
An implementation of this algorithm is available at, http://www.cse.fau.edu/~zhong/ software/index.htm
Web Text Mining Using Harmony Search
61
have a complexity of O(n) where n is the number of documents. In contrast, in the other algorithms calculating the pairwise similarities is more time-consuming. For small number of documents the runtime of algorithms is approximately same, but by increasing the number of documents the difference becomes significant. The K-means algorithm has the worst runtime. The runtime of PSO and GA is nearly the same. HKA behaves better than other algorithms except the GM. Specially; the runtime of the HKA is comparable with the GM algorithm.
Fig. 1 Execution time of the HKA algorithm in comparison with GM, K-means, GA, and PSO algorithms on different sub collections of DS5 with different sizes
5 Hybrid HS Based Clustering In this section we review the final set of HS based algorithms for document clustering [40]. These algorithms are the hybridization of HSCLUST algorithm with K-means algorithm in different settings. HSCLUST is same as HKA without one step of K-means in its improvising step. Hybrid algorithms combine the explorative power of the HSCLUST with the fine-tuning power of the K-means algorithm. In the hybrid HS algorithm, the algorithm includes two modules, the HSCLUST module and the K-means module. The HSCLUST finds the region of the optimum, and then the K-means takes over to fine-tune the optimum centroids. In [40] three different approach were proposed for hybridization. In Sequential hybridization, the algorithm starts with HSCLUST algorithm and after a determined number of generations, the K-means algorithm starts with the best vector in harmony memory obtained by HSCLUST. In other words the HSCLUST finds
62
R. Forsati and M. Mahdavi
the proximity of best solution and K-means fine-tunes the obtained solution. In Interleaved Hybridization, after every determined iterations, the K-means uses the best vector from the harmony memory as its starting point. Harmony memory is updated if the locally optimized vectors have better fitness value than those in harmony memory and this procedure repeated until stop condition. The third algorithm hybridizes K-means as one step of HSCLUST. The performances of the algorithms in the document collections considering Fmeasure are shown in Fig. 2. In comparison of the results from different algorithms, obviously, the third hybridized algorithm has the best F-measure among the other algorithms from Figure 2.
Fig. 2 Comparison of the F-measure for hybridized algorithms with HKA and K-mean
6 Summary and Conclusions This chapter has reviewed various HS applications in finding a globally optimal partition with respect to ADDC criterion when grouping given web documents into a specified number of clusters. Two proposed algorithms in literature mainly differ in the type of representation of solutions (i.e. continuous and discrete variables). In addition some hybrid algorithms were reviewed in this chapter. The hybrid algorithms try to combine the explorative power of HS with fine-tuning power of another localized algorithm to find optimal solutions. The results show that HS based clustering algorithm is a good choice for clustering large set of documents. From this successful application, it is expected that more problems will be tackled with HS.
Web Text Mining Using Harmony Search
63
References 1. Húsek, D., Pokorný, J., Řezanková, H., et al.: Web data clustering. In: Foundations of Computational Intelligence, vol. 4. Springer, Berlin (2009) 2. Rijsbergen, V.: Information retrieval. Buttersworth, London (1979) 3. Aslam, J., Pelekhov, K., Rus, D.: Using star clusters for filtering. In: Proceedings of the Ninth International Conference on Information and Knowledge Management, USA (2000) 4. Zhong, S., Ghosh, J.: A comparative study of generative models for document clustering. In: Proceedings of SDM Workshop on Clustering High Dimensional Data and Its Applications (2003) 5. Jain, A.K., Murty, M.N., Flynn, P.J.: Data clustering: A Review. ACM Computing Surveys 31, 264–323 (1999) 6. Grira, N., Crucianu, M., Boujemaa, N.: Unsupervised and semi-supervised clustering: a brief survey. In: Proceedings of 7th ACM SIGMM International Workshop on Multimedia Information Retrieval, pp. 9–16 (2005) 7. Zhong, S., Ghosh, J.: Generative model-based clustering of documents: a comparative study. Knowledge and Information Systems (KAIS) 8, 374–384 (2005) 8. Zhong, S.: Semi-supervised model-based document clustering: A Comparative Study. Machine Learning 65, 3–29 (2006) 9. Guha, S., Rastogi, R., Shim, K.: An efficient clustering algorithm for large databases. In: Proceedings of ACM-SIGMOD Int. Conf. Management of Data (SIG-MOD 1998), pp. 73–84 (1998) 10. Karypis, G., Han, E.H., Kumar, V.: CHAMELEON: A hierarchical clustering algorithm using dynamic modeling. IEEE Computer 32, 68–75 (1999) 11. Olson, C.F.: Parallel algorithms for hierarchical clustering. Parallel Comput. 21, 1313– 1325 (1995) 12. Zhang, T., Ramakrishnan, R., Livny, M.: BIRCH: An efficient data clustering method for very large databases. In: Proceedings of ACM-SIGMOD Int. Conf. Management of Data (SIG-MOD 1996), pp. 103–114 (1996) 13. Zhao, Y., Karypis, G.: Empirical and theoretical comparisons of selected criterion functions for document clustering. Machine Learning 55, 311–331 (2004) 14. Xu, S., Zhang, J.: A parallel hybrid web document clustering algorithm and its performance study. Journal of Supercomputing 30, 117–131 (2004) 15. Cutting, D.R., Pedersen, J.O., Karger, D.R., et al.: Scatter/gather: A cluster-based approach to browsing large document collections. In: Proceedings of the ACM SIGIR Copenhagen, pp. 318–329 (1992) 16. Larsen, B., Aone, C.: Fast and effective text mining using linear-time document clustering. In: Proceedings of the Fifth ACM SIGKDD Int’l Conference on Knowledge Discovery and Data Mining, pp. 16–22 (1999) 17. Aggarwal, C.C., Gates, S.C., Yu, P.S.: On the merits of building categorization systems by supervised clustering. In: Proceedings of the Fifth ACM SIGKDD Int’l Conference on Knowledge Discovery and Data Mining, pp. 352–356 (1999) 18. Steinbach, M., Karypis, G., Kumar, V.: A comparison of document clustering techniques. In: KDD 2000, Technical Report, University of Minnesota (2000) 19. Dhillon, I.S.: Co-clustering documents and words using bipartite spectral graph partitioning. In: Knowledge Discovery and Data Mining, pp. 269–274 (2001) 20. McQueen, J.B.: Some methods for classification and analysis of multivariate observations. In: Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, pp. 281–297 (1967)
64
R. Forsati and M. Mahdavi
21. Anderberg, M.R.: Cluster analysis for applications. Academic Press Inc., New York (1973) 22. Stumme, G., Hotho, A., Berendt, B.: Semantic web mining. In: Proceedings of 12th Europ. Conf. on Machine Learning (ECML2001)/5th Europ. Conf. on Principles and Practice of Knowledge Discovery in Databases, PKDD 2001 (2001) 23. Stumme, G., Hotho, A., Berendt, B.: Semantic web mining state of the art and future directions. Journal of Web Semantics: Science, Services and Agents on the World Wide Web 4, 124–143 (2006) 24. Beil, F., Ester, M., Xu, X.: Frequen term-based text clustering. In: Proceedings of 8th Int. Conf. on Knowledge Discovery and Data Mining (KDD 2002), Edmonton, Alberta, Canada (2002) 25. Raghavan, V.V., Birchand, K.: A clustering strategy based on a formalism of the reproductive process in a natural system. In: Proceedings of the Second International Conference on Information Storage and Retrieval, pp. 10–22 (1979) 26. Cui, X., Potok, T.E., Palathingal, P.: Document clustering using particle swarm optimization. In: Proceedings of the IEEE swarm intelligence symposium, pp. 185–191. 27. Labroche, N., Monmarche, N., Venturini, G.: AntClust: ant clustering and web usage mining. In: Proceedings of Genetic and Evolutionary Computation Conference, pp. 25–36 (2003) 28. Kennedy, J., Eberhart, R.C., Shi, Y.: Swarm intelligence. Morgan Kaufmann, New York (2001) 29. Omran, M., Salman, A., Engelbrecht, A.P.: Image classification using particle swarm optimization. In: Proceedings of the 4th Asia-Pacific Conference on Simulated Evolution and Learning (SEAL 2002), pp. 370–374 (2002) 30. Merwe, V.D., Engelbrecht, A.P.: Data clustering using particle swarm optimization. In: Proceedings of IEEE Congress on Evolutionary Computation (CEC 2003), pp. 215–220 (2003) 31. Cui, X., Potok, T.E.: Document clustering analysis based on hybrid PSO+K-means algorithm. Journal of Computer Sciences 4, 27–33 (2005) 32. Everitt, B.: Cluster analysis, 2nd edn. Halsted Press, New York (1980) 33. Salton, G.: Automatic text processing. The Transformation, Analysis, and Retrieval of Information by Computer. Addison-Wesley, Reading (1989) 34. Cios, K., Pedrycs, W., Swiniarski, R.: Data mining methods for knowledge discovery. Kluwer Academic Publishers, Dordrecht (1998) 35. Salton, G., Buckley, C.: Term-weighting approaches in automatic text retrieval. Information Processing and Management 24, 513–523 (1988) 36. Jain, A.K., Richard, C.D.: Algorithm for clustering in data. Prentice Hall, Englewood Cliffs (1990) 37. Zhao, Y., Karypis, G.: Empirical and theoretical comparisons of selected criterion functions for document Clustering. Machine Learning 55, 311–331 (2004) 38. Mahdavi, M., Chehreghani, M.H., Abolhassani, H., et al.: Novel meta-heuristic algorithms for clustering web documents. Computer Methods in Applied Mechanics and Engineering 201, 441–451 (2008) 39. Mahdavi, M., Abolhassani, H.: Harmony K-means algorithm for document clustering. Data Mining and Knowledge Discovery 18, 370–391 (2009) 40. Forsati, R., Meybodi, M.R., Mahdavi, M., et al.: Hybridization of K-means and harmony search methods for web page clustering. In: Proceedings of IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology, pp. 329–335 (2008)
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow with Non-Smooth Cost Function B.K. Panigrahi , V. Ravikumar Pandi, Swagatam Das , and Ajith Abraham 1
2
3
Abstract. This chapter presents a novel Harmony Search (HS) algorithm used to solve security constrained optimal power flow (OPF) with various generator fuel cost characteristics. HS is a recently developed derivative-free, meta-heuristic optimization algorithm, which draws inspiration from the musical process of searching for a perfect state of harmony. This chapter analyses the evolution of the populationvariance over successive generations in HS and thereby draws some important attention regarding the explorative power of HS. This novel methodology of modified population variance harmony search algorithm (PVHS) easily takes care of solving optimal power flow problem even with non-smooth and piecewise cost functions. This PVHS algorithm was tested on the IEEE30 bus system with three different types of cost characteristics and compared with other reported results.
1 Introduction Optimal power flow is the main tool used for planning an economic operation of power system [1]. In the recent attention in OPF shows the importance of the electric utilities to find the optimal secure operating point corresponding to the each loading condition. The problem of solving OPF involves estimating the optimal solution of control variables like generator real power, generator voltage magnitude and transformer tap settings corresponding to the best objective function. The B.K. Panigrahi and V. Ravikumar Pandi Department of Electrical Engineering, Indian Institute of Technology, Delhi, Hauz Khas, New Delhi, India – 110016 E-mail:
[email protected],
[email protected] Swagatam Das Department of Electronics and Telecommunication Engineering, Jadavpur University, Kolkata – 700 032, India E-mail:
[email protected] Ajith Abraham Machine Intelligence Research Labs (MIR Labs), USA E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 65–75. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
66
B.K. Panigrahi et al.
dependent variable includes load bus voltage magnitude, generator reactive power generation, transmission line thermal loading. In general OPF is large scale highly non linear and constrained problem of minimizing the fuel cost. OPF problem has been solved using many traditional techniques such as non linear programming, quadratic programming, mixed integer programming and interior point method. The literature review on these methods is given in Momoh et al. [2, 3]. The disadvantage of these traditional methods is it cannot be applicable in case of the prohibited operating regions and multiple fuels. It also has higher sensitivity to initial solution, so it may trap into local optima. The difficulties in implementing OPF can be overcome by modern stochastic algorithms such as evolutionary programming (EP) [4], tabu search (TS) [5], improved evolutionary programming (IEP) [6], modified differential evolution (MDE) [7], particle swarm optimization (PSO) [9], genetic algorithm (GA) [10] and simulated annealing (SA) [11]. In 2001, Geem et al. proposed Harmony Search (HS) [13], a derivative-free, meta-heuristic algorithm, mimicking the improvisation process of music players. Since its inception, HS has found several applications in a wide variety of practical optimization problems like pipe-network design [14], structural optimization [15], vehicle routing problem [16], water distribution networks [17, 23], combined heat and power economic dispatch problem [18], Dam Scheduling [19] and numerical optimization [20]. The applicability of harmony search algorithm for discrete variable problem is given in [22]. The hybrid version of harmony search with particle swarm optimization applied to water network design is proposed in [24]. In the PVHS [21], the control parameter known as distance bandwidth (bw) has been made equal to the standard deviation of the current population. In this chapter we have used this PVHS algorithm to solve optimal power flow problem having various cost characteristics. The algorithm is applied to IEEE 30 bus test system effectively to show the appropriateness of the method. The simulation results with three different cost characteristics are comparable with the recently reported results.
2 OPF Problem Formulation The objective of OPF problem is to minimize the total fuel cost of generators while satisfying several power system steady state security constraints. If x is the vector of state variables consisting of slack bus real power Pg1, load bus voltages VLk, generator reactive power outputs Qgj, and transmission line thermal loading Sl, x can be expressed as: xT = [Pg1, Vl1,…, VlNL, Qg1,…, QgNG, Sl1, …., SlNB]
(1)
where NL, NG and NB are the number of load buses, the number of generators and the number of transmission lines, respectively. u is the vector of control variables consisting of real power outputs Pg except at the slack bus, generator voltages Vg, transformer tap settings T. Hence, u can be expressed as:
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow
uT = [Pg2,….,PgNG,Vg1,….,VgNG,T1,…,TNT]
67
(2)
where NT is the number of regulating transformers. The objective of OPF problem can be expressed as Minimize F =
∑ Fi (Pgi ) NG
(3)
j =1
where F is the total generator fuel cost and Fi is the fuel cost of generator connected to ith bus. The system equality constraints g(x,u) is described by the following power balance equation
N Pgi − Pdi = ∑ Vi V j Yij cos⎛⎜θ ij − δ i + δ j ⎞⎟ ⎝ ⎠ j =1 N
(
Q gi − Qdi = −∑ Vi V j Yij sin θ ij − δ i + δ j j =1
)
i = 1,..., N
i = 1,..., N
(4)
(5)
where Pgi is the total real power generation at ith bus, Pdi is the total real power demand at ith bus, Qgi is the total reactive power generation at ith bus, Qdi is the total reactive power demand at ith bus, |Vi | is the voltage magnitude at ith bus, |Vj | is the voltage magnitude at jth bus, |Yij | is the magnitude of the ijth element of Ybus, θij angle of the ijth element of Ybus, δi voltage angle at ith bus and δj is the voltage angle at jth bus. The system inequality constraints h(x, u) is consist of the following 1.
Generator constraints: The generator real power outputs, reactive power outputs and voltages are bounded to its lower and upper limit. Pgimin ≤ Pgi ≤ Pgimax i = 1,..., NG
(6)
Q gimin ≤ Q gi ≤ Q gimax i = 1,..., NG
(7)
V gimin ≤ V gi ≤ V gimax i = 1,..., NG
(8)
where Pgimin and Pgimax are the minimum and maximum real power generation at ith generator bus, Q gimin and Q gimax are the minimum and maximum reactive power generation at ith generator bus, V gimin and V gimax are the minimum and maximum voltage magnitude at ith generator bus. 2.
Transformer constraints: Transformer tap settings are bounded by minimum and maximum limits as follows
Timin ≤ Ti ≤ Timax i = 1,..., NT
(9)
68
B.K. Panigrahi et al.
where Ti min and Ti max are the minimum and maximum tap setting limit of ith transformer. 3.
Security constraints: It includes the limits in the voltage magnitude of load buses and thermal loading limits of all transmission lines as follows. V Limin ≤ V Li ≤ V Limax i = 1,..., NL
(10)
S li ≤ S limax i = 1,..., NB
(11)
where V Limin and V Limax are the minimum and maximum voltage magnitude at ith load bus, S limax is the thermal limit of ith transmission line.
Constraints Handling: The problem of handling these constraints in the state variables are accommodated in the algorithm by including the constraints violation as quadratic penalty terms in the objective function itself.
(
Fcorr = F + K p Pg 1 − Pglim 1
(
)
2
lim K Q Q gi − Q gi
(
+ K v V Li − V Lilim
)
2
(
)
2
+ K S S li − S lilim
+
)
2
(12)
where Kp, Kv, KQ and KS are the penalty factors corresponding to slack bus real power generation, load bus voltage magnitude, generator reactive power and transmission line thermal loadings, respectively. In the equation (12) the xlim is equals to xmin if x is lesser than the minimum limit and xmax if x is greater than maximum limit.
3 Harmony Search algorithm 3.1 Classical Harmony Search Algorithm In the harmony search algorithm musician improvises the pitches of his/her instrument to obtain a better state of harmony. The different steps of the classical HS algorithm are described below: Step 1: The 1st step is to specify the problem and initialize the parameter values. The optimization problem is defined as minimize (or maximize) f (x) such that i i xmin ≤ xi ≤ xmax , where f (x) is the objective function, x is a solution vector i i consisting of N decision variables ( xi ) and xmin and xmax are the lower and upper bounds of each decision variable, respectively. Other algorithm parameters, such as harmony memory size (HMS), or the number of solution vectors in the harmony memory; harmony memory considering rate (HMCR); pitch adjusting rate (PAR); and the number of improvisations (NI) or stopping criterion are also specified in this step.
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow
69
Step 2: The 2nd step is to initialize the Harmony Memory. The initial harmony i i , xmax ], as memory is generated from a uniform distribution in the ranges [ xmin
(
i i i xij = xmin + r × xmax − xmin
)
(13)
where i = 1, 2,.., N , j = 1,2,3...., HMS , and r ~ U (0,1) . Step 3: The third step is known as the ‘improvisation’ step. The New Harmony vector y = ( y1 , y2 ,… , y N ) is generated by using memory consideration, pitch adjustment, and random selection. The procedure works as follows:
Pseudo-code of improvisation in HS for each i ∈ [1, N ] do if U (0,1) ≤ HMCR then /*memory consideration*/ yi = xij , where j ~ U (1,2, … , HMS ) .
if U (0,1) ≤ PAR then /* Pitch adjustment */
Yi = Yi + r × bw , where r ~ U (0,1) else /* random selection */
(
i i i yi = xmin + r ⋅ xmax − xmin
)
(14) (15)
endif done Step 4: In this step the harmony memory is updated. The generated harmony vector y = ( y1 , y2 ,… , y N ) replaces the worst harmony in the HM (harmony memory) only if its fitness is better than the worst harmony.
Step 5: The stopping criterion (generally the number of iterations) is checked. If it is satisfied, computation is terminated. Otherwise, Steps 3 and 4 are repeated.
3.2 Modified Population Variance Harmony Search (PVHS) Algorithm In [21] Mukhopadhyay et al. analyze the explorative power in HS as follows:
Theorem 1. Let x = {x1 , x 2 , …, x N } be the current population, Y = {Y1 , Y2 ,…, YN } the intermediate population obtained after harmony memory consideration and pitch adjustment. If HMCR be the harmony memory consideration probability, PAR the pitch-adjustment probability, bw the arbitrary distance bandwidth and if we consider the allowable range for the decision variables (xi) to be {xmin , xmax} where xmax = a, xmin = – a, then
70
B.K. Panigrahi et al. E ( var (Y ) ) =
( m − 1) m
⋅ [ HMCR ⋅ var ( x ) + HMCR ⋅ (1 − HMCR ) ⋅ x
2
_
+ HMCR ⋅ (1 − HMCR ) ⋅ PAR ⋅ bw ⋅ x ⎛ 1 HMCR ⋅ PAR ⎞ a 2 + HMCR ⋅ PAR ⋅ bw2 ⋅ ⎜ − ⎟ + 3 ⋅ (1 − HMCR )] 4 ⎝3 ⎠
(16)
If HMCR is chosen to be very high (i.e. very near to 1) and the distance bandwidth parameter ( bw ) is chosen to be the standard deviation of the current population, then population variance (without selection) will grow almost exponentially over generations. Now, Neglecting the terms containing (1 − HMCR ) , and choosing bw = σ(x ) = var(x ) the expression (16) becomes: E (var (Y )) =
(m − 1) ⋅ ⎡ HMCR m
⎢ ⎣
⎞⎤ ⎟ ⎥ ⋅ var ( x ) ⎠⎦
⎛ 1 HMCR ⋅ PAR + HMCR ⋅ PAR ⋅ ⎜ − 4 ⎝3
(17)
From equation (17) it is seen that if we do not include selection in the algorithm, then the expected variance of the gth population ( X g ) becomes: ⎧⎪ (m − 1) ⎡ ⎛ 1 HMCR ⋅ PAR ⎞⎤ ⎫⎪ E var X g = ⎨ ⋅ ⎢ HMCR + HMCR ⋅ PAR ⋅ ⎜ − ⎟⎥ ⎬ ⋅ var( X 0 ) 4 ⎪⎩ m ⎝3 ⎠⎦ ⎪⎭ ⎣ g
( ( ))
(18)
In equation (10) if we choose the values of the parameters HMCR, PAR in such a way that the term within the second brackets becomes greater than unity, then we can expect an exponential growth of population variance. This growth of expected population variance over generations gives the algorithm a strong explorative power. In modified HS the bw is changed dynamically as
σ(x ) = var(x )
(19)
We also took HMCR = 0.98 and PAR = 0.67 to equip the algorithm with more explorative power after performing a series of experiments.
4 Implementation for OPF The optimal power flow problem is implemented using the PVHS algorithm by taking the control variables u in the each harmony memory and equation (12) as objective. The algorithm stops when the current generation exceeds the total number of generation. The parameters are selected as: total number of generation = 100, harmony memory size (HMS) = 50, harmony memory considering rate (HMCR) = 0.98, pitch adjusting rate (PAR) = 0.67. The detailed implementation methodology is described as follows:
Step 1: Initialize harmony memory size (HMS), harmony memory considering rate (HMCR), pitch adjusting rate (PAR) Step 2: Initialize harmonic memory and evaluate objective function after running load flow
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow
71
Step 3: Improvisation of harmony memory by pitch adjustment Step 4: Run load flow and evaluate the objective function Step 5: Update the harmony memory with this improvised solution if it is better than worst solution in memory Step 6: If stopping criteria is met then print the OPF result and stop, otherwise go to step3.
5 Results and Discussion The PVHS algorithm was tested on IEEE30 bus system consists of 6 generating units, 41 transmission lines and 4 tap-changing transformers [8]. The lower and upper limits on independent variables are shown in Table 1. In all the cases bus 1 is considered as swing bus. The simulation was done by taking a quadratic cost curve in case 1, a piecewise quadratic cost curve in case 2, and quadratic cost curve with valve point loading in case 3. The result of the PVHS algorithm is compared with NLP [8], EP [4], TS [5], PSO [9], IEP [6] and MDE [7]. The algorithm is coded on Intel Pentium IV 2.3 GHz processor and 2 GB RAM memory using Matlab 7.4 [12] programming language.
Table 1 Cost Results of PVHS Algorithm Parameter Pg1 Pg2 Pg5 Pg8 Pg11 Pg13 Vg1 Vg2 Vg5 Vg8 Vg11 Vg13 T11 T12 T15 T36 Ploss Sum(Pg) Penalty Best Cost
Lower Limit 50 20 15 10 10 12 0.95 0.95 0.95 0.95 0.95 0.95 0.90 0.90 0.90 0.90
Upper Limit 200 80 50 35 30 40 1.05 1.10 1.10 1.10 1.10 1.10 1.10 1.10 1.10 1.10
Case1
Case2
Case3
176.1824 48.8268 21.5131 22.126 12.224 12.0011 1.0500 1.0381 1.0114 1.0192 1.0866 1.0847 1.0247 0.9267 0.9993 0.9422 9.4734 292.8734 0.0000 802.3764
139.9997 54.9998 24.0997 34.9994 18.4566 17.9266 1.0500 1.0403 1.0145 1.0256 1.0786 1.0837 1.0059 0.9482 1.0033 0.9463 7.0818 290.4818 0.0000 647.8126
197.5413 52.0571 15.0000 10.0000 10.0000 12.0000 1.0333 1.0100 0.9657 1.0307 1.0981 1.1000 1.0978 1.0983 1.0703 1.0141 13.1984 296.5984 0.0004 930.723
72
B.K. Panigrahi et al.
5.1 Case 1 In this case the fuel cost characteristics of all the 6 generating units are given by quadratic cost function as NG
( )
NG
f = ∑ Fi Pgi = ∑ ai + bi Pgi + ci Pgi2 i =1
(20)
i =1
where ai, bi and ci are the cost coefficients of the ith generator. The generator cost coefficients are found in [6] and the optimized parameters corresponding to minimum cost is given in Table 1. The results of the PVHS algorithm is compared in Table 2 with other reported results. The statistical results of 50 trials are also reported in Table 2. The algorithm converges quickly and the results are better than others. The convergence characteristic of PVHS algorithm for this case is shown in Figure 1. Table 2 Cost Comparison with Other Methods for Case 1 Parameter Best Cost Worst cost Avg cost Std cost
NLP[8] 802.40 -
EP[4] 802.62 805.61 803.51 -
IEP[6] 802.465 802.581 802.521 0.039
MDE [7] 802.376 802.404 802.382 -
PVHS 802.3764 802.3912 802.3805 0.0135
Fig. 1 Convergence of PVHS Algorithm for Case 1
5.2 Case 2 In this case the fuel cost characteristics of the generating units connected at bus 1 and bus 2 are having piecewise quadratic cost curve [6] to model different fuels.
( )
Fi Pgi
⎧ ai1 + bi1 Pgi + ci1 Pgi2 , Pgimin ≤ Pgi ≤ Pgi1 ⎪ 2 1 2 ⎪ a + bi 2 Pgi + ci 2 Pgi , Pgi < Pgi ≤ Pgi = ⎨ i2 ...... ⎪ ⎪aik + bik Pgi + cik Pgi2 , Pgik −1 < Pgi ≤ Pgimax ⎩
(21)
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow
73
where aik, bik and cik are the cost coefficients of the ith generator at the kth interval. The other 4 generators are having same quadratic cost curve coefficients as mentioned in Case 1. The generator cost coefficients are found in [6] and the optimized parameters corresponding to minimum cost is given in Table 1. The results of the PVHS algorithm are compared in Table 3 with other reported results using modified differential evolution algorithm (MDE) [7]. The algorithm converges quickly and the results are better than the other. Table 3 Cost Comparison with Other Methods for Case2 Parameter
MDE[7]
PVHS
Best Cost Worst cost Avg cost Std cost
647.846 650.664 648.356 -
647.8126 648.8110 648.2448 0.2681
5.3 Case 3 In this case the fuel cost characteristics of the generating units connected at bus 1 and bus 2 are also having a sine component to model the valve point loading effect of the generators as
((
Fi ( Pgi ) = ai + bi Pgi + ci Pgi + di sin ei Pgi − Pgi 2
min
))
(22)
where ai, bi, ci, di and ei are the cost coefficients of the ith generating unit. The other 4 generators are having same quadratic cost curve coefficients as mentioned in Case 1. The generator cost coefficients are found in [6] and the optimized parameters corresponding to minimum cost is given in Table 1. The results of the PVHS algorithm are compared in Table 4 with other reported results using improved evolutionary programming (IEP) [6], and modified differential evolution algorithm (MDE) [7]. The algorithm converges quickly and the results are better than the others. Table 4 Cost Comparison with Other Methods for Case 3 Parameter IEP[6] Best Cost 953.573
MDE[7] 930.793
PVHS 930.7237
Worst cost 958.263
954.073
930.7764
Avg cost 956.460 Std cost 1.720
942.501 -
930.7380 0.0162
6 Summary and Conclusions In this chapter, detailed discussion is carried out about the application of population variance harmony search algorithm to solve the optimal power flow problem
74
B.K. Panigrahi et al.
in the presence of security constraints. The algorithm explores the search space quickly with the help of population variance parameter. The PVHS algorithm was tested with IEEE 30 bus test system having three different types of cost characteristics. The comparison of obtained results with other previously reported results shows the effectiveness of the algorithm.
References 1. Wood, A.J., Wollenberg, B.F.: Power Generation, Operation and Control. John Wiley & Sons, New York (1984) 2. Momoh, J.A., El-Hawary, M.E., Adapa, R.: A review of selected optimal power flow literature to 1993 Part I: Nonlinear and quadratic programming approaches. IEEE Trans. on Power Systems 14, 96–104 (1999) 3. Momoh, J.A., El-Hawary, M.E., Adapa, R.: A review of selected optimal power flow literature to 1993 Part II: Newton, linear programming and interior point methods. IEEE Trans. on Power Systems 14, 105–111 (1999) 4. Yuryevich, J., Wong, K.P.: Evolutionary programming based optimal power flow algorithm. IEEE Trans. on Power Systems 14, 1245–1250 (1999) 5. Abido, M.A.: Optimal power flow using tabu search algorithm. Electric Power Components and Systems 30, 469–483 (2002) 6. Ongsakul, W., Tantimaporn, T.: Optimal power flow by improved evolutionary programming. Electric Power Components and Systems 34, 79–95 (2006) 7. sayah, S., Zehar, K.: Modified differential evolution algorithm for optimal power flow with non-smooth cost functions. Energy Conversion and Management 49, 3036–3042 (2008) 8. Alsac, O., Stott, B.: Optimal load flow with steady-state security. IEEE Trans. on Power Apparatus Systems 93, 745–751 (1974) 9. Abido, M.A.: Optimal power flow using particle swarm optimization. Electric Power Energy Systems 24, 563–571 (2002) 10. Bakirtzis, A.G., Biskas, P.N., Zoumas, C.E., Petridis, V.: Optimal power flow by enhanced genetic algorithm. IEEE Trans. on Power Systems 17, 229–236 (2002) 11. Roa-Sepulveda, C.A., Pavez-Lazo, B.J.: A solution to the optimal power flow using simulated annealing. Electric Power Energy Systems 25, 47–57 (2003) 12. Matlab (2007), http://www.mathworks.com 13. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 14. Geem, Z.W., Kim, J.H., Loganathan, G.V.: Harmony search optimization: application to pipe network design. Int. J. Model. Simulation 22, 125–133 (2002) 15. Lee, K.S., Geem, Z.W.: A new structural optimization method based on the harmony search algorithm. Comput. Struct. 82, 781–798 (2004) 16. Geem, Z.W., Lee, K.S., Park, Y.: Application of Harmony Search to Vehicle Routing. American Journal of Applied Sciences 2, 1552–1557 (2005) 17. Geem, Z.W.: Optimal Cost Design of Water Distribution Networks Using Harmony Search. Engineering Optimization 38, 259–280 (2006) 18. Vasebi, A., Fesanghary, M., Bathaeea, S.M.T.: Combined heat and power economic dispatch by Harmony Search Algorithm. International Journal of Electrical Power and Energy Systems 29, 713–719 (2007)
Population Variance Harmony Search Algorithm to Solve Optimal Power Flow
75
19. Geem, Z.W.: Optimal Scheduling of Multiple Dam System Using Harmony Search Algorithm. In: Sandoval, F., Prieto, A.G., Cabestany, J., Graña, M. (eds.) IWANN 2007. LNCS, vol. 4507, pp. 316–323. Springer, Heidelberg (2007) 20. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved Harmony Search Algorithm for Solving Optimization Problems. Applied Mathematics and Computation 188, 1567–1579 (2007) 21. Mukhopadhyay, A., Roy, A., Das, S., Das, S., Abraham, A.: Population-Variance and Explorative Power of Harmony Search: An Analysis. In: Third IEEE International Conference on Digital Information Management (ICDIM 2008), pp. 13–16 (2008) 22. Geem, Z.W.: Novel Derivative of Harmony Search Algorithm for Discrete Design Variables. Applied Mathematics and Computation 199, 223–230 (2008) 23. Geem, Z.W.: Harmony Search Optimization to the Pump-Included Water Distribution Network Design. Civil Engineering and Environmental Systems 26, 211–221 (2009) 24. Geem, Z.W.: Particle-Swarm Harmony Search for Water Network Design. Engineering Optimization 41, 297–311 (2009)
A Harmony Search Approach Using Exponential Probability Distribution Applied to Fuzzy Logic Control Optimization Leandro dos Santos Coelho and Diego L. de A. Bernert
*
Abstract. Fuzzy logic control (FLC) systems have been investigated in many technical and industrial applications as a powerful modeling tool that can cope with the uncertainties and nonlinearities of modern control systems. However, a drawback of FLC methodologies in the industrial environment is the number of tuning parameters to be selected. In this context, a broad class of meta-heuristics has been developed for optimization tasks. Recently, a meta-heuristic called harmony search (HS) algorithm has emerged. HS was conceptualized using an analogy with music improvisation process where music players improvise the pitches of their instruments to obtain better harmony. Inspired by the HS optimization method, this work presents an improved HS (IHS) approach using exponential probability distribution to optimize the design parameters of a FLC with fuzzy PI (proportional-integral) plus derivative action conception. Numerical results presented here indicate that validated FLC design with IHS tuning is effective for the control of a pH neutralization nonlinear process.
1 Introduction Fuzzy logic has the capability to handle imprecise information through linguistic expressions. Fuzzy logic techniques have been successfully applied on the control system without exact mathematical plant model, complex and time-varying dynamic processes [1-4]. A reason behind the increasing popularity of FLCs is that FLCs essentially incorporate human expertise in control strategy for controlling processes, exploiting the easier understanding of linguistic interpretation. On the other hand, it is well known that up until now, a conventional proportional-integral-derivative (PID) type controller is most widely used in industry due to its simple control structure, ease of design, and inexpensive cost. However, the PID type controller cannot yield a good control performance if a controlled object is highly nonlinear and uncertain [5]. Leandro dos Santos Coelho and Diego L. de A. Bernert Industrial and Systems Engineering Graduate Program, Pontifical Catholic University of Paraná, Curitiba, Paraná, Brazil E-mail:
[email protected],
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 77–88. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
78
L. dos Santos Coelho and D.L. de A. Bernert
To nullify the basic disadvantages associated with the construction of a threedimensional rule base, researchers in the past decade have proposed different two-input PID-type FLC structures, as combinations of two-term FLCs. See design examples combining the FLC and classical proportional, integral, derivative, proportional-integral, and proportional-derivative controllers in [6-13]. Adding the difficulty of having to tune the membership functions, fuzzy control rules, and scaling factors of FLC-PID, to an unsystematic design procedure usually makes it impossible to achieve adequate performance because the controlled process is too complex. To overcome this flaw, a lot of researches use genetic algorithms [14-19] to be able to optimally set the parameters of the fuzzy controllers. Recently, a new class of meta-heuristics, named harmony search (HS), has been developed. The HS algorithm proposed in [20] has been recently developed in an analogy with music improvisation process where musicians in an ensemble continue to polish their pitches in order to obtain better harmony. Jazz improvisation seeks to find musically pleasing harmony similar to the optimum design process which seeks to find optimum solution. The pitch of each musical instrument determines the aesthetic quality, just as the objective function value is determined by the set of values assigned to each decision variable [21]. In addition, HS uses a stochastic random search instead of a gradient search so that derivative information is unnecessary. This chapter proposes an improved HS (IHS) approach to optimize the scaling factors of a FLC with fuzzy PI (proportional-integral) plus derivative action conception (FLC-PI-D). A contribution of this chapter is the analysis and discussion of the FLC-PI-D control issue using IHS tuning. The FLC-PI-D designs using classical HS and IHS algorithms are compared and have been applied to a pH neutralization nonlinear process. The remaining sections of this chapter are organized as follows: in section 2, fundamentals of FLCs and FLC-PI-D are shown. Section 3 describes the HS and IHS. In section 4, the description of a pH neutralization nonlinear process and the simulation results obtained by FLC-PI-D are evaluated. Lastly, section 5 presents our conclusions and future research works.
2 Fundamentals of Fuzzy Logic Control Fuzzy set theory was introduced in [22] and can be utilized to transform an inexact knowledge into the form of a computer algorithm. In applications it is used by defining a fuzzy system with linguistic variables and with a set of if-then rules. Being composed of control rules of conditional linguistic statements that state the relationship between input and output variables, the FLCs have the enticing abilities of emulating human knowledge and experiences and dealing with model uncertainty. FLCs are typically defined by the nonlinear mapping of system state space for the control space. However, it is possible to identify the result of a FLC as a control surface reflecting the operator’s (or control engineer’s) prior knowledge of the process. The control surface is coded into a knowledge base using a compiler to execute rule-base, termsets, and scale factors [23].
A Harmony Search Approach Using Exponential Probability Distribution
79
Classical FLCs design presents a data flow that is dealt with a fuzzification phase, analysis and execution of rules and, a defuzzification phase as seen in Figure 1.
Fig. 1 Representation of a fuzzy controller
There are two major types of fuzzy controllers: FLCs based on linguistic model (Mamdani type) [24] and FLCs based on interpolative model (Takagi-Sugeno type) [25]. The major difference is that Mamdani fuzzy controllers use fuzzy sets whereas Takagi-Sugeno fuzzy controllers employ functions of input variables in consequent of fuzzy control rules. In this chapter, the FLC of Mamdani type is adopted.
2.1 FLC-PI-D Controller PID (proportional-integral-derivative) controllers are designed for linear systems and they provide a preferable cost/benefit ratio. However, the presences of nonlinear effects limit their performances. FLCs are successfully applied to nonlinear system because of their knowledge based on nonlinear structural characteristics. Hybridization of these two controller structures comes to one’s mind immediately to exploit the beneficial sides of both categories. In this context, fuzzy logic approaches have been shown in numerous studies to be a simpler alternative to improve conventional PID control performance [2, 8, 11], where the usual FLC structure is the FLC-PI or the FLC-PD. This section presents the description of a FLC-PI-D design. The FLC-PI-D design, as proposed by [5, 26], consists of a fuzzy PI plus the derivative control action of the process output, u D (k ) , where:
u PID (k ) = K c ⋅ [u PI (k ) + u D (k )]
(1)
u PI (k ) = K e ⋅ e(k ) + K ∆e ⋅ ∆e(k )
(2)
e( k ) = y ( k ) − y r ( k )
(3)
∆e(k ) = e(k ) − e(k − 1) ,
(4)
80
L. dos Santos Coelho and D.L. de A. Bernert
where Kc, Ke, and K∆e are scaling factors, e(k) is the error signal, ∆e(k) is the change of error signal, y(k) is the output signal, and yr(k) is the setpoint signal. The variables uPI(k) and uD(k) are the control signals of PI and D controllers, respectively. In this context, the derivative control action has the following equation: u D (k ) = K D ⋅ y ( k ) − y r ( k ) ,
(5)
where KD is the derivative gain constant. The principle of this design is that the FLC-PI-D control algorithm has the benefit of implementing the derivative control on the output, avoiding derivative kicks for step setpoint (reference) changes. The basic control diagram and membership functions of FLC-PI-D are shown in Figures 2 and 3, respectively. In this chapter, the following linguistic terms are used: P (Positive), N (Negative), Z (Zero), NS (Negative Small), NB (Negative Big), PS (Positive Small) and PB (Positive Big). In this work, the triangular shape and singleton forms are adopted how membership functions of the FLC-PI-D design.
Fig. 2 Basic control diagram of the FPI+D
Fig. 3 Membership Functions of the FPI+D
A Harmony Search Approach Using Exponential Probability Distribution
81
3 Optimization Based on Harmony Search Algorithm This section describes the proposed IHS algorithm. First, a brief overview of the HS is provided, and finally the modification procedures of the proposed IHS algorithm are presented.
3.1 Harmony Search (HS) Recently, Geem et al. [20] proposed a new HS meta-heuristic algorithm that was inspired by musical process of searching for a perfect state of harmony. The harmony in music is analogous to the optimization solution vector, and the musician’s improvisations are analogous to local and global search schemes in optimization techniques. The HS algorithm does not require initial values for the decision variables. Furthermore, instead of a gradient search, the HS algorithm uses a stochastic random search that is based on the harmony memory considering rate and the pitch adjusting rate so that derivative information is unnecessary. Compared to earlier meta-heuristic optimization algorithms, the HS algorithm imposes fewer mathematical requirements and can be easily adopted for various types of engineering optimization problems [21]. In the HS algorithm, musical performances seek a perfect state of harmony determined by aesthetic estimation, as the optimization algorithms seek a best state (i.e. global optimum) determined by objective function value. The optimization procedure of the HS algorithm consists of following steps [27]: Step 1. Initialize the optimization problem and HS algorithm parameters. First, the optimization problem is specified as follows:
Minimize f(x) subject to xi ∈ Xi, i = 1,..., N
(6)
where f(x) is the objective function, x is the set of each decision variable (xi); Xi is the set of the possible range of values for each design variable (continuous design variables), that is, xi,lower ≤ Xi ≤ xi,upper, where xi,lower and xi,upper are the lower and upper bounds for each decision variable; and N is the number of design variables. In this context, the HS algorithm parameters that are required to solve the optimization problem are also specified in this step. The number of solution vectors in harmony memory (HMS), that is the size of the harmony memory matrix, harmony memory considering rate (HMCR), pitch adjusting rate (PAR), and the maximum number of searches (stopping criterion) are selected in this step. Here, HMCR and PAR are parameters that are used to improve the solution vector. Both are defined in Step 3. Step 2. Initialize the harmony memory. The harmony memory (HM) is a memory location where all the solution vectors (sets of decision variables) are stored. In Step 2, the HM matrix, shown in Equation 7, is filled with randomly generated solution vectors using uniform distribution, where
82
L. dos Santos Coelho and D.L. de A. Bernert
⎡ x11 ⎢ 2 ⎢ x1 HM = ⎢ # ⎢ HMS-1 ⎢ x1 ⎢ HMS ⎣ x1
x12 x22
# x2HMS-1 x2HMS
x1N-1
" "
2 x N1
# # HMS-1 " xN −1 "
HMS xN −1
⎤ ⎥ ⎥ # ⎥ ⎥ HMS-1 xN ⎥ HMS ⎥ xN ⎦ x1N 2 xN
(7)
Step 3. Improvise a new harmony from the HM. A new harmony vector, x' = ( x1' , x2' ,..., x N' ) , is generated based on three rules: i) memory consideration, ii)
pitch adjustment, and iii) random selection. The generation of a new harmony is called ‘improvisation’. In the memory consideration, the value of the first decision variable ( x1' ) for the new vector is chosen from any value in the specified HM range ( x11 ~ x1HMS ) . Values of the other decision variables ( x 2' ~ x N' ) are chosen in the same manner. The HMCR, which varies between 0 and 1, is the rate of choosing one value from the historical values stored in the HM, while (1 - HMCR) is the rate of randomly selecting one value from the possible range of values.
{
}
⎧⎪ x ' ∈ x1i , xi2 ,..., xiHMS with probability HMCR xi' ← ⎨ i' ⎪⎩ xi ∈ X i with probability (1 - HMCR).
(8)
After, every component obtained by the memory consideration is examined to determine whether it should be pitch-adjusted. This operation uses the PAR parameter, which is the rate of pitch adjustment as follows:
⎧Yes with probabilit y PAR Pitch adjusting decision for xi' ← ⎨ ⎩ No with probabilit y (1 - PAR).
(9)
The value of (1 - PAR) sets the rate of doing nothing. If the pitch adjustment '
'
decision for xi is Yes, xi is replaced as follows: xi' ← xi' ± r ⋅ bw,
(10)
where bw is an arbitrary distance bandwidth, r is a random number generated using uniform distribution between 0 and 1. In Step 3, HM consideration, pitch adjustment or random selection is applied to each variable of the new harmony vector in turn. Step 4. Update the HM. If the new harmony vector, x' = ( x1' , x2' ,..., x N' ) is better
than the worst harmony in the HM, judged in terms of the objective function value, F, the new harmony is included in the HM and the existing worst harmony is excluded from the HM.
A Harmony Search Approach Using Exponential Probability Distribution
83
Step 5. Repeat Steps 3 and 4 until the stopping criterion has been satisfied. Usually stopping criterion is a sufficiently good objective function or a maximum number of iterations (generations), tmax. Maximum number of iterations criterion is adopted in this work.
3.2 Improved HS (IHS) Using Exponential Probability Distribution Recently, the use of exponential probability distribution to generate random numbers has been used in evolutionary algorithms [28-30]. Inspired by works of [28, 29], in this chapter, we present an improved HS algorithm using exponential probability distribution. The exponential probability distribution E(a,b) with density function used in this work is given by:
f ( x) =
1 exp (− x − a / b ), − ∞ ≤ x < ∞, with a , b > 0. 2b
(11)
It is evident that one can control the variance by changing the parameters a and b. Our goal is to investigate how this distribution influences the performance of HS. Generating random numbers from the absolute value of the exponential distribution, given by AE, is described as follows [29]: a = 0.3 b = 0.1 u1 = rand
(value adopted in this chapter) (value adopted in this chapter) (number with uniform distribution in the range [0;1])
u 2 = rand
(number with uniform distribution in the range [0;1])
if u1 > 0.5 x = a + blog( u 2 )
else x = a – blog( u 2 )
end AE = |x| Fig. 4 Generating random numbers with exponential distribution adopted in IHS
Generating random numbers using |E(a,b)| for the value of r (see Equation 10 in classical HS) in IHS may provide a good compromise between the probability of having a large number of small amplitudes around the current points (fine tuning) and a small probability of having higher amplitudes, which may allow the harmonies to move away from the current point and escape from local minima. In the IHS algorithm, the Equation 10 of classical HS is modified for xi' ← xi' ± AE ⋅ bw,
(12)
where AE is the absolute value of a number generated with exponential probability distribution.
84
L. dos Santos Coelho and D.L. de A. Bernert
4 Description of pH System and Simulation Results The evaluated case study represents the pH neutralization system described in [31]. The system has the feed streams which are composed of N components (thick stock, chemical additives and white water) and a titration stream (acid or base) at the mixing box. To simplify the formulation, a perfect mixing is assumed after the thin stock passes through the pipe to the open headbox. Therefore, the measured pH value at headbox can represent the real pH value of the thin stock which is fed to the wire section. In this context, the state space equation in continuous time domain is given by [31] V
dx + F ⋅ x = (1 − x)u dt
(13)
x(0) = 0 if u (t ) = 0, t < 0
(14)
pH = f (x)
(15)
where V is the total volume of the solution in the flow box (ℓ), F is total flow rate of the feed (thick stock, chemicals and white water) (ℓ/min), u is the flow rate of the titration stream (acid or base) (ℓ/min) limited in the range (0, 3), and f(x) is a monotonic increasing function representing the equivalent titration curve. Assuming that the zero order hold is used, Equation 13 can be expressed in discrete form by
⎡ (F + u (t ) )Ts ⎤ ⎧ ⎡ (F + u (t ) )Ts ⎤ ⎫ u (t ) x(t + 1) = x(t ) ⋅ exp ⎢− ⎥ + ⎨1 − exp ⎢− ⎥ ⎬ F + u (t ) V V ⎣ ⎦ ⎩ ⎣ ⎦⎭ pH (t + 1) = f ( x(t + 1))
⎡ ⎤ ⎛ x (t ) − 0.5 ⎞ pH (t + 1) = f ( x(t )) = 4.178 ⋅ ⎢atan⎜ ⎟ + 1.8⎥ , ⎝ 0.05 ⎠ ⎣ ⎦
(16) (17) (18)
where Ts is the sampling time and the values of pH (process output) are in range (0, 14). In this chapter, V = 2 ℓ, Ts = 0.1 min, and F = 1 ℓ/min are adopted. The effectiveness and advantages of the proposed FLC-PI-D based on HS and IHS approaches are demonstrated through controlling the pH neutralization system, where is adopted the following setup: • Reference trajectory in optimization phase (servo behavior): The desired reference signal is given by yr(k) = 2 (from sample 1 to 100), yr(k) = 10 (from sample 101 to 200), and yr(k) = 13 (from sample 201 to 300). • Optimization procedure: The HS and IHS approaches are used in optimization procedure of scaling factor parameters of FLC-PI-D. In the sequel it illustrates the main features of the HS and IHS approaches employed:
A Harmony Search Approach Using Exponential Probability Distribution
85
(i) Objective function: In this work, the objective function to be maximized is given by J=
10 1 + ∑ e(k ) + 0.04 ⋅ [u(k ) − u(k − 1)] N
.
(19)
2
k =1
(ii) Search space used in HS and IHS approaches: Ke, K∆e, Kc ∈ [-40, 40] and KD ∈ [-0.3, 0.3]. The classical HS and IHS algorithms were implemented in MATLAB (MathWorks). All the programs were run under Windows XP on a 3.2 GHz Pentium IV processor with 2 GB of random access memory. To eliminate stochastic discrepancy, in each case study, it adopted 30 independent runs for each of the optimization methods involving 30 different initial trial solutions for each optimization method. The total number of solution vectors in classical HS and IHS, i.e., the HMS was 20 and tmax = 300 generations. Furthermore, the bw, HMCR and PAR were 0.01, 0.9 and 0.3, respectively, in tested HS approaches. In this work, the adjustment of the rule base of FLC-PI-D was accomplished by fine tuning and heuristic corrections linked to the knowledge of the process to be controlled, as shown in Figure 5.
Fig. 5 Rule base adopted for the FLC-PI-D design
Tables 1 and 2 summarize the performance and design parameters of FLC-PI-D optimized by HS and IHS methods for 30 runs. As can be seen, for the pH control using FLC-PI-D, the best mean, minimum, and maximum from the 30 runs performed was using IHS. In this context, the best solution was obtained using IHS with the objective function J = 110.4468. Simulation results for the servo behavior of the FLC-PI-D using IHS for the pH neutralization system are shown in Figure 6. Table 1 Convergence of HS and IHS to optimize the FLC-PI-D (30 runs) Optimization Algorithm HS IHS
Maximum J
Mean J
Minimum J
100.9286 110.4468
90.3335 93.9736
81.9827 85.8320
Standard Deviation of J 5.1149 6.9594
86
L. dos Santos Coelho and D.L. de A. Bernert Table 2 Best results of FLC-PI-D and performance data in closed-loop system Parameter Ke K∆e Kc KD Mean of error signal Variance of control signal Objective function, J
HS 0.8514 -44.1318 1.2093 -0.0999 0.2403 1.2742 100.9286
IHS 0.3165 -34.5754 0.8078 -0.0917 0.2167 0.7535 110.4468
14
12
10
output
8
6
4 output signal reference signal
2
0 0
50
100
150 sample
200
250
300
(a) output 3.5
3
control signal
2.5
2
1.5
1
0.5
0 0
50
100
150 sample
200
250
300
(b) control signal Fig. 6 Best result of servo behavior using FLC-PI-D with IHS
A Harmony Search Approach Using Exponential Probability Distribution
87
5 Conclusions and Future Research This chapter presented the development of an IHS algorithm to the FLC-PI-D design. The effectiveness of the proposed control schemes was shown in simulations of a pH neutralization system. The utilization of HS and IHS approaches avoids the tedious manual trial-and-error procedure and it presents robustness in tuning of FLC-PI-D design parameters. The IHS method proposed in this study presents some promising features. Parametric uncertainties affect the closed loop system dynamics. However, the effectiveness of the proposed FLC-PI-D strategy using IHS is corroborated in Figure 6. The aim of future works includes investigating the use of IHS for FLC-PI-D tuning applied to multivariable nonlinear processes.
References 1. Ahn, K.K., Truong, D.Q.: Online tuning fuzzy PID controller using robust extended Kalman filter. Journal of Process Control 19, 1011–1023 (2009) 2. Feng, G.: A survey on analysis and design of model-based fuzzy control systems. IEEE Transactions on Fuzz Systems 14, 676–697 (2006) 3. Mohan, B.M., Sinha, A.: Analytical structure and stability analysis of a fuzzy PID controller. Applied Soft Computing 8, 749–758 (2008) 4. Wang, L., Du, W., Wang, H., Wu, H.: Fuzzy self-tuning PID control of the operation temperatures in a two-staged membrane separation process. Journal of Natural Gas Chemistry 17, 409–414 (2008) 5. Li, H.X., Gatland, H.B.: Enhanced methods of fuzzy logic control. In: Proceedings of FUZZ-IEEE/IFES, Yokohama, Japan, vol. 1, pp. 331–336 (1995) 6. Fadaei, A., Salahshoor, K.: Design and implementation of a new fuzzy PID controller for networked control systems. ISA Transactions 47, 351–361 (2008) 7. Golob, M.: Decomposed fuzzy proportional-integral-derivative controllers. Applied Soft Computing 1, 201–214 (2001) 8. Kwok, D.P., Tam, P., Li, C.K., Wang, P.: Linguistic PID controllers. In: Proceedings of 11th World Congress of IFAC, Tallin, Estonia, USSR, vol. 7, pp. 192–197 (1990) 9. Lan, L.H.: Stability analysis for a class of Takagi–Sugeno fuzzy control systems with PID controllers. International Journal of Approximate Reasoning 46, 109–119 (2007) 10. Li, Y., Ng, K.C.: Reduced rule-base and direct implementation of fuzzy logic control. In: Proceedings of 13th World Congress of IFAC, San Francisco, CA, USA, pp. 85–90 (1997) 11. Mann, G.K.I., Hu, B.G., Gosine, R.G.: Analysis of direct action fuzzy PID controller structures. IEEE Transactions on Systems, Man, and Cybernetics — Part B: Cybernetics 29, 371–388 (1999) 12. Shayeghi, H., Shayanfar, H.A., Jalili, A.: Multi-stage fuzzy PID power system automatic generation controller in deregulared environments. Energy Conversion and Management 47, 2829–2845 (2006) 13. Soyguder, S., Karakose, M., Alli, H.: Design and simulation of self-tuning PID-type fuzzy adaptive control for an expert HVAC system. Expert Systems with Applications 36, 4566–4573 (2009)
88
L. dos Santos Coelho and D.L. de A. Bernert
14. Bagis, A., Karaboga, D.: Evolutionary algorithm-based fuzzy PD control of spillway gates of dams. Journal of the Franklin Institute 344, 1039–1055 (2007) 15. Chou, C.H.: Genetic algorithm-based optimal fuzzy controller design in the linguistic space. IEEE Transactions on Fuzzy Systems 14, 372–395 (2006) 16. Cordón, O., Gomide, F., Herrera, F., Hoffmann, F.: Magdalena Ten years of genetic fuzzy systems: current framework and new trends. Fuzzy Sets and Systems 141, 5–31 (2004) 17. Marseguerra, M., Zio, E., Cadini, F.: Genetic algorithm optimization of a model-free fuzzy control system. Annals of Nuclear Energy 32, 712–728 (2005) 18. Mucientes, M., Moreno, D.L., Bugarín, A., Barro, S.: Design of a fuzzy controller in mobile robotics using genetic algorithms. Applied Soft Computing 7, 540–546 (2007) 19. Wu, C.J., Liu, G.Y.: A genetic approach for simultaneous design of membership functions and fuzzy control rules. Journal of Intelligent and Robotic Systems 28, 195–211 (2000) 20. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76(2), 60–68 (2001) 21. Saka, M.P.: Optimum design of steel sway frames to BS5950 using harmony search algorithm. Journal of Constructional Steel Research 65, 36–43 (2009) 22. Zadeh, L.A.: Fuzzy sets. Information and Control 8, 338–353 (1965) 23. Coelho, L.S., Coelho, A.A.R.: Fuzzy PID controllers: structures, design principles and application for nonlinear practical process. In: Roy, R., Furushashi, T., Chawdhry, K. (eds.) Advances in Soft Computing – Engineering Design and Manufacturing, pp. 147–159. Springer, London (1999) 24. Mamdani, E., Assilian, S.: An experiment in linguistic synthesis with a fuzzy logic controller. International Journal on Man Machine Studies 7, 1–13 (1975) 25. Takagi, T., Sugeno, M.: Fuzzy identification of systems and its applications to modeling and control. IEEE Transactions on Systems, Man, and Cybernetics 15, 116–132 (1985) 26. Qin, S.J.: Auto-tuned fuzzy logic control. In: Proceedings of the American Control Conference, Baltimore, Maryland, USA, pp. 2465–2469 (1994) 27. Coelho, L.S., Bernert, D.L.A.: An improved harmony search algorithm for synchronization of discrete-time chaotic systems. Chaos, Solitons & Fractals 41, 2526–2532 (2009) 28. Coelho, L.S., Alotto, P.: Global optimization of electromagnetic devices using an exponential quantum-behaved particle swarm optimizer. IEEE Transactions on Magnetics 44, 1074–1077 (2008) 29. Krohling, R.A., Coelho, L.S.: PSO-E: Particle swarm with exponential distribution. In: Proceedings of IEEE Congress on Evolutionary Computation (CEC 2006), pp. 5577– 5582 (2006) 30. Narihisa, H., Taniguchi, T., Ohta, M., Katayama, K.: Exponential evolutionary programming without self-adaptive strategy parameter. In: Proceedings of IEEE Congress on Evolutionary Computations, pp. 544–551 (2006) 31. Logghe, D., Wang, H.: Modelling a non-linear pH process via the use of B-splines neural network. In: Proceedings of the IEEE International Conference on Control Applications (1997)
Hybrid Taguchi-Harmony Search Approach for Shape Optimization Ali Rıza Yildiz and Ferruh Öztürk
*
Abstract. Harmony search algorithms have recently gained a lot of attention from the optimization research community. In this chater, a new optimization approach based on harmony search algorithm and Taguchi’s method is presented to solve shape optimization problems. The validity and efficiency of the proposed approach are evaluated in an optimum design problem of a vehicle component by illustrating how the present approach can be applied for solving shape optimization problems. The first application of harmony search algorithm to the shape optimization problems in the literature is presented in this chapter. The results of the shape optimization problem indicate that the proposed approach is highly competitive and it can be considered as a viable alternative in solving real-world optimization problems, finding beter solutions compared to other approaches that are representative of the state-of-the-art in the optimization literature.
1 Introduction Structural optimization has gain a lot of attention due to its great contribution to cost, material and time savings in the procedures of the engineering design. Topology and shape optimization have deserved great attentions in terms of its important purpose and inherent difficulties. Shape optimization is becoming more important as industry attempts to optimize (minimize or maximize) objective functions while still maintaining a sufficiently strong and safe design. The goal of shape optimization is to find the optimal shape of a continuum medium to maximize or minimize an objective function such as minimizing the weight or maximizing the stiffness of the structure, subjected to the stress or displacement constraint conditions. Since classical optimization methods are not only time consuming in solving complex nature problems but also they may not be used efficiently in finding global or near global optimum solutions, it is difficult to design the best product Ali Rıza Yildiz and Ferruh Öztürk Mechanical Engineering Department, Uludag University, Bursa, Turkey Email: {aliriza,fozturk}@uludag.edu.tr Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 89–98. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
90
A.R. Yildiz and F. Öztürk
by classical optimization methods. The increasing demand to lightweight and lowcost structures has forced researchers to develop new approaches. Recent advancements in optimization area introduced new opportunities to achieve better solutions for shape design optimization problems. Therefore, there is a need to develop new methods to overcome drawbacks and to improve the existing optimization techniques to design products economically. Since the heuristic search techniques such as genetic algorithm, simulated annealing, ant colony algorithm, particle swarm optimization, immune algorithm and harmony search algorithm are more effective than the gradient techniques in finding the global minimum, they have been widely applied in various fields of science [1-19]. A detailed review of these algorithms as well as their applications in the optimum structural design can be found in [9, 18]. Fast convergence speed and robustness in finding the global minimum are not easily achieved at the same time. Fast convergence requires a minimum number of calculations, increasing the probability of missing important points; on the other hand, the evaluation of more points for finding the global minimum decreases the convergence speed. This leads to the question: ‘how to obtain both fast convergence speed and global search capability at the same time’. There have been a number of attempts to answer this question, while hybrid algorithms have shown outstanding reliability and efficiency in application to the engineering optimization problems [19-27]. Therefore, researchers are paying great attention on hybrid approaches to answer this question, particularly to avoid premature convergence towards local minima and to reach the global optimum results. Although some improvements regarding shape design optimization issues are achieved, the complexity of design problems presents shortcomings. A new hybrid approach based on robustness issues are used to help better harmony search algorithm. It has been aimed to reach optimum designs by using Taguchi’s robust parameter design approach coupled with harmony search algorithm. In this new hybrid approach, S/N values are calculated and ANOVA (analysis of variance) table for objective function(s) is formed using S/N ratios. According to results of ANOVA table, appropriate interval levels of design parameters are found and then, initial harmony memory is defined according to these interval levels. Then, optimum results of design optimization problem are obtained using the harmony search algorithm. The new hybrid optimization approach is applied to a shape optimization problem taken from automotive industry to demonstrate the application of the present approach to real-world shape design optimization problems.
2 Global Optimization by Hybridization Optimization problems have objective function(s) and constraints that must be satisfied at the same time. A general mathematical model of constrained optimization problems can be defined as follows [28]:
Hybrid Taguchi-Harmony Search Approach for Shape Optimization
Minimize/Maximize fm(x), m = 1,2,..., M
91
(1)
Subject to gj (x) ≥ 0, j = 1,2,..., J
(2)
hk(x) =0, k = 1,2,..., K
(3)
xi(L) ≤ xi ≤ xi(U), i = 1,2,..., n
(4)
A solution x is a vector of n decision variables: x = (x1, x2,…,xn)T. Each decision variable xi takes a value between a lower xi(L) and an upper xi(U) bound. These bounds define decision variable space. In this mathematical model gj (x) and hk(x) define inequality and equality constraints, respectively. Objective function(s) f(x) = (f1(x), f2(x),…, fM(x))T can be either minimized or maximized. The problem is to find optimum variables that satisfy the constraints given by (2) and (3). A larger population makes the algorithm more likely to find good solutions, but also increases computing time taken by the algorithm. The problem with larger population is to tend to converge and stick around certain solutions; therefore, there is a need to define the efficient size of population to efficiently have global optimal results. This shortcoming is eliminated by introducing Taguchi-based initial harmony memory.
2.1 Harmony Search Algorithm The harmony search (HS) algorithm was recently developed in an analogy with music improvisation process where music players improvise the pitches of their instruments to obtain better harmony [14]. The working principle of the HS algorithm is very different from classical optimization techniques. The HS algorithm uses a random search, which is based on random selection, memory consideration, and pitch adjustmenting. It has been successfully applied to various benchmark and real-world problems [14-20]. The steps in the procedure of harmony search are as follows: • • • • •
Step 1: Initialize the problem and algorithm parameters. Step 2: Initialize the harmony memory. Step 3: Improvise a new harmony. Step 4: Update the harmony memory. Step 5: Check the stopping criterion.
For further details about these steps, various HS algorithm structures can be found from Geem [17].
92
A.R. Yildiz and F. Öztürk
2.2 Taguchi Method Taguchi method chooses the most suitable combination of the levels of controllable factors by using S/N table and orthogonal arrays against the factors that form the variation and are uncontrollable in product and process. Hence, it tries to reduce the variation in product and process to the least. Taguchi uses statistical performance measure which is known as S/N ratio that takes both medium and variation into consideration [29].
Finite element analysis
HARMONY SEARCH ALGORITHM Initialize the harmony memory
TAGUCHI’S METHOD
Define design variables and matrix of experiments
Improvise a new harmony Update harmony memory
Check stopping criterion
Optimum settings of design variables
Compute S/N ratios and conduct ANOVA analysis
Determine optimum levels of design variables
Initial memory range for search space
Fig. 1 Hybrid harmony search algorithm based shape optimization approach
Most of the shape optimization problems in industry have uncontrollable variations in their design parameters. There is a need to overcome the shortcomings due to the traditional optimization methods and also to further improve the strength of recent approaches to achieve better results for the real-world design optimization problems. Therefore, in this chapter, a hybrid approach for shape optimization is proposed based on Taguchi’s method and HS algorithm. The architecture of proposed hybrid approach is given in Figure 1. Although the HS algorithm has been used for different optimization studies, it has not been used for shape optimization up to now in literature. For the first time in the literature, HS algorithm and hybrid HS are used for shape optimization.
Hybrid Taguchi-Harmony Search Approach for Shape Optimization
93
Taguchi’s method is introduced to help to define robust initial population levels of design parameters and to reduce the effects of noise factors to achieve better initial harmony memory. The problem with larger population is to tend to converge and stick around certain solutions which may not be the best one. This is handled with the help of robust parameter levels which are embedded into HS algorithm as being initial population intervals. In other words, the design space is restricted and refined based on the effect of the various design variables on objective function(s). The purpose of the ANOVA tables is to help differentiate the robust designs from the non-robust ones. Finally, optimum results of shape optimization problem are obtained by applying HS algorithm. The present approach is considered in two stages as follows: 1) determine efficient solution space using Taguchi’s method, and 2) apply HS to find optimal solution set of design variables. In the first stage, Taguchi’s robust parameter design procedure is used to find the levels of variables for efficient search space as follows: • • • • •
Identify the objectives, constraints and design parameters. Determine the settings of the design parameter levels. Conduct the experiments using orthogonal array. Compute S/N ratios and ANOVA analysis. Find the optimal settings of design parameters.
The main issue of experimental analysis is ANOVA analysis which is formed using S/N ratios for objective function(s). According to results of ANOVA, appropriate levels of design parameters are found, and then initial population of HS is defined according to the levels. Finally, optimum results of the problem are obtained by applying HS algorithm as follows: • • • •
Define initial harmony memory. Use algorithm operators to improvise a new harmony. Update harmony memory. Repeat the loop until the optimum shape is generated.
The trend in the research area of optimization is to improve the efficiency of algorithms. In this chapter, a new hybrid approach is proposed to improve the performance of the HS algorithm. The argument behind the proposed approach is that the strength of one algorithm can be used to improve the performance of another approach in the optimization process. The proposed hybrid approach is one of the first attempts to use Taguchi’s method to define the ranges of initial population space for the HS algorithm to solve shape optimization problems. The combination of Taguchi’s method and HS algorithm is resulted in a solution, which leads to better parameter values for shape optimization problems. The algorithm of the proposed hybrid approach can be outlined as follows:
94
A.R. Yildiz and F. Öztürk
BEGIN Step 1: Taguchi method Begin Choose convenient orthogonal array from Taguchi’s orthogonal arrays. Define levels and intervals For i:=1 to NOE (number of experiments) do begin Compute objective function values end; Choose convenient S/N ratio type based on objective function(s) For i:=1 to NOE do begin Compute S/N ratios end; Constitute ANOVA table for objective functions using S/N ratios Determine optimum levels and intervals using ANOVA table Use these levels and intervals for forming initial population end; Begin Input Step 2: Harmony search algorithm Initialize the problem and algorithm parameters. Initialize the harmony memory. Improvise a new harmony. Update the harmony memory. Check the stopping criterion. end; END
3 Shape Optimization of Vehicle Component In this section, the proposed approach is applied to the optimal shape design of a vehicle part taken from automotive industry. The objective functions are due to the volume and the frequency of the part which is to be designed for minimum volume and avoiding critical frequency subject to strength constraints. In the first stage, the experiments are designed to evaluate the effects of four design variables related to objective functions. The four shape design variables x1, x2, x3 and x4 are selected as shown in Fig. 2. The feasible range of design variables without shape distortions is considered as 6 < x1 < 30; 21 < x2 < 27; 8 < x3 < 14; and 28 < x4 < 46. Matrix experiments are designed using L16 orthogonal arrays and S/N ratios are conducted for each objective. Smaller the better and larger the better characteristics are applied to compute S/N ratios based on each objective as smaller the better for volume and compliance. The details about orthogonal array, S/N ratios, ANOVA analysis, and how they are computed and used for experimental evaluations are given in the reference of Phadke [29]. The parameter levels are taken as x1 = 30; 21 < x2 <27; 8 < x3 < 14; and 28 < x4 < 46, which are obtained from ANOVA analysis. More detailed explanation on
Hybrid Taguchi-Harmony Search Approach for Shape Optimization
95
X2
X4 X3
X1 Fig. 2 Design variables Table 1 Comparison of the optimization results for the side door bracket design
Initial design
Volume (cm3) 20,727.2
Frequency (Hertz) 8.3
Stress (MPa) 256
CAD optimum design
18,763.9
8.1
277
Genetic Algorithm
17,663
8.8
293
Hybrid GA [1]
16,754
9.3
291
HSA
16,981
8.9
294
HTHSA
16,416
9.36
298
ANOVA analysis of parameter levels for the shape design optimization problem can be obtained from [1]. The HS algorithm begins its search with harmony memory (HM) range defined by Taguchi’s method. Then, a new harmony is generated from the HM based on memory considerations, pitch adjustments, and randomization. If the new harmony vector is better than the worst harmony in the HM in terms of the objective function value, the new harmony is included in the HM and the existing worst harmony is excluded from the HM. The HM is then sorted by the objective function value. The computations are terminated when the termination criterion (optimal design) is satisfied. The results of hybrid Taguchi harmony search approach (HTHSA) for the design of the vehicle part are given in Table 1. It is clearly seen that shape design optimization performance is improved compared to traditional CAD and GA, hybrid
96
A.R. Yildiz and F. Öztürk
GA and original HS. ANSYS is used for CAD optimization process. The intervals of design variables are considered as 6 < x1 < 30; 21 < x2 < 27; 8 < x3 < 14; and 28 < x4 < 46. The structural layout results of the present hybrid approach are given in Fig. 3.
Fig. 3 Optimal structural layout
4 Conclusions This research describes a new optimization approach based on HS algorithm and Taguchi’s robust design approach for solving shape design optimization problems. Taguchi’s robust design approach is introduced to help in defining robust initial population levels of design parameters to achieve better initial HM. The design solution space of HS is refined based on the effect of the various design variables on objective functions. The HTHSA is applied to shape optimization of a vehicle component taken from automotive industry. It is seen that better results can be achieved with present hybrid optimization approach. Therefore, HTHSA is a suitable optimization technique for the solution of shape design optimization problems. Since HTHSA is a generalized optimization method, it can also be applied to other real-world optimization problems. Further research can be carried out to improve the proposed approach by integrating the key issues from the fields of multi-objective optimization, heuristic algorithms and local search techniques. Now, as further research, the authors consider hybridizing of HTHSA by local search techniques like hill-climbing to extend its improvements for solving shape design optimization problems.
References 1. Yildiz, A.R., Ozturk, N., Kaya, N., Ozturk, F.: Hybrid multi-objective shape design optimization using Taguchi’s method and genetic algorithm. Structural and Multidisciplinary Optimization 34, 317–332 (2007)
Hybrid Taguchi-Harmony Search Approach for Shape Optimization
97
2. Dereli, T., Filiz, I.H., Baykasoglu, A.: Optimizing cutting parameters in process planning of prismatic parts by using genetic algorithms. International Journal of Production Research 39, 3303–3328 (2001) 3. Yildiz, A.R., Saitou, K.: Topology Synthesis of Multi-Component Structural Assembly in Continuum Domain. In: Proceedings of ASME International Design Engineering Technical Conferences, New York, USA, pp. 3–6 (2008) 4. Colorni, A., Dorigo, M., Maniezzo, V.: Distributed optimization by ant colony. In: Proceedings of 1st European Conference on Artificial Life, pp. 134–142 (1991) 5. Woon, S.Y., Querin, O.M., Steven, G.P.: Structural application of a shape optimization method based on a genetic algorithm. Structural and Multidisciplinary Optimization 22, 57–64 (2001) 6. Liu, B., Haftka, R.T., Akgun, M.A., Todoroki, A.: Permutation genetic algorithm for stacking sequence design of composite laminates. Computer Methods in Applied Mechanics and Engineering 186, 357–372 (2000) 7. Yildiz, A.R., Kaya, N., Alankus, O.B., Ozturk, F.: Optimal design of vehicle components using topology design and optimization. International Journal of Vehicle Design 34, 387–398 (2004) 8. Geem, Z.W.: Optimal cost design of water distribution networks using harmony search. Engineering Optimization 38, 259–280 (2006) 9. Saka, M.P.: Optimum design of steel frames using stochastic search techniques based on natural phenomena: a review. In: Topping, B.H.V. (ed.) Civil engineering computations: tools and techniques, pp. 105–147. Saxe-Coburgh Publications (2007) 10. Sonmez, O.F.: Shape optimization of 2D structures using simulated annealing. Computer Methods in Applied Mechanics and Engineering 196, 279–329 (2007) 11. Kirkpatrick, S., Gelatt, C.D., Vecchi, M.P.: Optimization by simulated annealing. Science 220, 671–680 (1983) 12. Eberhart, R., Kennedy, J.: A new optimizer using particle swarm theory. In: Proceedings of IEEE Sixth International Symposium on Micro Machine Human Science. Nagoya, Japan, pp. 39–43 (1995) 13. Fourie, P.C., Groenwold, A.A.: The particle swarm optimization algorithm in size shape optimization. Structural and Multidisciplinary Optimization 23, 259–267 (2002) 14. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 15. Lee, K.S., Geem, Z.W.: A new structural optimization method based on the harmony search algorithm. Computers & Structures 82, 781–798 (2004) 16. Lee, K.S., Geem, Z.W.: A new meta-heuristic algorithm for continues engineering optimization: harmony search theory and practice. Computer Methods in Applied Mechanics and Engineering 194, 3902–3933 (2004) 17. Geem, Z.W.: Music-inspired harmony search algorithm: theory and applications. Springer, Berlin (2009) 18. Hasancebi, O., Carbas, S., Dogan, E., Erdal, F., Saka, M.P.: Performance evaluation of metaheuristic search techniques in the optimum design of real size pin jointed structures. Computers and Structures 87, 284–302 (2009) 19. Saka, M.P.: Optimum design of steel sway frames to BS 5950 using harmony search algorithm. Journal of Constructional Steel Research 65, 36–43 (2009) 20. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved harmony search algorithm for solving optimization problems. Applied Mathematics and Computation 188, 1567– 1579 (2007)
98
A.R. Yildiz and F. Öztürk
21. Yildiz, A.R.: A novel hybrid immune algorithm for global optimization in design and manufacturing. Robotics and Computer Integrated Manufacturing 25, 261–270 (2009) 22. Yıldız, A.R.: A novel particle swarm optimization approach for product design and manufacturing. International Journal of Advanced Manufacturıng Technology 40, 617–628 (2009) 23. Yildiz, A.R.: Hybrid immune-simulated annealing algorithm for optimal design and manufacturing. International Journal of Materials and Product Technology 34, 217– 226 (2009) 24. Fesanghary, M., Mahdavi, M., Minary-Jolandan, M., et al.: Hybridizing harmony search algorithm with sequential quadratic programming for engineering optimization problems. Computer Methods in Applied Mechanics and Engineering 197, 3080–3091 (2008) 25. Fan, S.S.K., Liang, Y.C., Zahara, E.: Hybrid simplex search particle swarm optimization for the global optimization of multimodal functions. Engineering Optimization 36, 401–418 (2004) 26. Xia, W.J., Wu, Z.M.: A hybrid particle swarm optimization approach for the job-shop scheduling problem. International Journal Advanced Manufacturing Technology 29, 360–366 (2006) 27. Rajasekaran, S., Lavanya, S.: Hybridization of genetic algorithm with immune system for optimization problems in structural engineering. Structural and Multidisciplinary Optimization 34, 415–429 (2007) 28. Deb, K.: Multiobjective Optimization Using Evolutionary Algorithms. Wiley, Chichester (2001) 29. Phadke, S.M.: Introduction to quality engineering, Asian Productivity Organization (1989)
An Introduction to the Hybrid HS-SQP Method and Its Applications Mohammad Fesanghary
*
Abstract. This chapter aims to present recent developments and applications concerning optimization with the hybrid HS-SQP method. This method has been successfully utilized in several engineering applications. In addition to the introduction of the concept of HS-SQP method, this chapter also presents some selected representative case studies covering synthesis of cost-optimal heat exchanger networks and economic utilization of electric power systems.
1 Introduction Evolutionary algorithms (EAs) have been widely used in science and engineering for solving complex problems. In general, these methods are good at finding the promising regions of search space. Also, initial configuration has no effect on the solution of these methods. However, the drawback of these methods is their slowness. On the other hand, gradient based algorithms are very effective in performing local search. In general, gradient based algorithms converge faster and they can obtain solutions with higher accuracy compared to evolutionary approaches. However, these approaches often rely deeply on the initial starting point. A good starting point is vital for these methods to be executed effectively. To obtain a more efficient optimization technique, it is common to combine different search strategies trying to compensate deficiencies of the individual algorithms. During the last few years, new methods have been developed in order to improve the lack of accuracy of the EAs, using local optimization algorithms. These techniques are based on combination of local search methods, which are good at finding local optima (local exploiter), and global search methods (global explorer). These methods are commonly known as hybrid algorithms and have been successfully used to solve a wide variety of problems. The studies show that hybrid methods can search more efficiently and can often find better solutions [1-6]. Mohammad Fesanghary Department of Mechanical Engineering, Louisiana State University, Baton Rouge, LA 70802, USA E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 99–109. © Springer-Verlag Berlin Heidelberg 2010 springerlink.com
100
M. Fesanghary
The need for developing powerful and efficient hybrid optimization methods is the subject of intensive research. In this context, the newly developed hybrid HSSQP method [7] is introduced in this chapter. The rest of this chapter is organized as follows: first a brief review of the hybrid HS-SQP method is given and then to show the effectiveness of the HS-SQP for practical applications, three case studies are considered.
2 Hybrid HS-SQP Method The hybrid HS-SQP method uses the harmony search (HS) for finding optimal regions and the SQP method for fine tuning the HS solutions. Therefore, this algorithm increases the possibility of finding the global optimal point and improves the convergence speed. In the following subsections the main concepts of HS-SQP method will be introduced.
2.1 Combination Strategies The particular combination is important in terms of possible solution quality and computational efficiency. The right balance between the local exploitation and global exploration should be found. Two different combination strategies can be used here; in the first strategy the HS performs a coarse search in the first stage. When the HS is completed or shows a negligible trend of improvement after many iterations, the SQP begins its task and uses the best vector from the harmony memory (HM) as its starting point. In the second strategy both methods are simultaneously run; all new improvised vectors are continuously used as initial values for the SQP method. If the locally optimized vectors have a better fitness value than those in the HM, they will be re-implanted into the HM.
2.2 Resource Allocation and Computational Time In order to obtain a high quality solution with minimum resource requirement, the two above mentioned strategies are combined with a probability of Pc. In this way the SQP method is integrated into the HS as illustrated in Fig. 1. For instance, in each iteration, with probability equal to Pc, the SQP which uses the new improvised vector as its starting point is applied. The HM is updated if the locally optimized vector has better fitness value than those in the HM. Finally, after the specified termination criteria for the HS are reached, the SQP is then applied using the best solution obtained by the HS. In order to further improve the performance of the hybrid algorithm, the computation time spent by the HS and SQP should be adjusted. In many problems, it is not efficient to carry out a local optimization algorithm for every solution vector due to the dimensions of the search space and limitations of computational resources. This is especially important when the local search algorithm has a high
An Introduction to the Hybrid HS-SQP Method and Its Applications
101
computational cost. Therefore the SQP is applied to only a few solution vectors. In this strategy Pc controls the allocation of resources between the HS and the SQP. As Pc increases, the SQP consumes more time, but in general, the hybrid method is expected to produce better results. When Pc=1, the strategy is similar to the second hybrid strategy; and when Pc is zero, the strategy is similar to the first strategy. Based on author experience a fairly small value for Pc (e.g., Pc = 0.01 ~ 0.1) is recommended. One of the main advantages of this strategy is that the computational cost of applying the SQP to only a few solution vectors, hardly affects the total time spent by the HS-SQP algorithm. procedure HS-SQP Initiate_parameters() Initialize_HM() while (not_termination) for I = 1 to number of decision variables N do if ( rand() < PHMCR) /* (memory consideration) */ X[I] will be randomly chosen from harmony memory if ( rand() < PPAR) /* (pitch adjustment) */ X[I] = X[I] ± ∆ end if else /* (random selection) */ X[I]= LBI + rand() *(UBI-LBI) end if end for if ( rand() < PC) /* local search using SQP */ Run SQP using X as starting point fitness_X=SQP(X) else fitness_X=evaluate_fitness(X) end if update_memory(X,fitness_X) /* if applicable */ end while fitness_X=SQP(Xbest) end procedure Fig. 1. Pseudo code of the hybrid algorithm
2.3 Case Study 1 The objective is to find the minimum fabricating cost of the welded beam subject to constraints on shear stress, bending stress, buckling load, end deflection and side constraint. There are four design variables: h, l, t and b. The schematic of the beam is shown in Fig. 2.
102
M. Fesanghary
Fig. 2 Schematic of welded beam
This problem has been solved using a variety of evolutionary and traditional mathematical programming methods including: GA [8, 9], APPROX (Griffith and Stewart’s successive linear approximation) [10], DFP [10], SIMPLEX [10], HS [11] and improved harmony search (IHS) [12]. The optimization results are shown in Table 1. In this case the HS-SQP [7] is at least three times faster than IHS. As can be seen the HS-SQP has the best performance among these methods. Table 1 Optimal results for case study 1 Method GA[8] HS[11] APPROX[10] DFP[10] Simplex[10] GA[9] IHS[12] HS-SQP[7]
Optimal design variables H l 0.2088 3.4205 0.2442 6.2231 0.2444 6.2189 0.2434 6.2552 0.2792 5.6256 0.2489 6.1730 0.20573 3.47049 0.20572 3.47060
cost t 8.9975 8.2915 8.2915 8.2915 7.7512 8.1789 9.03662 9.03682
b 0.2100 0.2443 0.2444 0.2444 0.2796 0.2533 0.20573 0.20572
1.7483 2.3807 2.3815 2.3841 2.5307 2.4328 1.7248 1.7248
3 Economic Power Dispatch Economic dispatch (EP) is considered to be one of the key functions in electric power system operation. The ED problem is commonly formulated as an optimization problem aimed to minimize the total generation cost of units, while satisfying generation/network constraints. In the past two decades various linear and nonlinear programming methods [13-20] have been used to solve ED problems. In general, compared to stochastic approaches, the gradient-based methods converge faster and can obtain solutions with higher accuracy. However, since these methods use gradient information, the variables and cost function of the generators need to be continuous. Furthermore, a
An Introduction to the Hybrid HS-SQP Method and Its Applications
103
good starting point is crucial for these methods to execute successfully. However, realistic ED formulations result in non-convex optimization problems, which are challenging for traditional mathematical programming methods. Recently, as an alternative to the conventional mathematical approaches, the evolutionary optimization methods such as genetic algorithms (GAs) [21], tabu search [22], ant colony (AC) [23], harmony search [24], evolutionary programming (EP) [25], particle swarm optimization (PSO) [26] and differential evolution (DE) [27] have been used to obtain global or near global optimum solutions for ED problems. These methods are effective for global searching and also, limitations regarding the form of the cost functions employed and the continuity of variables used for the mathematical optimization methods can be completely eliminated. However the convergence speed of these methods is not satisfying in some cases. This section focuses on the application of the HS-SQP algorithm for solving ED problems, aiming to show the efficiency of this method for practical ED applications.
3.1 Problem Formulation To simplify the optimization problem and facilitate the application of classical techniques, cost functions of generators are typically modeled by smooth quadratic function form given as, n
(
CT = ∑ ai + bi Pi + ci Pi 2 i =1
)
(1)
where CT is the total generation cost; n is the total number of generating units; ai, bi and ci are the cost coefficients of the ith unit; and Pi is the actual power output of the ith unit. To model a more realistic cost function of generators, the valve-point effects need to be considered. To model the valve-point effects a recurring rectified sinusoidal term is added to Eq. (1) as follows: n
( (
CT = ∑ ⎡ ai + bi Pi + ci Pi + α di sin fi Pi ⎢ i =1 ⎣ 2
min
))
− Pi ⎤ ⎦⎥
(2)
where di and fi are some constant coefficients; and Pi min is the lower generation limit of the ith unit. Generally, the ED problems are subjected to various constraints including: power balance, generation limit, maximum line flow, prohibited operating zones and ramp-rate limits.
3.2 Case Study 2 The system contains 6 thermal generation units. All units have prohibited operating zones and ramp-rate limits. The characteristics of the generation units and constraints are given in [28]. The load demand is 1263MW.
104
M. Fesanghary Table 2 Results of case study 2 power output (MW) P1 P2 P3 P4 P5 P6 Total Ploss
Method GA 474.81 178.64 262.21 134.28 151.90 74.18 1276.03 13.02
PSO 447.50 173.32 263.48 139.06 165.48 87.13 1275.96 12.96
ESO 451.56 173.44 263.99 147.46 164.68 71.32 1272.46 12.82
DE 447.74 173.41 263.41 139.08 165.36 86.94 1275.95 12.96
HS 449.381 173.530 263.524 132.049 167.262 90.262 1276.01 13.08
HS-SQP 447.496 173.314 263.445 139.055 165.475 87.125 1275.91 12.95
Table 2 presents the best obtained solution using the HS-SQP [28] method and compares the results with those obtained from GA [29], ESO [30], DE [27], and PSO [26]. It is observed that the HS-SQP method performs better than the other methods both in terms of the solution quality and convergence characteristics. Table 3 shows the robustness analysis of the methods for 100 independent runs. In general it can be concluded that the obtained solutions are similar in this case and the difference of the approaches lies in their convergence characteristics. Among these methods HS-SQP and DE shows more robustness in their convergence behaviors. Table 3 Performance of different algorithms in 100 trial tests Generation cost ($) Max. Min GA 15524 15459 PSO 15492 15450 ESO** 15470 15408 DE 15450 15450 HS-SQP 15453 15449 * Results obtained from reference ** Power balance constraint is not satisfied Method
Average 15469 15454 15430 15450 15450
CPU time (s) 41.58* 14.86* 0.360* 0.033* 0.14
4 Heat Exchanger Network Synthesis The proper synthesis of heat exchanger networks (HENs) is an important task in chemical engineering and can lead to considerable saving in energy consumption of process industries. Although several mathematical programming methods and stochastic methods have been developed for HEN synthesis problem during the last two decades, the complexity of the task reveals the need for developing efficient algorithms to precisely locate the optimum HEN topology. In this context, a novel hybrid approach which combines HS with SQP has been recently developed [31], aiming to provide a viable alternative for conventional HEN optimization methods.
An Introduction to the Hybrid HS-SQP Method and Its Applications
105
4.1 Problem Statement The HEN synthesis problem can be stated as follows: Given are (a) a set of hot and cold process streams, their supply and target temperatures and their heat capacity flowrates; (b) a set of hot and cold utilities and their corresponding temperatures; (c) a minimum temperature approach; (d) the overall heat transfer coefficient of each potential match; and (e) a maximum number of units. The objective is to find the heat exchangers configuration and their heat loads that provide the minimum annual cost of the network. For each HEN structure some equality and inequality constraints, such as overall heat balance for each process stream, the minimum temperature approach (∆Tmin) and mass conservation in branches, should be met.
4.2 Solution Methodology To decrease the complexity of the problem and to make an efficient use of the speed and local search characteristic of the mathematical methods, the HEN synthesis problem is divided into two main parts: (a) defining the structure of HEN and, (b) computing optimal exchanger loads and stream-split fractions for each generated network as shown in Fig. 3.
Fig. 3 The structure of the hybrid algorithm
106
M. Fesanghary
The proper choice of optimization methodology for each part depends on the complexity of the problem which is studied. Recent work by Furman and Sahinidis [32] has shown that the problem of finding the optimum HEN structure is a NP-hard problem. This limits the usefulness of deterministic methods in part (a) since their computation time increases exponentially with problem size. It is known that meta-heuristic optimization techniques are effective in providing good solutions for problems classified as NP-hard. Thus, HS is employed to carry out the structural optimization of HENs. In part (b), the problem of finding optimum exchanger loads and stream-split fractions for a given HEN structure generally has continuous design variables with nonlinear objective function and constraints. Although both meta-heuristic and deterministic methods can be utilized for this part, the prime objective is to use a method with less computational time and high quality solutions. Therefore HSSQP algorithm is used in part (b).
4.3 Case Study 3 The example presented by Yee and Grossmann [33] is considered as a third case study. This problem consists of five hot streams and one cold stream. No branches on the hot streams are permitted and ∆Tmin is 10 K for this problem. The results obtained using the hybrid methodology is presented in Table 4 and also shown in Fig. 4. The total annual cost for this configuration is $572,476 which is less than those obtained by MINLP methods [33, 34] and also a GA based method [35]. Note that this configuration has 8 units which mean a simpler unit with less complexity and piping prices.
Fig. 4 Optimal HEN structure for case study 3
An Introduction to the Hybrid HS-SQP Method and Its Applications
107
Table 4 Optimal results for case study 3 Method
Units
QH (kW)
QC (kW)
Annual Cost
MINLP [33]
9
3530
70
$575,595
MINLP[34]
7
3676
216
$576,640
GA-Simplex [35]
9
3620
160
$573,205
HS & HS-SQP[31]
8
3567
107
$572,476
5 Conclusions The ability of the HS-SQP algorithm was demonstrated using several test problems and its performance was compared with other conventional methods. Three types of engineering optimization problems were studied in this chapter. The first type is related to the design optimization of structures. The second type concerns the economic utilization of electric power systems, and the third deals with the synthesis of the heat exchanger networks. The results reveal that HS-SQP outperforms other approaches not only in terms of the quality of the obtained solutions but also in terms of the computational time.
Acknowledgments The author would like to thank Rina Mascarenhas and M. Minary-Jolandan for their constructive comments and suggestions.
References 1. Moscato, P.: On evolution, search, optimization, genetic algorithms and martial arts: Towards memetic algorithms, Tech. Rep. 826. California Inst. Technol., Pasadena (1989) 2. Moscato, P., Cotta, C.: A gentle introduction to memetic algorithms. In: Glower, F., Kochenberger, G. (eds.) Handbook of Metaheuristics. Kluwer, Norwell (1999) 3. Bersini, H., Renders, B.: Hybridizing genetic algorithms with hill-climbing methods for global optimization: Two possible ways. In: Proc. IEEE Int. Symp. Evolutionary Computation, Orlando, FL (1994) 4. Merz, C.J.: A principal components approach to combining regression estimates. Mach. Learn. 36, 9–32 (1999) 5. He, J., Xu, J., Yao, X.: Solving equations by hybrid evolutionary computation techniques. IEEE Trans. Evol. Comput. 4, 295–304 (2000) 6. Sarker, R., Mohammadian, M., Yao, X. (eds.): Evolutionary Optimization. Kluwer, Norwell (2002)
108
M. Fesanghary
7. Fesanghary, M., Mahdavi, M., Minary-Jolandan, M., Alizadeh, Y.: Hybridizing harmony search algorithm with sequential quadratic programming for engineering optimization problems. Computer Methods in Applied Mechanics and Engineering 197, 3080–3091 (2008) 8. Coello, C.A.C.: Use of a self-adaptive penalty approach for engineering optimization problems. Computers in Industry 41, 113–127 (2000) 9. Deb, K.: An efficient constraint handling method for genetic algorithms. Comput. Methods Appl. Mech. Engrg. 186, 311–338 (2000) 10. Ragsdell, K.M., Phillips, D.T.: Optimal design of a class of welded structures using geometric programming. ASME J. Engrg. Ind. Ser. B 98, 1021–1025 (1976) 11. Lee, K.S., Geem, Z.W.: A new meta-heuristic algorithm for continues engineering optimization: harmony search theory and practice. Comput. Methods Appl. Mech. Engrg. 194, 3902–3933 (2004) 12. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved harmony search algorithm for solving optimization problems. Appl. Math. Comput. 188, 1567–1579 (2007) 13. Lin, C.E., Chen, S.T., Huang, C.L.: A direct Newton-Raphson economic dispatch. IEEE Trans. Power Syst. 7, 1149–1154 (1992) 14. Lin, C.E., Viviani, G.L.: Hierarchical economic dispatch for piecewise quadratic cost functions. IEEE Trans. Power App. Syst. 103, 1170–1175 (1984) 15. Wood, A.J., Wollenberg, B.F.: Power generation, operation and control. Wiley, New York (1994) 16. Yang, H.T., Chen, S.L.: Incorporating a multi-criteria decision procedure into the combined dynamic programming/production simulation algorithm for generation expansion planning. IEEE Trans. Power Syst. 4, 165–175 (1989) 17. Granville, S.: Optimal reactive dispatch through interior point methods. IEEE Trans. Power Syst. 9, 136–146 (1994) 18. Chen, C.L., Wang, S.C.: Branch-and-bound scheduling for thermal generating units. IEEE Trans. Energy Convers. 8, 184–189 (1993) 19. Liang, Z.X., Glover, J.D.: A zoom feature for a dynamic programming solution to economic dispatch including transmission losses. IEEE Trans. Power Syst. 7, 544–550 (1992) 20. Papageorgiou, L.G., Fraga, E.S.: A mixed integer quadratic programming formulation for the economic dispatch of generators with operating zones. Electric Power Syst. Res. 77, 1292–1296 (2007) 21. Kuo, C.C.: A novel string structure for economic dispatch problems with practical constraints. Energy Convers. Manage. 49, 3571–3577 (2008) 22. Lin, W.M., Cheng, F.S., Tsay, M.T.: An improved tabu search for economic dispatch with multiple minima. IEEE Trans. Power Syst. 17, 108–112 (2002) 23. Song, Y.H., Chou, C.S.V., Min, Y.: Large-scale economic dispatch by artificial ant colony search algorithms. Electr. Mach. Power Syst. 27, 679–690 (1999) 24. Vasebi, A., Fesanghary, M., Bathaee, S.M.T.: Combined heat and power economic dispatch by harmony search algorithm. International Journal of Electrical Power & Energy Systems 29, 713–719 (2007) 25. Somasundaram, P., Kuppusamy, K., Kumudini Devi, R.P.: Economic dispatch with prohibited operating zones using fast computation evolutionary programming algorithm. Electr. Power Syst. Res. 70, 245–252 (2004) 26. Gaing, Z.L.: Particle swarm optimization to solving the economic dispatch considering the generator constraints. IEEE Trans. Power Syst. 18, 1187–1195 (2003)
An Introduction to the Hybrid HS-SQP Method and Its Applications
109
27. Noman, N., Iba, H.: Differential evolution for economic load dispatch problems. Electr. Power Syst. Res. 78, 1322–1331 (2008) 28. Fesanghary, M., Ardehali, M.M.: A novel meta-heuristic optimization methodology for solving various types of economic dispatch problem. Energy 34, 757–766 (2009) 29. Yalcionoz, T., Altun, H., Uzam, M.: Economic dispatch solution using a genetic algorithm based on arithmetic crossover. In: Proc. IEEE Proto Power Tech. Conf., Proto, Portugal (2001) 30. Pereira-Neto, A., Unsihuay, C., Saavedra, O.R.: Efficient evolutionary strategy optimization procedure to solve the nonconvex economic dispatch problem with generator constraints. IEE Proc. Gener. Transm. Distrib. 152, 653–660 (2005) 31. Khorasany, R.M., Fesanghary, M.: A novel approach for synthesis of cost-optimal heat exchanger networks. Computers & Chemical Engineering 33, 1363–1370 (2009) 32. Furman, K.C., Sahinidis, N.V.: Computational complexity of heat exchanger network synthesis. Computers & Chemical Engineering 25, 1371–1390 (2001) 33. Yee, T.F., Grossmann, I.E., Kravanja, Z.: Simultaneous optimization models for heat integration–I. Area and energy targeting and modeling of multi-stream exchangers. Computers & Chemical Engineering 14, 1151–1164 (1990) 34. Yee, T.F., Grossmann, I.E.: Simultaneous optimization models for heat integration. II. Heat exchanger network synthesis. Computers & Chemical Engineering 14, 1165– 1184 (1990) 35. Lewin, R.: A Generalized method for HEN synthesis using stochastic optimization. II. Synthesis of cost-optimal networks, Computers & Chemical Engineering 22, 1387– 1405 (1998)
Solution of Groundwater Management Problems Using Harmony Search Algorithm M. Tamer Ayvaz
*
Abstract. Groundwater is not only an important component of water resources, but also a reliable source of fresh water for domestic and industrial uses. However, due to climate change and the fast population growth, the quality and quantity of groundwater resources have been continuously decreasing. Therefore, sustainable management strategies should be developed for groundwater systems by decision makers. This chapter provides a brief review dealing with the use of Harmony Search (HS) optimization algorithm for solving the groundwater management problems. Review results indicate that HS can successively solve the groundwater management problems and provides identical or better results than the other nonheuristic and heuristic optimization algorithms.
1 Introduction Groundwater management becomes an important issue nowadays since the importance of the groundwater resources has been continuously growing. Mathematical models are the necessary tools of modeling the groundwater systems for determining the responses of the aquifer systems for different management alternatives. However, these models cannot be eligible to determine the best management alternative from the set of alternatives. Therefore, they are combined with optimization algorithms to solve the management problems. Note that the mathematical models and the optimization algorithms are combined through embedded and response matrix approaches. The solution of a management problem through embedded approach requires defining the solution of governing partial differential equations as a constraint set of the optimization model [1]. For each cycle of the optimization process, these equations are solved based on the management set defined by the optimization model. The key benefit of the embedded approach is that it always provides detailed information of hydraulic head distributions over the whole flow domain. However, its main drawback is that it requires high computational times especially for the big flow domains [2]. In response matrix approach, M. Tamer Ayvaz Department of Civil Engineering, Pamukkale University, Denizli, Turkey E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 111–122. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
112
M.T. Ayvaz
it is not required to define the solution of governing equations in the constraint set. Instead, an external mathematical model is used to determine the unit responses which describe the change of head values at selected observation locations due to a unit change in the pumping rates [2]. This approach works on the principles of superposition and usually faster than the embedded approach. However, its drawback is that it cannot be used for the cases where system response is nonlinear. Besides, it provides less information about hydraulic head distribution over the flow field than embedded approach. Groundwater management models may be mainly classified as the hydraulic and quality management models [3]. The typical problems of hydraulic management models are to maximize the total pumping from the aquifer system; or to minimize the total pumping cost for satisfying the given water demand [4]. On the other hand, the main objective of the quality management models is to solve the pollution source identification problems [5] or to determine the best remediation strategy to clean up the aquifer system [6]. In both hydraulic and quality management models, a variety of optimization algorithms has been used in the current literature. These algorithms include linear programming (LP) [7-10], mixed-integer programming (MIP) [11-13], nonlinear programming (NLP) [14-15], and dynamic programming (DP) [16-17]. Although these algorithms may successfully solve the most problems, they may have some limitations. These methods may require good initial solutions to find an optimum solution. Also, the solution spaces of the problem may have a non-convex and may include multiple local optimal solutions. So, all the obtained solutions of these methods may not be a global optimum [2]. Based upon these facts, using the heuristic approaches is preferred for solving these type problems. Among them the genetic algorithm (GA) [18-19], tabu search (TS) [20], particle swarm optimization (PSO) [21], and simulated annealing (SA) [22] may be the most popular ones. Recently, a new optimization algorithm, Harmony Search (HS), is developed by Geem et al. [23]. HS is a heuristic search method which is based on the musical process of searching for a perfect state of harmony. In HS algorithm, musical process aims to find the musically pleasing harmony as determined by aesthetic or artistic standards, just as the optimization process seeks to find a global optimum solution as determined by an objective function value. This is the main analogy between the musical improvisation and optimization. The main objective of this chapter is to review the application of HS algorithm to the solution of groundwater hydraulic management problems. In order to evaluate the performance of the HS algorithm, two example management problems are examined. The results of HS algorithm are compared with the results those obtained by several heuristic and non-heuristic optimization algorithms [24-27]. The remaining of this chapter is organized as follows: first, the computational structure of HS algorithm is presented; second, how to apply the HS algorithm to the solution of groundwater management problems is described; and finally, the performance of the HS algorithm is tested on two example management problems.
Solution of Groundwater Management Problems Using Harmony Search Algorithm
113
2 Heuristic Harmony Search (HS) Algorithm Like other heuristic optimization algorithms, the HS is also inspired from a heuristic event. However, its main difference from the others is that HS does not get its main philosophy from a natural process, instead, gets from the musical improvisation which occurs when a group of musicians searches for a better state of harmony. This philosophy first adapted to the solution of optimization problems by Geem et al. [23]. In this adaptation, each musician mimics to a decision variable and the notes in the musicians’ memories correspond to the values of the decision variables. When the musicians find the fantastic harmony from their memories, it means, a global optimum solution is obtained using the corresponding decision variables. Note that the computational structure of the HS algorithm is based on the following three operations: i) Playing a note from the harmony memory, ii) Playing a note randomly from the possible note range, iii) Playing a note which is close to another one stored in memory. These operations are all musically based and integration of them allows finding a musically pleasing harmony [3]. Adaptation of these musical operations into the engineering optimization problems is as follows: i) New variable values are selected from the harmony memory, ii) New variable values are randomly selected from the possible range, iii) New variable values are further replaced with other values which are close to the current values. Combination of these three operations allows searching a global optimum solution in an optimization framework. For continuous decision variables, the computational scheme of HS can be given as follows [28]: 1. Initialize the harmony memory: Generate initial solution vectors as many as HMS, x1 ⋅⋅⋅ x HMS . 2. Generate a new solution vector x′ for each xi′ : - with probability HMCR select xi′ from memory, xi′ = xiRnd (1, HMS ) 3. Pitch adjustment: For each xi′ : − with probability PAR change xi′ as, xi′ = xi′ ± bw × Rnd (0;1) . − with probability (1−PAR) do nothing. − with probability (1−HMCR) select a new random value from the possible range. 4. If x′ is better than the worst x j in harmony memory, replace x j with x′ . 5. Repeat Steps 2 to 5 until the given termination criterion is satisfied. The solution parameters of HS are: Harmony Memory Size (HMS), Harmony Memory Considering Rate (HMCR), Pitch Adjusting Rate (PAR), and distance bandwidth (bw). Note that the HM is a matrix where the decision variables and the
114
M.T. Ayvaz
corresponding objective function values are stored. The HMCR and PAR parameters are used to improve the solution vector globally and locally. The computational procedure of HS is described in Figure 1.
Fig. 1 Analogy between Musical Improvisation and Optimization [29]
As can be seen from Figure 1, each musician has several notes in their HM. The main question to be asked here is the “which notes will be played by the musicians to find a musically pleasing harmony?”. Depending on the three operations of improvising a new harmony, the answer of this question is given as follows: i)
Memory Consideration: The first musician in Figure 1 has three notes, {La, Si, Do} in his HM. With probability HMCR(1−PAR), he decides to choose and play La from his HM. Since {La, Si, Do} corresponds to {1.0, 2.2, 2.6} in the optimization process, choosing and playing La corresponds to choosing and using 1.0 as the first decision variable. ii) Pitch Adjusting: The second musician in Figure 1 has also three notes, {Do, Re, Mi} in his HM. Unlike the first musician, with probability HMCR×PAR, he chooses Do and plays its neighbour Do#. Since Do corresponds to 3.2 in the optimization process, its neighbour Do# corresponds to 3.1 which is a small random amount neighbour to 3.2.
Solution of Groundwater Management Problems Using Harmony Search Algorithm
115
iii) Random Selection: The third musician in Figure 1 has also three notes, {Fa, Sol, La} in his HM. Although his HM is used in the previous improvisations, due to his musical knowledge, he knows all the possible notes in the La scale. Thus, he decides to choose and play a note randomly, for example Mi in this case. As differently from the possible data set stored in HM, 1.6 is randomly chosen and used in this case, even if it does not exist in HM. After musicians’ decision of what to play based on the memory consideration, pitch adjustment and random selection, the new harmony is composed as {La, Do#, Mi} which corresponds to {1.0, 3.1, 1.6} in the optimization process. This iterative process is repeated until the given termination criterion is satisfied. Note that HS algorithm is applied to various engineering optimization problems such as music composition [30], sudoku puzzle [31], structural design [32], optimum cost design of water distribution networks [33], robotics [34], groundwater modeling [2,35], soil stability analysis [36], energy system dispatch [37], transport energy demand modeling [38], and medical physics [39] etc. The detailed information about HS algorithm can be found at algorithm’s web site [40].
3 Mathematical Formulation of Groundwater Management In groundwater management, the main pupose is to select the best management strategy that aims to maximize the economic, hydraulic, and environmental benefits [4]. Note that the management alternatives usually have some constraints including well capacities, hydraulic heads, drawdowns, or water demand requirements, etc [2] and all of them must be included to the solution process of the optimization model. Before solving the problem through optimization model, first, it is necessary to solve the governing groundwater flow equation since its solution is required to predict the response of the aquifer system. The govening flow equation for a two-dimensional unconfined aquifer system can be given as [41]: T
∇ ⋅ Kh ⋅∇h + R −
N
∑∑ Q δ ( x ) = S t i
t =1 i =1
i
y
∂h ∂t
(1)
In Equation (1), K is the hydraulic conductivity, h is the hydraulic head, t is the time, R is the areal recharge rate, Qit is the pumping/injection rate at well i and time t, δ ( xi ) is a Dirac delta function evaluated at xi , S y is the specific yield, ∇
is the two-dimensional gradient operator, and N is the number of pumping wells. Note that the solution of Equation (1) is usually performed through finite difference (FD) or finite elements (FE) methods whose definitions are the beyond of this chapter. It should be noted that the typical problems in groundwater hydraulic management are to maximize the groundwater pumping or to minimize the total pumping cost for given water demand [25]. For the first problem, the decision variables are the associated pumping rates. There are two constraint sets dealing
116
M.T. Ayvaz
with the problem: i) pumping rates must be in a range of specified lower and upper bounds; ii) hydraulic head values at well locations must be greater than a specified lower bound. Depending on these constraints, the management model can be stated as follows: N
z = max
∑Q
(2)
i
i =1
subject to Qi ,min ≤ Qi ≤ Qi ,max
i = 1, 2,3, ⋅⋅⋅, N
(3)
hi ≥ hi ,min
i = 1, 2,3, ⋅⋅⋅, N
(4)
where Qi,min and Qi,max are the minimum and maximum bounds of the pumping rates at well i; and hi,min is the minimum hydraulic head value at well i. The main problem of the second management model is to minimize the pumping cost which includes the drilling, capital and operational costs, respectively. The decision variables of the optimization model are the associated pumping rates. The constraints set can be defined as follows: i) total pumping from the aquifer system must be greater than the given water demand; ii) hydraulic heads at well locations must be greater than a specified lower bound; iii) all the pumping rates must be in the range of a specified lower and upper bounds. This management model can be stated as follows: ⎧N b z = min ⎨∑ ⎡ a1κ ( di ) + a2 Qi ⎢ ⎩ i =1 ⎣
( ) (d
1
b2
i
− hi
)
b3
⎫ + a3Qi di − hi ⎤ ⎬ ⎥⎦ ⎭
(
)
(5)
subject to N
∑Q i =1
i
≥ Q
(6)
hi ≥ hi ,min
i = 1, 2,3, ⋅⋅⋅, N
(7)
Qi ,min ≤ Qi ≤ Qi ,max
i = 1, 2,3, ⋅⋅⋅, N
(8)
⎪⎧1 if Qi ≠ 0 ⎪⎩0 if Qi = 0
i = 1, 2,3, ⋅⋅⋅, N
(9)
κ =⎨
where the terms in the right-hand side of Equation (3) are the well drilling, capital and well operation costs; ak and bk ( ∀k = 1, 2,3) are the cost coefficients and the
constants indicating economies of scale; Q is the given water demand; di is the depth of the well at location i; and κ is the term which equals the cost of well drilling to zero when the pumping rate of that well is zero.
Solution of Groundwater Management Problems Using Harmony Search Algorithm
117
4 Numerical Applications As summarized above, a wide variety of optimization problems has been solved using HS optimization algorithm. Among them, Ayvaz [2] first applied the HS to the solution of groundwater management problems. In the related study, three common management problems are solved: maximizing the total pumping from an aquifer system; minimizing the total pumping cost; and minimizing the total pumping cost for multiple management periods. Note that while the first and the second problems have steady-state flow conditions, the last one is solved for transient flow conditions. In the following sections, the identified results of HS for the first two management problems [2] will be compared with LP [24], NLP [24], GA [24-25], SA [25], GASAPF (GA based SA penalty function approach) [26], and SCE-UA (shuffled complex evaluation method developed at the University of Arizona) [27].
4.1 Example 1 The first example problem deals with the maximization of the total pumping from an aquifer system. The plan and cross-sectional views of the unconfined aquifer system under consideration can be seen in Figure 2. As can be seen from Figure 2, the aquifer has a 20 m specified head boundary condition at the west (river) and east (swamp), and a no-flow boundary condition at the other sides. The porous medium is mainly composed from mixed sandgravel and the hydraulic conductivity is 50 m/day. Also, there is a 0.001 m/day areal recharge flux into the aquifer. The number of pumping wells to be optimized is 10 for this example. All the pumping rates must be in the range of 0 to 7,000 m3/day and hydraulic head values at well locations must be greater than zero. The objective function for this problem is Equation 2. Note that Equation 2 and its constraint set are linear in squared head values [24]. Thus, global optimum of Equation 2 can be found using LP. Subject to the constraints identified above, maximization of Equation 2 yields the results given in Table 1. From the literature, the global optimum solution for this example is 59,300 m3/day. Note that this example is solved by two different GA based solution models as indicated in Table 1. Comparison of these solutions and LP indicates that the second GA solution (59,000 m3/day) [25] closely agrees with LP than the first GA solution (58,000 m3/day) [24]. The reason of this may be associated with the differences between the used discretization schemes. This difference also influences the number of simulations. While the first GA model requires 640 simulations, the second one requires 27,800. For this example, the other solution methods produce the following results: 59,400 m3/day from SA; 59,078 m3/day from GASAPF; 59,266 m3/day from SCE-UA; and 59,279 m3/day from HS. These results state that the SA found a better objective function value than GASAPF, SCEUA and HS. However, the identified pumping rates of SCE-UA and HS much closely agree with the LP solution than SA. The number of required simulations indicates that the HS requires fewer simulations (8,843) than SA (17,200).
118
M.T. Ayvaz
Q6
Q2
Q5
Q1
Q4
Q10
Q9
Q8 Q7
4,500 m
Q3
Swamp, h = 20 m
River, h = 20 m
No-flow
No-flow
(a)
10,000 m
Elevation (m)
Areal Recharge R = 0.001 m/d
1020 1000
Sand & Gravel K = 50 m/d
River
Swamp
(b)
980 Bedrock
Fig. 2 Aquifer System: (a) Plan View and (b) Cross-Sectional View [24] 3
Table 1. Comparison of Optimized Pumping Rates (Units: m /day) Wells 1 2 3 4 5 6 7 8 9 10 Total Pumping Number of Simulations
LP [24] 7,000 7,000 7,000 6,000 4,500 6,000 6,800 4,100 4,100 6,800
GA [24] 7,000 7,000 7,000 7,000 2,000 6,000 7,000 4,000 4,000 7,000
GA [25] 7,000 7,000 7,000 5,000 5,000 6,000 7,000 4,000 4,000 7,000
SA [25] 7,000 7,000 7,000 6,200 4,700 6,200 6,650 4,000 4,000 6,650
GASAPF [26] 7,000 7,000 7,000 6,056 4,290 6,056 6,774 4,064 4,064 6,774
SCE–UA [27] 7,000 7,000 7,000 5,987 4,477 5,986 6,814 4,094 4,094 6,814
HS [2] 7,000 7,000 7,000 5,904 4,590 5,904 6,821 4,121 4,120 6,820
59,300
58,000
59,000
59,400
59,078
59,266
59,279
N/A
640
27,800
17,200
N/A
N/A
8,843
Solution of Groundwater Management Problems Using Harmony Search Algorithm
119
4.2 Example 2 The second example deals with the minimization of the pumping cost including drilling, capital and operation costs to satisfy the 30,000 m3/day water demand from the aquifer system in Figure 2. Similar to previous example, all the pumping rates must be in the range of 0 to 7,000 m3/day and head values at well locations must be greater than zero. Note that this constraint set is handled through a penalty function approach whose definition is out of scope of this chapter. For this example, the objective function is Equation 5. Table 2 compares the identified results of HS [2] and NLP [24], GA [24-25], SA [25], and SCE-UA [27]. It can be seen from Table 2 that all the solution algorithms have different results in terms of the identified pumping rates. This result states that this example has multiple global optimum solutions. While all the heuristic algorithms satisfy the given water demand, however, there is a small difference in the NLP solution. Among the final results, the minimum objective function value, $106,891, is obtained in HS solution. To obtain this result, HS requires 7,494 simulations. As can be seen, this example was also solved by two different GA models where the first one solves the problem in 896 simulations whereas the second one solves it about 8,000. The reason of this is associated with the differences between the used solution schemes described before. For this problem, SA requires approximately 10,000 simulations. 3
Table 2. Comparison of Identified Results for Different Algorithms (Units: m /day and $) Wells 1 2 3 4 5 6 7 8 9 10 Demand Total Pumping Cost ($) Number of Simulations
NLP [24]
GA [24]
GA [25]
SA [25]
SCE–UA [27]
HS [2]
5,600 4,550 5,860 0 0 0 7,000 0 0 7,000 30,010
6,000 5,000 7,000 0 0 0 6,000 0 0 6,000 30,000
6,000 4,000 6,000 0 0 0 7,000 0 0 7,000 30,000
6,000 4,000 6,000 0 0 0 7,000 0 0 7,000 30,000
5,886 4,833 5,894 0 0 0 6,694 0 0 6,693 30,000
6,147 4,620 6,146 0 0 0 6,543 0 0 6,544 30,000
106,990
107,134
106,992
106,992
106,896
106,891
N/A
896
~ 8,000
~ 10,000
N/A
7,494
5 Conclusions This chapter reviewed the application of the HS algorithm to the solution of groundwater management problems. In order to evaluate the application ability of
120
M.T. Ayvaz
the HS algorithm in finding the global optimum solution for groundwater management problems, the performance of HS is compared with various non-heuristic and heuristic optimization algorithms given in literature. The following results and outcomes can be drawn from this review: For the first example, HS finds approximately same results with the LP solution which is the global optimum solution of that problem. The comparison of HS and the other heuristic algorithms states that HS finds slightly better objective function values than GA, GASAPF, and SCE-UA. When compared the performance of HS with other solution algorithms in terms of the number of required simulations, it can be seen that HS requires less iteration than SA and the second GA model. However, it requires more simulations than the first GA solution since the first GA solution solves the problem by using a coarse pumping discretization scheme. For the second example, the identified results indicate that HS gives slightly better objective function values than NLP, GA, SA, SCE-UA. Also, the final identified pumping rates are in good agreement with the given water demand. In terms of the number simulations, HS solves the problem in less simulation than SA and the second GA models. Results of this review indicate that HS can be effectively used for solving the groundwater management problems.
References 1. Das, A., Datta, B.: Application of optimization techniques in groundwater quantity and quality management. Sadhana 26(4), 293–316 (2001) 2. Ayvaz, M.T.: Application of harmony search algorithm to the solution of groundwater management models. Advances in Water Resources 32(6), 916–924 (2009) 3. Ayvaz, M.T.: Groundwater parameter structure identification using harmony search algorithm. In: Geem, Z.W. (ed.) Music-Inspired Harmony Search Algorithm: Theory and Applications. Studies in Computational Intelligence Series. Springer, Heidelberg (2009) 4. Willis, R.L., Yeh, W.W.G.: Groundwater systems planning and management. PrenticeHall, Englewood Cliffs (1987) 5. Aral, M.M., Guan, J., Maslia, M.L.: Identification of contaminant source location and release history in aquifers. Journal of Hydrologic Engineering 6(3), 225–234 (2001) 6. Guan, J., Aral, M.M.: Optimal remediation with well locations and pumping rates selected as continuous decision variables. Journal of Hydrology 221, 20–42 (1999) 7. Deninger, R.A.: Systems analysis of water supply systems. Water Resources Bulletin 6, 573–579 (1970) 8. Aguado, E., Remson, I.: Groundwater hydraulics in aquifer management. Journal of Hydraulic Div–ASCE 100(HY1), 103–118 (1974) 9. Aguado, E., Remson, I., Pikul, M.F., Thomas, W.A.: Optimal pumping for aquifer dewatering. Journal of Hydraulic Div–ASCE 100(HY7), 860–877 (1974) 10. Willis, R.: A unified approach to regional groundwater management. In: Rosenshein, J.S., Bennett, G.D. (eds.) Groundwater hydraulics. Water Resources Monograph Series, Washington, DC (1983) 11. Willis, R.: Optimal groundwater quality management: Well injection of waste water. Water Resources Research 12, 47–53 (1976)
Solution of Groundwater Management Problems Using Harmony Search Algorithm
121
12. Aguado, E., Remson, I.: Groundwater management with fixed charges. Journal of Water Resources Planning and Management–ASCE 106(WR2), 375–382 (1980) 13. Misirli, F., Yazicigil, H.: Optimal ground–water pollution containment with fixed charges. Journal of Water Resources Planning and Management–ASCE 123, 2–12 (1997) 14. Gorelick, S.M., Voss, C.I., Gill, P.E., Murray, W., Saunders, M.A., Wright, M.H.: Aquifer reclamation design: The use of contaminant transport simulation combined with nonlinear programming. Water Resources Research 20, 415–427 (1984) 15. Finney, B.A., Samsuhadi, W.R.: Quasi three–dimensional optimization model of Jakarta Basin. Journal of Water Resources Planning and Management–ASCE 118(1), 18–31 (1992) 16. Murray, D., Yakowitz, S.: Constrained differential dynamic programming and its application to multireservoir control. Water Resources Research 15(4), 1017–1027 (1979) 17. Jones, L., Willis, R., Yeh, W.W.-.G.: Optimal control of nonlinear groundwater hydraulics using differential dynamic programming. Water Resources Research 23(11), 2097–2106 (1987) 18. Holland, J.H.: Adaptation in natural and artificial systems: an introductory analysis with applications to biology, control, and artificial intelligence. University of Michigan Press, Ann Arbor (1975) 19. Goldberg, D.E.: Genetic algorithms in search, optimization, and machine learning. Addison-Wesley Pub. Co., Reading (1989) 20. Glover, F.: Heuristic for integer programming using surrogate constraints. Decision Sciences 8(1), 156–166 (1977) 21. Kennedy, J., Eberhart, R.: Particle swarm optimization. In: Proc. of the IEEE Int. Conf. on Neural Networks, Piscataway, NJ, pp. 1942–1948 (1995) 22. Kirkpatrick, S., Gelatt, C., Vecchi, M.: Optimization by simulated annealing. Science 220(4598), 671–680 (1983) 23. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: Harmony search. Simulation 76(2), 60–68 (2001) 24. McKinney, D.C., Lin, M.-D.: Genetic algorithm solution of groundwater management models. Water Resources Research 30(6), 1897–1906 (1994) 25. Wang, M., Zheng, C.: Ground water management optimization using genetic algorithms and simulated annealing: Formulation and comparison. Journal of the American Water Resources Association 34(3), 519–530 (1998) 26. Wu, J., Zhu, X., Liu, J.: Using genetic algorithm based simulated annealing penalty function to solve groundwater management model. Science in China Series E: Technological Sciences 42(5), 521–529 (1999) 27. Wu, J., Zhu, X.: Using the shuffled complex evolution global optimization method to solve groundwater management models. In: Zhou, X., Li, J., Shen, H.T., Kitsuregawa, M., Zhang, Y. (eds.) APWeb 2006. LNCS, vol. 3841, pp. 986–995. Springer, Heidelberg (2006) 28. Wikipedia: Harmony Search (2007), http://en.wikipedia.org/wiki/Harmony_search (accessed 29 October 2008) 29. Jon Anderson’s Web Site (2008), http://dreams-in-color.com/sketch.html (accessed 29 October 2008)
122
M.T. Ayvaz
30. Geem, Z.W., Choi, J.Y.: Music Composition Using Harmony Search Algorithm. In: Giacobini, M., et al. (eds.) EvoWorkshops 2007. LNCS, vol. 4448, pp. 593–600. Springer, Heidelberg (2007) 31. Geem, Z.W.: Harmony Search Algorithm for Solving Sudoku. In: Carbonell, J.G., Siekmann, J. (eds.) Knowledge-Based Intelligent Information and Engineering Systems. Springer, Heidelberg (2008) 32. Saka, M.P.: Optimum design of steel sway frames to BS5950 using harmony search algorithm. Journal of Constructional Steel Research 65(1), 36–43 (2008) 33. Geem, Z.W.: Optimal cost design of water distribution networks using harmony search. Engineering Optimization 38(3), 259–277 (2006) 34. Tangpattanakul, P., Artrit, P.: Minimum-time trajectory of robot manipulator using Harmony Search algorithm. In: 6th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTICON), May 6-9, pp. 354–357 (2009) 35. Ayvaz, M.T.: Simultaneous determination of aquifer parameters and zone structures with fuzzy c-means clustering and meta-heuristic harmony search algorithm. Advances in Water Resources 30, 2326–2338 (2007) 36. Cheng, Y.M., Li, L., Lansivaara, T., Chi, S.C., Sun, Y.J.: An improved harmony search minimization algorithm using different slip surface generation methods for slope stability analysis. Engineering Optimization 40(2), 95–115 (2008) 37. Vasebi, A., Fesanghary, M., Bathaee, S.M.T.: Combined heat and power economic dispatch by harmony search algorithm. International Journal of Electrical Power & Energy Systems 29(10), 713–719 (2007) 38. Ceylan, H., Ceylan, H., Haldenbilen, S., Baskan, O.: Transport energy modeling with meta-heuristic harmony search algorithm, an application to Turkey. Energy Policy 36(7), 2527–2535 (2008) 39. Panchal, A.: Harmony Search in Therapeutic Medical Physics. In: Geem, Z.W. (ed.) Music-Inspired Harmony Search Algorithm: Theory and Applications. Studies in Computational Intelligence Series. Springer, Heidelberg (2009) 40. Harmony Search Algorithm Web Site (2009), http://www.harmonysearch.info/ (accessed 12 October 2009) 41. Bear, J.: Dynamics of fluids in porous media. Elsevier, New York (1972)
Application of the Harmony Search Optimization in Irrigation Milan Cisty
*
Abstract. In its first part this chapter briefly reviews applications of the Harmony Search (HS) optimization method in the irrigation industry. As will be seen, HS can be applied in similar problem areas as other heuristics. Therefore, other heuristic method applications in the irrigation industry are mentioned in this part of the chapter to encourage the use of HS instead, because of its already-reported effectiveness while handling various problems. The remainder of the chapter deals with one possible application of HS – the calibration of a simulation model of the hydraulic part of an irrigation system. This calibrated simulation model can be used in the design, reconstruction, enlargement or maintenance of pressurized irrigation systems. The calibration of the water distribution model consists of a comparison of predicted pressures and flows with those observed under known operating conditions (i.e., pump operation, tank levels, pressure-reducing valve settings), and an adjustment of the input data for the model to improve the agreement between the observed and predicted values. In practice, given a set or sets of measured state variables, engineers apply trial and error techniques, using their judgment to vary the parameters and accomplish this task. Trial and error techniques are tedious and do not always guarantee reasonable results. This chapter introduces a methodology for determining calibrated parameters automatically through the exploitation of the HS optimization method.
1 Introduction This chapter demonstrates a potential application of the Harmony Search (HS) algorithm in the irrigation industry. It will mainly focus on the applications intended for the design or management of the sprinkler irrigation method, although applications of HS when using some other types of irrigation methods (drip, furrow, borderstrip or basin irrigation) are also possible. Sprinkler irrigation is a method of applying irrigation water which is similar to a natural rainfall. Water is usually distributed through a system of pipes by pumping. It is then sprayed into the air through sprinklers so that it breaks up into small Milan Cisty Department of Land and Water Resources Management, Faculty of Civil Engineering, Slovak University of Technology, Bratislava, Slovak Republic E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 123–134. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
124
M. Cisty
water drops, which fall to the ground. The pump supply system, sprinklers and operating conditions must be designed to enable the uniform application of water. A typical sprinkler irrigation system consists of the following components (not all of these must always be included): • • • • •
Source of the water (reservoir, river, well, waste water) Conduit to irrigation area (for instance, a canal or pipe system) Pump unit Pipe network (mainline and submainlines) Sprinklers or various types of irrigators (center pivot sprinkler system, linear move system, traveling big gun system, portable hand-move lateral pipe system, solid-set irrigation system, etc.)
Agriculture and irrigation have affected the rise and fall of many great civilizations. Although agriculture is so necessary for human life, work in this sector is not a very effective way to achieve economic benefits in many countries of today’s world. This is paradoxical when we bear in mind that the world’s population has grown from 2.5 billion in 1950 to 6.5 billion today. In some countries the importation of agricultural products from other parts of the world constitutes significant competition for domestic agricultural production, so it is absolutely essential to ensure a nation’s agriculture and irrigation are as economically efficient as possible; otherwise these sectors will not survive in a market economy. Moreover, other pressures bear on irrigation and agriculture; one of the most important is that this sector has the potential to be a significant cause of environment degradation. Various constraints must be accepted by an irrigation manager from this significant point of view; some of them contrast with the immediate benefits from agricultural production. As a result of the above-mentioned and various other reasons, seeking optimal design strategies and management techniques in the irrigation sector is always an important task. Among the various technological, biological, chemical and/or organizational practices applied to keep irrigation and agriculture efficient and sustainable, the support of mathematical and informatics techniques also has its place. Various optimization techniques have been used in the design and management of irrigation projects. Additionally, modern heuristic methods with their ability to deal with complicated real life problems are often used for various aspects of the design and management of irrigation projects. The potential for the application of HS and other optimization methods in the irrigation industry will be briefly indicated in this chapter (because this is a very broad subject, what follows is not a complex review; some examples are mentioned, and one application is described in more detail). Because HS can be applied to similar problems as can other heuristic methods, the first part mentions applications in the irrigation industry without distinguishing what type of heuristic or optimization method was used.
2 Application of Optimization Methods in Irrigation Almost all parts of an irrigation system can be subjected to optimization from various points of view – either in design stage or while managing them. Possible
Application of the Harmony Search Optimization in Irrigation
125
applications will follow in a similar order as in the list of the main parts of the irrigation system mentioned hereinbefore. The optimal utilization of an irrigation water supply (e.g., a reservoir) requires knowledge of the reservoir regulation process as well as knowledge of the in-field process at the point of actual water use. Integrating this knowledge in order to facilitate informed decisions on the operation of a reservoir generally requires the use of a mathematical model. The reservoir inflow, the amount of rainfall on an irrigated area, crop water requirements assessed from potential evapotranspiration, and the cropping pattern are the critical inputs for such a model. The objective is usually to maximize the sum of the relative yields from all the crops in the irrigated area. Heuristic methods, e.g., genetic algorithms (GA), were applied to this task [1] with the aim of obtaining a model to provide an optimal operating policy and optimal crop water allocations from an irrigation reservoir. The HS model’s application to a benchmark system with four dams has been referenced as well [2]. The results showed that the HS model found five different global optimal solutions with identical maximum benefits from hydropower generation and irrigation, while the enhanced GA model (real-value coding, tournament selection, uniform crossover, and modified uniform mutation) only found near-optimal solutions under the same number of function evaluations. Canals are among the most significant elements of an irrigation system. The economy of many countries depends on the extent of their canal networks. Thus, an optimization method, which was used for an optimal water distribution schedule in irrigation canals, has been developed. Through consideration of several objectives of irrigation systems, a multi-objective simulated annealing optimization technique was utilized for the problem. Based on the water requirements at the delivery points, the model developed determines the time and rate of water delivery. The canal’s capacity and operational stages are minimized, and the water requirements are satisfied as closely as possible. The construction of canals is an expensive undertaking; therefore, the economic design of canal sections is an important concern of civil engineers. A cost-effective channel section for a specified flow rate, roughness coefficients, the longitudinal slope, and various cost parameters can be determined using various optimization techniques. It is also necessary to incorporate criteria for side slope stability while designing an optimal open channel section [3]. HS methodology has been applied to the problem of slope stability with success as well [4]. The HS optimization model for a pump as part of a water network is referred in the literature [5] to obtain better results in terms of average design cost, number of function evaluations, and hydraulic simulation conditions as compared to those of other evolutionary algorithms. The energy required for operating pumping stations in an irrigation district may be significant. The cost of establishing a new pumping station and the ever-increasing cost of energy have caused researchers to pay more attention to the optimal design and operation of pumping stations. Energy costs constitute the largest expenditure for nearly all water utilities worldwide and can consume up to 65% of a water utility's annual operating budget [6]. One of the greatest potential areas for energy cost savings in irrigation systems is in the scheduling of pump operations. The optimal design and operation of an irrigation
126
M. Cisty
pumping station is proposed in [7] using the heuristic approach. The computation is driven by an objective function that includes the operating and capital costs subject to various performance and hydraulic constraints. Various computer models have been developed for optimizing an irrigation pipe network, e.g., a model called GENOME (Genetic Algorithm Pipe Network Optimization Model), with the aim of optimizing the design of new looped irrigation water distribution networks [8]. The model is based on a GA method. The HS methodology was also used for solving this problem, with its effectiveness outperforming various other heuristic methods [9]. The HS model was applied to five water distribution networks and obtained designs that were either the same or cost 0.28-10.26% less than those of competitive meta-heuristic algorithms such as the genetic algorithm, simulated annealing and tabu search under similar or less favorable conditions. For pressurized systems, there are three different ways of scheduling irrigators: on-demand, restricted on-demand, and rotation. Wardlaw and Bhaktikul [10] described a heuristic model to solve an irrigation water scheduling problem. The objective was to optimize the utilization of water resources in irrigation systems operating on a rotational basis. An objective function for water scheduling problem is presented along with constraints that relate to in-field soil moisture balances as well as canal capacities. In Farmani and Savic’s study [11], the optimum design and management of pressurized irrigation systems are considered to be based on rotation and on-demand delivery scheduling using a genetic algorithm. Irrigation systems based on on-demand delivery scheduling offer flexibility to farmers and greater potential profits than other types of irrigation schedules. A comparison between on-demand and rotation delivery scheduling shows that a greater than 50% savings can be achieved in the total cost at the cost of reducing flexibility in the irrigation time.
3 Simulation Model and Its Calibration From this subheading till the end of the chapter, the calibration of the simulation models will be described in more detail as an example of the application of the HS method in the irrigation industry. Simulation models are used in the design of new irrigation systems, the reconstruction or modernization of an existing system or the maintenance of different tasks while managing currently existing irrigation systems. They answer what happens if pumps are replaced with new ones, when the type, number or placement of the irrigators is changed or if the pipes are replaced with pipes of different diameters, etc., in terms of the water distribution system’s resulting behavior (for example, if pressures on the hydrants will be satisfactory). Several simulation models have been developed for analyzing hydraulic networks of irrigation and drinking water systems. Among those models, the three most commonly used for irrigation networks are: EPANET [12], COPAM [13], and GESTAR [14]. EPANET was used for this paper because it is a reliable model that has been applied worldwide for various types of water distribution networks.
Application of the Harmony Search Optimization in Irrigation
127
An EPANET simulation model that analyzes hydraulics in water distribution systems was used in this work. Like the other network models mentioned, EPANET abstracts an actual distribution system into a network of links connected together at their endpoints called nodes. The links can represent pipes, pumps, or control valves. The nodes can be junctions, reservoirs, or tanks. The junctions can also contain emitters (or sprinklers), which make the outflow rate dependent on the pressure. This feature is especially useful for modeling irrigators, and its usage is a better choice than inputting demands as absolute values. Based on the information contained in the input file, EPANET can compute flows, pressures and other parameters throughout a network. EPANET exists in two basic forms - as a desktop application with a graphical user interface and as an EPANET Toolkit. The EPANET Programmer's Toolkit is a dynamic link library (DLL) of functions that allows software developers to customize or call EPANET’s computational engine according to their own needs. The toolkit is useful for developing specialized applications that require running many network analyses, which is the case when calibrating a simulation model. The EPANET Toolkit and hereinafter-described harmony search algorithm principles were used for developing software for calibration purposes of the hydraulic model of an irrigation network. When a simulation model is to be applied, one should be certain that the results from the model bear a close resemblance to the actual performance of the hydraulic system. However, various factors always result in differences between the reality and the results, including errors and presuppositions of the simulation model’s design period, human and tool errors, false simplifying in the model’s design, errors in determining the boundary conditions, etc. So, in order to be sure of the correct model function for different operating conditions, the model’s calibration is necessary. Ormsbee and Lingireddy [15] state that, in general, calibrating a network model should encompass seven basic steps: 1. 2. 3. 4. 5. 6. 7.
Identifying the intended use of the model. Determining the initial estimates of the model’s parameters. Collecting the calibration data. Evaluating the model’s results. Performing a macro-level calibration. Performing a sensitivity analysis. Performing a micro-level calibration.
Deviations in the results of the model’s application from field observations (usually pressures and flows are measured in a system) may be caused by several factors, including: • Erroneous model parameters (pipe roughness values and nodal demand distribution). • Erroneous network data (pipe diameters, lengths, etc.). • Incorrect network geometry (pipes connected to the wrong nodes). • Incorrect boundary definitions of pressure zones.
128
M. Cisty
• Errors in boundary conditions (incorrect pressure-regulating valve settings, tank water levels, pump curves, etc.). • Errors in historical operating records (i.e., pumps starting and stopping at the wrong times). • Measurement equipment errors (i.e., pressure gauges not properly calibrated). • Measurement error (i.e., reading the wrong values from measurement instruments). If the state variable measured values are significantly different from the modeled values, the reason for the difference is probably in the input data. The only way to adequately address such macro-level errors is to systematically review the data associated with the model and compare them with the real - field data. This is macro-level calibration.
4 Micro-level Calibration by HS Optimization Although there are many parameters that are uncertain and affect the values of the pressures in the junctions or flow rate of the pipes, the calibration process at its micro-level mainly involves the determination of the pipeline’s roughness coefficients after several years of the system’s operation. Traditional calibration of a water distribution model is based on a trial-and-error procedure, by which the modeler first estimates the values of the model’s parameters, then runs the model to obtain the pressures and flows predicted, and finally compares the simulated values with the observed data. If the predicted data do not compare closely with the observed data, the engineer returns to the model, makes some adjustments to the model’s parameters, and runs it again to produce a new set of simulation results. This may have to be repeated many times to make sure that the model produces a close-enough prediction of the water distribution network in the real world. The traditional calibration technique is, among other things, quite time consuming. In addition, a typical network representation of a water network may include hundreds or thousands of links and nodes which the modeler should deal with. This chapter introduces a methodology for determining calibration parameters automatically. The harmony search [16] algorithm was adopted from the musical process of finding “pleasant harmonies” through improvisation. For instance, when several notes from different musical instruments are played simultaneously on a random basis and this process is repeated, there is the possibility of finding better harmonies. In the HS methodology, these better harmonies are saved in a certain size of memory by replacing the worst harmony in the memory until the predefined maximum number of improvisations generating a new harmony is reached. The five fundamental steps of HS could be summarized as follows: Step 1: Design variable and initialization of algorithm parameters; Step 2: Harmony memory initialization; Step 3: Generation of a new harmony; Step 4: Harmony memory update if needed; and Step 5: Improvisation stopping criterion check.
Application of the Harmony Search Optimization in Irrigation
129
Step 1: Design variable and initialization of algorithm parameters The optimization is expressed as follows:
min f (x)
(1)
x
Subject to xi ∈ Xi,j ; i =1,2,...,N ; j =1,2,...,K
(2)
where f (x) is an objective function; x is the vector of the variables calibrated (mainly the roughness coefficients of the pipes), Xi is the set of the possible values of each variable, which is bounded by a predefined range; N is the total number of searching variables; K is the number of possible values for the variables (for instance, we can design 10 possible roughness coefficients for a particular pipe or emitter coefficients for a particular irrigator working in a field during the measurements). The model of the irrigation network with the lengths and connections of the pipes and other necessary data is read by the HS optimization calibration model in the form of an EPANET INP file [12]. The four HS algorithm parameters that need to be initialized are the harmony memory size (HMS), the harmony memory consideration rate (HMCR), the pitch adjustment rate (PAR), and the maximum number of improvisations (NI). Step 2: Harmony memory initialization The harmony memory is a memory location (matrix), where the solution vectors (sets of roughness coefficients or other calibrated parameters) and corresponding objective function values are stored. The initial HS memory consists of HMS different randomly generated solution vectors. Each such solution vector contains randomly generated pipe roughness values or other calibrated parameters of the EPANET model (taken from a predefined range of the possible values). All the harmonies found are stored in the harmony memory, which has the form of (HMS) × (N+1) matrix. Columns one through N store the searched variable’s values, and the last column contains the objective function values. In the case of the calibration of the simulation model, various objective functions can be used. The following equation was chosen for this work: N
min
Pcalcn
∑ (1 − Pobs n =1
NP
n
N
)2 +k×
Qcalcn
∑ (1 − Qobs n =1
NQ
n
)2 (3)
Where Pobsn is the measured pressure n within the system [Mpa], Pcalcn is the pressure calculated with EPANET [Mpa], Qobsn is the measured flow after the pump station [l/s], Qcalcn is the flow calculated by EPANET after the pump station [l/s], k is the weight coefficient that stresses the importance of the requirement to comply with the measured flows after the pump station or other strategic points, Np is the number of junctions with observed pressure and Nq is the number of links with an observed flow.
130
M. Cisty
Step 3: Generation of a new harmony The evolution of new solutions is accomplished in this step. The improvisation or generation of a new harmony (generation of a new, hopefully better, combination of roughness coefficients or other calibrated parameters) is performed based on three rules: 1) memory consideration, 2) pitch adjustment, and 3) random selection. These general HS algorithm principles can be found in [16] or in other chapters of this book. Step 4: Harmony memory update In this step the EPANET model is run with data taken from the new harmony. By comparing the results of the computation with the values observed (Eq. 3), one gets the value of the objective function. If the new objective function value is lesser than the worst objective function value in the harmony memory, the worst harmony vector is replaced by the new harmony vector. A lesser objective function value means that in the case of the new harmony, smaller differences are between the modeled and observed pressures or flows by using the parameters coded in a new harmony. Step 5: Stopping Criterion A conditional statement is applied to judge whether this harmony search loop needs to be repeated or stopped. In the case of a calibration problem the harmony search stops if there is no improvement in comparing the observed and modeled values by an objective function (Eq. 3) on the last five hundred iterations.
5 Results and Discussion The procedure described for calibrating an irrigation system was applied to the Kuty irrigation system (southwest Slovakia). Its layout is shown in Figure 1. This is one of the relatively old irrigation facilities with a large area in Slovakia. The irrigation system consists of the irrigation pump station, a pressurized network for delivering the irrigation water and sprinklers. The layout of the irrigation network is branched and consists of approximately 25 km of pipes (steel, cast iron and some new PVC pipes). Its construction was completed in the mid-1960s; thus, the whole facility is coming close to the end of its service life. For this reason it can serve as a suitable model for testing the proposed methods of calibrating the simulation model. The parameters such as the roughness coefficients, pump operation characteristics, etc., were changed, and their values should therefore be searched for. The simulation model could be used for a rehabilitation design or for finding the best operational rules under various conditions (new crops, new irrigators introduced into the system, etc.). The process of micro-calibration in this case included finding the emitter coefficients of the irrigators (see EPANET manual), fine-tuning the roughness of the pipes and altering the pump’s operating characteristics. Considering the scale of the input and output data, the results of the calculation are only generally described; detailed information can be provided by the author of this chapter.
Application of the Harmony Search Optimization in Irrigation
131
4
Navrho
• L P
YN
•
OD OV
D PL YN O VO
• •
ÈS
5
6
Kúty KUTY KÚTY
•
"A"
12
"A"
• "B"
Pressure measurement
"A4"
"A3"
"A"
Pump
•
VE TVA JÚC A T VU JE S
VE TVA JÚC A T VU JE S
"A2"
a Ďi alnic
"A1"
•
Ar eá l ŠM
2
1
PL YN OVO
D
3
ovod ný vod va
vz v . ve z. den vede ie nie
•
V OD . Z DR OJ
"A6"
7
"A7"
"B1"
11
•
10
"B4"
"B3"
•
"B5" "B" "B" "B9"
•
8
"B8"
"B7"
•
"B6"
9
Fig. 1 Layout of an irrigation system for which the simulation model calibration was verified
The experience of irrigation users as well as the measurements taken at the Kuty irrigation system demonstrated that during the operation of the irrigation system, insufficient pressure in the hydrants has occurred quite often. This has partially been caused by an improper network layout. Additionally, another problem often occurs during the operation of the irrigation system. The incorrect working scheme of the irrigators (e.g., the high concentration of sprinklers in some parts of the irrigation system), also results in insufficient pressures. Since such events have taken place within the described system, the operator should be instructed and given recommendations to reorganize the usage of the irrigation system. The simulation model is a suitable tool for solving these types of tasks. A good solution for low pressures is, for instance, the creation of a loop in some parts of the pipeline network, e.g., making a loop of the A3 and A4 branches or in other parts of the system. Such a solution is optimal from an economic viewpoint as well as in terms of achieving the technical parameters required (pressures). It also simplifies work during the operation and also seems to be favorable in the event of failure (in cases of malfunctions in the pipe system, it provides an alternative way to transport water to the hydrants). Such reconstruction cannot be appropriately accomplished without the creation, calibration and application of a simulation model.
132
M. Cisty
The hydraulic condition was analyzed using measurements performed both at the pump station and in the irrigation pipeline network. In order to analyze the hydraulic behavior of the system for this purpose, more detailed measurements as well as a calibrated simulation model were needed. In the first step, a preliminary hydraulic model was developed. In the preliminary model some simplifications were made, for instance, the irrigators were modeled with a constant demand, not in a pressure-dependent regime. The measurements and this tool enable the identification of various defects, operating malfunctions, etc., the repair of which is inexpensive (e.g., a partially closed network valve was detected in the A3 branch, which was marked by a significantly large difference between the measured and computed pressures on it). The elimination of such problems was the first step and, at the same time, the first profit generated by the calibration effort. If some repairs are not possible, they should also be modeled as any other hydraulic phenomenon in the system. This was completed in the so-called macro-calibration part of the process, which has previously been described. The calibration work in the Kuty irrigation system included the measurement of pressures in the outlet from a pump station, the flow right behind the pump station and the measurement of pressures at typical points of the irrigation system (Figure 1). The placement of the irrigators, their types and other parameters (sprinkler nozzle’s diameter) were also checked. Based on the specifications declared by the manufacturer, it was important to define the sprinkler’s characteristic curve. Because this entry depended on the technical condition of the equipment, the parameters of the sprinkler pressure-flow characteristic curve were also calculated in the context of the calibration computations (as emitter coefficients in EPANET). The calculations result in the system calibrated for the testing operation conditions (another set of observed pressures and flows than that used in the calibration process) revealed disparities in the pressures up to 4.8% and in the flows up to 4.9% (Figure 2). The results obtained represent a good degree of conformity. A larger disparity between the observed and simulated flows was caused, e.g., by oscillation of this entry due to the instability of the flow. As mentioned above,
Fig. 2 Calculation results in the system calibrated for the testing operation conditions
Application of the Harmony Search Optimization in Irrigation
133
the accuracy of the calibration depends not only on the setup of the roughness coefficients but also on other parameters, which can generate various errors. More accurate results can be achieved using additional specifications. For instance, the section lengths were determined from maps on a scale of 1:2000 (no numeric data were available). A more accurate section length could be determined either from longitudinal profiles or by taking direct measurements in the field. The outcome confirms the suitability of the method even in cases with insufficient data available, which is often the case in practice.
6 Summary and Conclusions This chapter provides examples of various applications of the optimization methods used in the irrigation industry. It is focused mainly on applications for the sprinkler irrigation method. In the first part some HS applications together with other heuristic methods are mentioned for the design or maintenance of an irrigation water supply, canals, pump stations, pipe networks and irrigators. The HS methodology could be used almost anywhere where another heuristic method application has been referenced and in many cases with a better degree of effectiveness. The main part of the chapter deals with the use of simulation models in the design and maintenance of pressurized irrigation systems. In order to use simulation models, e.g., as a tool for the design of the reconstruction of these systems, one has to perform their calibration. Traditionally, the calibration of hydraulic network models has been a manual task with the modeler making changes to the parameter values on a trial-and-error basis to achieve an effect which he considers will result in an overall convergence between the field and model data. In this chapter the methodology for the determination of calibration parameters automatically is described. The methodology proposed is based on optimizing procedures using the harmony search optimization.
Acknowledgments This work was supported by the Scientific Grant Agency of the Ministry of Education of the Slovak Republic and the Slovak Academy of Sciences, Grant No. 1/0585/08 and by the Slovak Research and Development Agency, Grants Nos. APVV-0271-07 and LPP-0319-09.
References 1. Kumar, D.N., Raju, K.S., Ashok, B.: Optimal reservoir operation for irrigation of multiple crops using genetic algorithms. Journal of Irrigation and Drainage Engineering 132, 123–129 (2006) 2. Geem, Z.W.: Optimal scheduling of multiple dam system using harmony search algorithm. In: Sandoval, F., Prieto, A.G., Cabestany, J., Graña, M. (eds.) IWANN 2007. LNCS, vol. 4507, pp. 316–323. Springer, Heidelberg (2007)
134
M. Cisty
3. Bhattacharjya, R.B., Satish, M.G.: Optimal design of a stable trapezoidal channel section using hybrid optimization techniques. Journal of Irrigation and Drainage Engineering 133, 323–329 (2007) 4. Cheng, Y.M., Li, L., Lansivaara, T., et al.: An improved harmony search minimization algorithm using different slip surface generation methods for slope stability analysis. Engineering Optimization 40, 95–115 (2008) 5. Geem, Z.W.: Harmony search optimisation to the pump-included water distribution network design. Civil Engineering and Environmental Systems 26, 211–221 (2009) 6. Moradi-Jalal, M., Rodin, S.I., Marino, M.A.: Use of genetic algorithm in optimization of irrigation pumping stations. Journal of Irrigation and Drainage Engineering 130, 357–365 (2004) 7. Moradi-Jalal, M., Karney, B.W.: Optimal design and operation of irrigation pumping stations using mathematical programming and genetic algorithm. Journal of Hydraulic Research 46, 237–246 (2008) 8. Reca, J., Martinez, J.: Genetic algorithms for the design of looped irrigation water distribution networks. Water Resources Research (2006), doi:10.1029/2005WR004383 9. Geem, Z.W.: Optimal cost design of water distribution networks using harmony search. Engineering Optimization 38, 259–280 (2006) 10. Wardlaw, R., Bhaktikul, K.: Application of genetic algorithms for irrigation water scheduling. Irrigation and Drainage 53, 397–414 (2004) 11. Farmani, R., Abadia, R., Savic, D.: Optimum design and management of pressurized branched irrigation networks. Journal of Irrigation and Drainage Engineering 133, 528–537 (2007) 12. Rossman, L.A.: EPANET2 users manual. US Environmental Protection Agency, Cincinnati (2000) 13. Lamaddalena, N., Sagardoy, J.A.: Performance analysis of on-demand pressurized irrigation systems. FAO Irrigation and Drainage Paper No. 59, Rome (2000) 14. Aliod, R., Eizaguerri, A., Estrada, C., Perna, E.: Dimensionado y análisis hidráulico de redes de distribución a presión en riego a la demanda: Aplicación del programa GESTAR. Riegos y Drenajes XXI 92, 22–38 (1997) 15. Ormsbee, L.E., Lingireddy, S.: Calibrating hydraulic network models. AWWA 89, 42– 50 (1997) 16. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A New Heuristic Optimization Algorithm: Harmony Search. Simulation 76, 60–68 (2001)
The Application of Harmony Search in Fourth-Party Logistics Routing Problems Guihua Bo , Min Huang , W.H. Ip , and Xingwei Wang 12
12
3
12
Abstract. A recently-developed meta-heuristic optimization method, called the Harmony Search (HS) has gained more and more attentions for the ability to solve large-scale, difficult combinational optimization problems. And, recently, fourthparty logistics (4PL) also has been receiving more and more attentions from the manufacturing and retail industries. In this chapter, we set up the mathematical model of fourth-party logistics routing optimization with time windows (4PLRPTW) based on a multi-graph, firstly, then reviews the application of HS in areas of 4PLRPTW. Three specific cases are considered: seven nodes, fifteen nodes, and thirty nodes problems. According to the character of 4PLRPTW, we also design the repair strategy. The performance of the HS is compared with the designed enumeration algorithm in this chapter. The results of the numerical experiments show that the HS is effective in terms of solution quality and computational time.
1 Introduction This chapter mainly presents three different nodes problems in fourth-party logistics routing optimization with time windows (4PLRPTW), which includes seven nodes, fifteen nodes, and thirty nodes problems. Research on fourth-party logistics routing problem (4PLRP) is in the beginning stage. There are few papers published about it. Chen et al [1] designed a genetic Guihua Bo, Min Huang, and Xingwei Wang Faculty of Information Science and Engineering, Northeastern University, Shenyang, Liaoning, 110004, China E-mail:
[email protected], {mhuang,wangxw}@mail.neu.edu.cn Guihua Bo, Min Huang, and Xingwei Wang Key Laboratory of Integrated Automation of Process Industry (Northeastern University), Ministry of Education, Shenyang, Liaoning, 110004, China W.H. Ip Department of Industrial and Systems Engineering, The Hong Kong Polytechnic University, Hung Hom, Kowloon, Hong Kong SAR, China E-mail:
[email protected] Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 135–145. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
136
G. Bo et al.
algorithm to solve 4PLRP with ten nodes. This paper introduced genetic algorithms to solve 4PLRP. However, the author only introduced the concept of 4PL in a simple way, did not depict the problem with a standardized model and did not consider the property of nodes along the route. With respect to algorithm design the largescale problem was not taken into account during the process. Huang et al. [2] set up a mathematical model based on nonlinear integer programming and multi-graphs and proposed an immune algorithm, with an embedded Dijkstra algorithm, to solve 4PL problems with seven nodes, fifteen nodes and thirty nodes. Huang et al. [3] suggested a hybrid immune algorithm to solve 4PL problems. These two papers have considered all the problems which were not considered in [1], but they did not consider the time window constraint. The time window constraint has wide applicability in real-world cases, such as large-scale vehicle routing problems [4]. The time window is pre-set time constraint on the period of the day in which delivery should take place. For maximizing the satisfaction degree of customer we deal with 4PLRPTW in this chapter. In the 4PLRPTW, the objective is to find a minimum-cost route which starts from the supply node, services a demand node which must be serviced within a specified time window. Since 4PLRP is an NP-hard [5] problem, the optimal solution can not be obtained using exact methods in reasonable computation time, especially when the problem scale is larger. But, heuristic methods often produce near optimal solutions in a reasonable amount of computation time. So we suggest a phenomenon-inspired HS algorithm developed by Geem et al. [6] be applied to it to solve 4PLRPTW, and designed the repair tactic.
2 Fourth-Party Logistics Routing Problems The concept of Fourth-party Logistics (4PL) was originally introduced by Accenture, a famous management consulting company, who registered it as a proprietary trademark in 1998. A 4PL provider is a supply chain integrator that assembles and manages the resources, capacities and technology of its own organization together with those of complementary service providers, to deliver a comprehensive supply chain solution [7]. The way in which the route is selected is one of the most important problems in 4PL because it can save the transportation cost. This is different from the way the route is selected in third party logistics (3PL). The selection of 3PL providers should also be considered in the 4PLRP with regard to not only costs but also time, capacity and the reputation properties of 3PL providers. However, the selection of a route and 3PL providers is not a step by step procedure, but a concurrent one as these parameters need to be considered at the same time, which increases the difficulty of solving routing problems in 4PL. The main problem in 4PLRPTW is how to make decisions on the routing and 3PL providers so as to minimize the logistics costs, maximize the satisfaction degree of customers and 3PL providers’ benefits, and meeting the time windows prespecified by customers.
The Application of Harmony Search in Fourth-Party Logistics Routing Problems
137
2.1 Problem Formulation for Fourth-Party Logistics Routing Problems The objective is to find a route Rt with minimum-cost (i.e., the sum of costs on all nodes and edges in the route Rt) as well as subject to constraints on customers’ preferred time windows, 3PL companies’ reputation target, and capacity requirement. We can use a graph to describe 4PLRPTW with a supply node vs and a demand node vt. Nodes in the graph represent depots, material warehouses, manufacturing plants, semi-product storehouses, assembly plants, sales locations, etc. Each node has the properties of cost, time and capacity. The demand node vt has a time window constraint. Since there may exist several 3PL companies which can handle the transportation between any two nodes, there may be multiple edges between two nodes (one edge stands for a 3PL company), and each edge has the properties of cost, time, capacity and reputation. Figure 1 is a multi-graph for a 4PLRPTW with seven nodes, Figure 2 is fifteen nodes, and Figure 3 is thirty nodes problems. The model of 4PLRPTW is set up as follows: n
i =1
s.t
n
rij
∑∑∑
min
a≤
n
j =1 k =1
n
C ijk x ijk (R t ) +
rij
∑∑∑T i =1 j =1 k = 1
n
∑
j =1
C
' j
y
j
(R t )
(1)
n
ijk
' x ijk ( Rt ) + ∑ T j y j ( Rt ) ≤ l
(2)
j =1
L x ijk ( Rt ) ≤ P ijk i = 1" n; j = 1" n; k = 1" r ij
(3)
L′ y j ( Rt ) ≤ Pj' j = 1" n
(4)
R x ijk ( Rt ) ≤ D ijk i = 1" n ; j = 1" n ; k = 1" r ij
(5)
Rt = ( vs ," , vi , k , v j ," , vk ) ∈ G, i = 1" n; j = 1" n
(6)
The specific definition of variables and parameters can refer to [8]. Equation (1) is the objective function including the cost of all the nodes and edges; (2) represents the constraint of the sum of all the time needed in a route (both nodes and edges), which must be within the time window pre-specified by the customer; (3) represents the capacity constraint of the selected logistics company which is not less than the transportation capacity L required by the customer; (4) denotes the capacity constraint of nodes along a route which is not less than the capacity L' required by the customer; (5) denotes reputation constraint of selected logistics company which is not less than customer required R ; (6) is used to ensure that the selected route is a legal one.
138
G. Bo et al.
2.2 Seven Nodes Example We solve seven nodes network firstly which has one start node, five middle nodes, and one end node, as shown in Figure 1. The number of total candidate designs is 6.22 × 106 , which is product of the number of all the values for each decision variable. Table 1 shows the computational results of HS algorithm and enumeration algorithm. Results show that HS algorithm can get the same optimal solution as enumeration algorithm of the problem with seven nodes and only take 0.6 seconds, which is faster than the enumeration algorithm. 1
v1 1
1
2
2
3
vs
2
1
1
2
2
3
3
1
v3 1
2
1 2
1
3
v4
2
2
3
1
2
3 1
1
4
v2
3
2
vt 2
v5 4
Fig. 1 Multi-graph of seven nodes network Table 1 Results of Seven Nodes Network Algorithms
Minimal Cost
Time (seconds)
Harmony Search
73
0.6
Enumeration Algorithm
73
3
2.3 Fifteen Nodes Example Now, we solve fifteen nodes network which has one start node, thirteen middle nodes, and one end node, as shown in Figure 2. The number of total candidate designs is 3.12 × 1019 , which is product of the number of all the values for each decision variable. Table 2 shows the computational results of HS algorithm and enumeration algorithm. From the results we can see that HS algorithm can get the optimal solution in 1.5 seconds, but the enumeration algorithm can not find the solution even after 8640000 seconds.
The Application of Harmony Search in Fourth-Party Logistics Routing Problems 4
139
11 8
1 5
2
s
9
t
12 6
10 13
7
3
Fig. 2 Multi-graph of fifteen nodes network Table 2 Results of Fifteen Nodes Network Algorithms
Minimal Cost
Time (seconds)
Harmony Search
115
1.5
Enumeration Algorithm
\
>8640000
2.4 Thirty Nodes Example Finally, we solve thirty nodes network which has one start node, twenty-eight middle nodes, and one end node, as shown in Figure 3. The number of total candidate designs is 5.06 × 1040 , which is product of the number of all the values for each decision variable. 6
13
20
10
24
17
3
14 1 7
s
27
21
4
18
25
t
11 8
15 2
22
28
12
19 5
9
26
16 23
Fig. 3 Multi-graph of thirty nodes network
140
G. Bo et al.
Table 3 shows the computational results of HS algorithm and enumeration algorithm. From the results we can know that HS algorithm can get the optimal solution in 23 seconds, but the enumeration algorithm can not find the solution even after 12960000 seconds. Table 3 Results of Thirty Nodes Network Algorithms
Minimal Cost
Harmony Search
€€ 3.738 M
Time (seconds) 23
Enumeration Algorithm
€€ 3.476 M
12960000
3 Algorithm Design The HS algorithm has been successfully applied to various industrial optimization problems [9]. For instance, the traveling salesperson problem [8], generalized orienteering problem [10], and optimal school bus routings [11], etc. The optimization procedure of the HS algorithm is shown in Figure 4. The HS algorithm consists of encoding and decoding, initializing the optimization problem and algorithm parameters, initializing the harmony memory (HM), improvising a new harmony from the HM, updating the HM, checking termination criterion, and repairing the solution. In this paragraph, we mainly introduce the encoding and decoding scheme and repair strategy because the other procedure is same to the standard HS algorithm, and then introduce the enumeration algorithm which is used to compare with the HS.
3.1 Encoding and Decoding In this study we adopt the integer number encoding scheme. Firstly, let us represent the graph of the problem with a matrix which is symmetrical. If there is no edge between the two nodes, the value of the corresponding element in the matrix is set to 0; otherwise the element value is set to the number of edges between the two nodes. Secondly, a digital string according to the non-zero elements in the upper triangular part of the matrix is constructed from left to right, top to bottom. The length of the digital string is the coding length of the corresponding problem, and the value of each digit is limited by the supremum of the coding. If an edge is selected out of edges between two nodes in a route, the index number of the edge is used as its code. The code whose edge is not in the route is set to 0. A valid route must be a connected route starting with node vs and ending with node vt . Taking Figure 1 as an example, with the assumption of being a valid multigraph after pre-processing (removing edges and nodes that do not satisfy the conditions), the matrix for Figure 1 is as follows:
The Application of Harmony Search in Fourth-Party Logistics Routing Problems
141
Initialize the optimization problem and algorithm parameters. Specify each decision variable, the possible value range for each decision variable, harmony memory size (HMS), harmony consideration rate (HMCR), pitch adjusting rate (PAR), termination criterion (maximum number of searches)
Initialize the harmony memory (HM). Generate initial harmony (solution vector) as many as the value of (HMS) will allow
Improvise a new harmony from HM based on memory consideration, pitch adjustments, and randomization
New harmony better than the harmony stored in HM?
Y
Update HM
N N
Termination criterion satisfied?
Y Stop
Fig. 4 Harmony search algorithm optimization procedure s s ⎡0 ⎢3 ⎢ ⎢4 ⎢ 3 ⎢0 4 ⎢0 ⎢ 5 ⎢0 t ⎢⎣ 0 1 2
1
2
3
4
5
t
3
4
0
0
0
0 2
2 0
2 3
2 0
0 4
2
3
0
3
2
2 0
0 4
3 2
0 0
0 0
0
0
3
2
2
0⎤ 0 ⎥⎥ 0⎥ ⎥ 3⎥ 2⎥ ⎥ 2⎥ 0 ⎥⎦
(7)
142
G. Bo et al.
The length of the digital string 342223432322 is 12. Each digit is set to its supremum. Given the string 200100000300, we can know the corresponding matrix of the string from the equation (8). The string stands for the route with node s, 1, 3 and t; the edges between the pairs of nodes are 2, 1 and 3 respectively; and the route is Rt = (vs ,2, v1, v3 ,3, vt ) . s s ⎡0 ⎢2 ⎢ ⎢0 ⎢ 3 ⎢0 4 ⎢0 ⎢ 5 ⎢0 t ⎢⎣ 0 1 2
1
2
3
4
5
t 0⎤ 0 ⎥⎥ 0⎥ ⎥ 3⎥ 0⎥ ⎥ 0⎥ 0 ⎥⎦
2
0
0
0
0
0 0
0 0
1 0
0 0
0 0
1
0
0
0
0
0 0
0 0
0 0
0 0
0 0
0
0
3
0
0
(8)
3.2 Repairing Solution Vector The solution vector generated using HS may be invalid, so we need to adjust the solution vector to ensure that it is a connective route. Our aim is to find a legal route. Taking Figure 1 as an example, each node has an adjacent-node-set: d s = {1,2}; d1 = {2,3,4}; d 2 = {2,3,4}; d 3 = {1,2,4,5, t}; d 4 = {1,3, t}; d 5 = {2,3, t}; Similarly, for the solution generated randomly, each node has an adjacent-nodeset Di , and M = {1,2,3,", t} is the set of all the nodes except the start node s . For example, the solution vector 200102030010, Ds = {1}; D1 = {s,3}; D2 = {3}; D3 = {1,2,4}; D4 = {3, t}; D5 = Φ . (a): For the start node s : Ds = 0 : ∀i ∈ d s
If all the Di = Φ , then randomly select one i ∈ d s Else, randomly select one i and Di ≠ Φ . Then give esi a non-zero value, M = M − {i} and go to (b). Ds = 1 : Let Di = Di − {s} , i ∈ Ds , M = M − {i} , apply the edge esi , and then go to (b). Ds ≥ 2 : ∀i ∈ Ds , let Di = Di − {s} . If all the Di = Φ randomly select one i ∈ d s , and apply the edge esi . Else, randomly select one i and Di ≠ Φ , and apply the edge esi . Then let esj = 0 j ∈ Ds , and j ≠ i , M = M − {i} , and go to (b). (b): For node i : Di = 0 : If t ∈ di give eit a non-zero value, let M = M − {t} , and go to (c).
The Application of Harmony Search in Fourth-Party Logistics Routing Problems
143
Else, ∀j ∈ di ; if all the D j = Φ , randomly select one j ∈ di , Else, randomly select one j and D j ≠ {Φ} . Then give eij a non-zero value, M = M − { j} , let i = j , and go to repeat (b). Di = 1 : D j = D j − {i} and j ∈ Di , M = M − { j} , let i = j , and go to repeat (c). Di ≥ 2 : If t ∈ Di , let eij = 0 , D j = D j − {i} j ∈ Di and j ≠ t , M = M − { j} , and go to (c). Else, ∀j ∈ Di , let D j = D j − {i} , If all the Di = Φ randomly select one j ∈ Di , Else, randomly select one j ∈ Di and Di ≠ Φ , Then let e jk = 0 , k ∈ Di , and k ≠ j , M = M − {i} , let i = j , and go to repeat (b). (c): For node t : ∀i ∈ M , j ∈ Di ≠ Φ , let eij = 0 .
Enumerate a simple-graph
Find a minimum-cost route using Dijkstra algorithm
N Meet time window?
Y Compare the value of the shortest route and update the value
N Enumeration is over?
Y Stop
Fig. 5 Enumeration algorithm procedure
3.3 Enumeration Algorithm We design the enumeration algorithm based on the characteristic of our problem. The procedure is:
144
G. Bo et al.
1) First, we enumerate a simple-graph based on the multi-graph. 2) Then, we find a minimum-cost route meeting time windows constraint using Dijkstra algorithm. Figure 5 shows the procedure of the enumeration algorithm.
4 Conclusions and Summary This chapter has described the HS application in areas of 4PLRPTW. Specific experimental cases consist of seven nodes, fifteen nodes, and thirty nodes problems. We set up the mathematical model for the 4PLRPTW, and then applied HS to the NP-hard 4PLRPTW problem. We also suggested the repair strategy. Various node examples were compared with enumeration algorithm to demonstrate the effectiveness and robustness of the HS algorithm. The results of different scale examples revealed that the HS algorithm was capable of finding the global optimum within a reasonable amount of time. Of course, the HS algorithm is not limited to 4PLRPTW that treats discrete variables. It can be easily used for problems with continuous variables. With the success of HS application in fourth-party logistics routing problems, in the future, we can focus on applying the HS into the routing problems with soft time windows and further improving the HS algorithm, such as integrating the HS algorithm with other algorithm.
References 1. Chen, J.Q., Li, X., Liu, W.H.: Directed graph optimization model and its solving method based on genetic algorithm in fourth party logistics. In: The IEEE International Conference on Systems, Man and Cybernetics, vol. 2, pp. 1961–1966 (2003) 2. Huang, M., Tong, W., Wang, Q., et al.: Immune algorithm based routing optimization in fourth-party logistics. In: IEEE Congress on Evolutionary Computation, pp. 3029– 3034 (2006) 3. Huang, M., Bo, G.H., Tong, W., et al.: A hybrid immune algorithm for solving fourthparty logistics routing optimizing problem. In: Proceedings of 2008 IEEE Congress on Evolutionary Computation, pp. 286–291 (2008) 4. Mester, D., Braysy, O.: Active guided evolution strategies for large-scale vehicle routing problems with time windows. Computers & Operations Research 32, 1593–1614 (2005) 5. Lau, H.C., Lo, Y.T.: A multi-agent framework for supporting web-based intelligent fourth party logistics. In: Proceedings of the First International Conference on Integrated Logistics, pp. 195–200 (2001) 6. Geem, Z.W., Kim, J.-H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 7. John, G.: Strategic supply chain alignment. Beijing, China (2003) 8. Bo, G.H., Huang, M., Ip, W.H., et al.: The harmony search for the routing optimization in fourth party logistics with time windows. In: IEEE Congress on Evolutionary Computation, pp. 962–967 (2009)
The Application of Harmony Search in Fourth-Party Logistics Routing Problems
145
9. Geem, Z.W.: Harmony search applications in industry. In: Prasad, B. (ed.) Soft computing applications in industry. Springer, Berlin (2008) 10. Geem, Z.W., Tseng, C.-L., Park, Y.: Harmony search for generalized orienteering problem: Best touring in china. In: Wang, L., Chen, K., S. Ong, Y. (eds.) ICNC 2005. LNCS, vol. 3612, pp. 741–750. Springer, Heidelberg (2005) 11. Geem, Z.W., Lee, K.S., Park, Y.: Application of harmony search to vehicle routing. American Journal of Applied Sciences 2, 1552–1557 (2005)
A Harmony Search with Multi-pitch Adjusting Rate for the University Course Timetabling Mohammed Azmi Al-Betar, Ahamad Tajudin Khader, and Iman Yi Liao
*
Abstract. Course timetabling is a challenging administrative task for the educational institutions which have to painstakingly repeat the process several times per year. In general, course timetabling refers to the process of assigning given events to the given rooms and timeslots by taking into consideration the given hard and soft constraints. To tackle a highly-constraint timetabling problem, a powerful and robust algorithm that can deal with multidimensional gateways is required. Recently, the harmony search algorithm has been successfully tailored for the university course timetabling problem. In this chapter, the application of harmony search for the course timetabling is further enhanced by dividing the pitch adjustment operator to eight procedures, each of which is controlled by its PAR value range. Each pitch adjustment procedure is responsible for a particular local change in the new harmony. Furthermore, the acceptance rule for each pitch adjustment procedure is changed to accept the adjustment that leads to a better or equal objective function. Standard benchmarks are used to evaluate the proposed method. The results show that the proposed harmony search is capable of providing high-quality solutions compared to those in the previous works.
1 Introduction University timetabling is a challenging administrative task that usually baffles the academic institutions and it has to be repeated several times per year. It consists of scheduling given events, each with given features, to the given resources and timeslots according to the given hard and soft constraints[1]. Typically, the timetabling solution is evaluated according to the hard and soft constraints. Hard constraints are essential to be satisfied to produce a feasible timetable while soft constraints are desired but not absolutely essential. The soft constraints might be violated but the more they are satisfied in the timetabling solution, the better is the quality of the solution. University timetabling is normally divided into two problems[2]: examination timetabling problem and course timetabling problem. In this chapter, the later is considered. The university course timetabling problem (UCTP) has attracted the attention of the artificial intelligence and operational research communities for quite a long time. Many approaches have been proposed to tackle this problem. As the basic timetabling problem can be modelled as a graph colouring problem[3], the earliest approaches depended on the graph colouring heuristics. These heuristics built Mohammed Azmi Al-Betar, Ahamad Tajudin Khader, and Iman Yi Liao School of Computer Sciences, Universiti Sains Malaysia, 11800 USM, Penang, Malaysia E-mail: {mohbetar,tajudin,iman}@cs.usm.my Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 147–161. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
148
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
timetables by assigning events to timeslots and rooms, one by one according to the difficulty level of the scheduling in the solution. Nowadays, they are often used to find feasible timetables in other methods[4, 5], and also used as low-level heuristics in hyper heuristics methods[6, 7]. The metaheuristic methods have a notable success rate in solving difficult timetabling problems[8, 9]. They are usually categorized into two: population-based methods and local search-based methods[10]. The population-based methods consider many solutions at the same time. Iteratively, they recombine the characteristics of the current solutions to produce new ones. Among the population-based methods applied in the UCTP are Genetic Algorithms[11], Ant Colony Optimization[12], Artificial Immune System[13], and Harmony Search Algorithm[14]. The local search-based methods consider one solution at a time[10]. The current solution is improved during the search using neighbourhood structures guided by a given acceptance rule, until a stand-still point near the initial solution is obtained. The key components of these algorithms are the definition of the neighbourhood structures. The more the neighbourhood structures are connected to the search space, the more the convergence rate increases [15]. The term connected to the search space refers to the existing path between any two solutions in the search space that apply a sequence of valid moves [15, 16]. The local searchbased methods applied in the UCTP include Iterative Local Search[17], Simulated Annealing[16], Very Large Neighbourhood Search[18, 19], Great Deluge [20, 21]. The hybridization between population-based and local-search based is also a very promising research trend in the timetabling domain[10, 22]. This includes the Hybrid Evolutionary Algorithm [5, 23], Hybrid Harmony Search Algorithm[24], and Evolutionary Great Deluge[25]. Overview of the previous approaches in the UCTP are available in many surveys, as in [1, 2, 8, 9, 26]. The harmony search algorithm (HSA) has the advantage of population-based method whereby it recombines the characteristics of many solutions at the same time to obtain a solution called the ‘new harmony’. This is done by using two operators: memory consideration and randomness. On the other hand, HSA also has the advantage of local-search based method whereby it fine-tunes the solution using a pitch adjustment operator[27]. In the authors’ previous works[14, 24, 27], the harmony search algorithm (HSA) was successfully tailored for the UCTP. The pitch adjustment operator was designed similar to a neighbourhood structure where it is divided into two procedures with random acceptance rule. There are two main objectives of this chapter: Firstly, to define more pitch adjustment procedures for the UCTP, where each is controlled by a specific PAR value range to further enhance the ability of HSA to connect the UCTP search space more efficiently. Secondly, to change the acceptance rule of these procedures to accept the local change on the new harmony, if the objective function is not negatively affected.
2 University Course Timetabling Problem The UCTP considered in this chapter was initially defined by the Metaheuristics Network1 (MN), a European commercial research project shared by five European 1
http://www.metaheuristics.net/
A Harmony Search with Multi-pitch Adjusting Rate
149
institutions from 2000 to 2004. The objective of this research project is to investigate the efficiency of different metaheuristics on different combinatorial optimization problems. The UCTP of MN was discussed by Rossi-Doria et al.[17] as the problem of assigning given events to suitable rooms and timeslots according to hard and soft constraints. This problem includes three hard constraints and three soft constraints as follows: H1. Event Conflict: Students must not be double booked for events. H2. Room availability: Room capacity and features must be suitable for the assigned events. H3. Room occupancy: Rooms must not be double booked for events. S1. Last period of a day: A student shall not have an event in the last timeslot of the day. S2. More than two events in a row: A student shall not have more than two events in a row. S3. Single event in a day: A student shall not have a single event in a day. The main objective of UCTP is to minimize the number of soft constraint violations in a feasible timetable.
2.1 Problem Modelling The UCTP consists of a set of n events, E = {e1 , e2 ,..., en } each of which is attended by students and demanded specific room features; a set of m rooms, R = {r0 , r1 ,..., rm−1} each of them has specific seats capacity and features; a set of p
timeslots, T = {t 0 , t1 ,..., t p −1} where p = 45 (5 working days, each with 9 timeslots); a set of z room features, F = { f 0 , f1 ,..., f z −1} ; a set of v students, S = {s0 , s1 ,..., sv −1} each of them attends one or more events. The symbols and variables used in UCTP modelling are shown in Table 1. The timetable solution is represented by a vector, x = ( x1 , x2 ,..., xn ) of events; each event must be scheduled in a feasible location within the range of [0, m × p − 1] , where each location is a map of room-timeslot pair. Each location is interrupted by Eq.(1). xi = j × p + k .
(1)
Where j is the index of room r j and k is the index of timeslot t k . For example, let n = 400 , p = 45 , and m = 10 be the number of events, timeslots, and rooms, respectively. The available range for each event location is within [0, 449]. Let x = (320,194,55,...) be a complete and feasible timetable. The event, x1 is scheduled by location 320 in timeslot, t k of index 5 at room, r j of index 7; the event, x 2 is scheduled by location 194 in timeslot, t k of index 14 at room, r j of index 4; etc. The timeslot index is extracted from the location of the event, xi shown in Eq. (2) and the room index is extracted from the same location as shown in Eq. (3).
150
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
t k = xi mod p
(2)
⎢x ⎥ rj = ⎢ i ⎥ ⎣ p⎦
(3)
Definition 1. The location l is feasible for event xi to be scheduled in the timetable x if and only if the following conditions are met: 1. x j ≠ l ∀ xj ∈x . = 1.
2.
q
3.
x j mod p ≠ xi mod p
⎢x ⎥ i ,⎢ i ⎥ ⎣ p⎦
∀ x j ∈ x ∧ ci , j = 1 ∧ i ≠ j .
Given the notations in Table 1, the UCTP for a timetable solution, x can be formally described. The objective function in Eq.(4) includes the penalty cost of the three defined soft constraints in a feasible timetable that satisfies three defined hard constraints and can be modelled as follows: v −1
Minimize
f (x) = ∑ ( f1 (x, s ) + f 2 (x, s ) + f 3 (x, s ))
(4)
s =0
Subject to • H1. Event Conflict. ∀ xi , x j ∈ x ∧ x j mod p = xi mod p ∧ i ≠ j ci , j = 0 . • H2. Room availability. ∀xi ∈ x
q
=1.
⎢x ⎥ i,⎢ i ⎥ ⎣ p⎦
• H3. Room occupancy. This hard constraint is always satisfied using this proposed solution representation. • S1. Last period of a day. ∀s ∈ S d −1
f1 ( x, s ) = ∑ sa s ,h×( j +1) −1 j =0
• S2. More than two events in a row. ∀s ∈ S d −1 h −3
f 2 (x, s ) = ∑ ∑ sa s ,i×h+ j × sa s ,i×h+ j +1 × sa s ,i×h+ j + 2 i =0 j =0
• S3. Single event in a day. ∀s ∈ S d−1
f3(x, s) = ∑as, j j=0
Where a s , j
⎧ ⎪1 =⎨ ⎪⎩0
h −1
∑ sa s , j×h +i i =0
otherwise
∀j ∈ [0, d − 1]
A Harmony Search with Multi-pitch Adjusting Rate
151
Table 1 Notations used for the UCTP modelling Symbols Description
n m
The number of events.
d
The number of working days per week.
h p
The number of timeslots per working day.
The number of rooms.
The number of timeslots where p = 45(d = 5 working days with h = 9 timeslots on each).
z v E
The number of features.
R
Set of rooms, R = { f i | i = 0,..., m − 1} .
T
Set of timeslots, T = {ti | i = 0,..., p − 1} .
F
Set of features, F = { f i | i = 0,..., z − 1} .
S
Set of students, S = {si | i = 0,..., v − 1} .
bi
The number of students attending event, ei .
gi
The seat capacity of room, ri .
wi , j
⎧1 wi , j = ⎨ ⎩0
if event ei requires feature f j
⎧1 yi , j = ⎨ ⎩0
if room ri contains feature f j
⎧1 ui , j = ⎨ ⎩0
if student si attends to event e j
yi , j ui , j ci , j
The number of students. Set of events, E = {ei | i = 1,..., n} .
otherwise otherwise
Conflict matrix. Whether event ei and event e j conflict each other.
⎧1 ci , j = ⎨ ⎩0
qi , j
otherwise
if (uk ,i = 1) ∧ (u k , j = 1),
∀k ∈ S
otherwise
Event-room matrix. Whether event ei and room r j are compatible in features and capacity.
⎧1 qi , j = ⎨ ⎩0
if ( wi ,k = yi ,k ) ∧ (bi ≤ g j ),
∀k ∈ F
otherwise
xi
Event ei is scheduled by a feasible location l in the timetable x.
sa j ,k
Student availability matrix. Whether student s j in timeslot t k in the current timetable x.
∀xi ∈ x ∧ k = xi mod p,
⎧1 sa j ,k = ⎨ ⎩0
if u j,i = 1
otherwise
152
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
Step 1 Æ
Step 2 Æ
I- Initialize harmony search parameters 1. Harmony Memory Consideration Rate (HMCR) 2. Pitch Adjacent Rate ( PAR ) 3. Harmony Memory Size( HMS ) 4. Number of Improvisations( NI ) II- Initialize timetabling parameters (Rooms, Courses, Timeslots, Features, etc.)
I- Initialize harmony memory. II- Generate random feasible initial timetables depending on HMS. III- Store them to harmony memory
Step 3 Æ
Improvise new harmony solution
If new harmony solution better than the worst harmony in harmony memory Step 4 Æ
Step 5 Æ
No
Yes
Yes
Update harmony memory
Is Improvisation loop less than NI
No Stop
Fig. 1 The HSA steps for UCTP
3 Designing Harmony Search for UCTP The harmony search algorithm (HSA) is a new metaheuristic population-based algorithm developed by Geem et al. [28]. It mimics the musical improvisation process, where a group of musicians improvise the pitches of their musical instruments, practice after practice, seeking for a pleasing harmony as determined by an audio-aesthetic standard. This can be translated into optimisation process as follows: a set of decision variables is assigned with values, iteration by iteration, seeking for a ‘good enough’ solution, as evaluated by an objective function. Fig.1 describes the five steps of HSA with application to the UCTP. It has to be borne in mind that this chapter considers the feasible search space region. Therefore, some of the HSA steps and operators had to be modified to preserve the feasibility. The following is a detail and thorough explanation of the five steps of HSA with application to UCTP.
A Harmony Search with Multi-pitch Adjusting Rate
153
Step.1. Initialize the HSA and UCTP parameters The UCTP parameters which are discussed in Section 2.1 are normally extracted from the problem instances. These parameters include the set of events, the set of rooms, the set of timeslots, the set of features, etc. The main decision variable of UCTP is the events. Each event can be scheduled by a feasible location in the timetable solution. A set of all feasible locations can be considered as the available range of such events. In fact, the feasible location of each event changes during the improvisation process of HSA. The objective function described in Eq.(4) is utilized to evaluate each solution during the HSA process which includes the functions of the three soft constraints. In this step, the HSA parameters used for UCTP are selected. That is, the Harmony Memory Size (HMS) which is similar to the population size in genetic algorithms; Number of Improvisation (NI) which is similar to the number of iterations; Harmony Memory Consideration Rate (HMCR); and Pitch Adjustment Rate (PAR). Note that the HMCR and PAR are the two parameters responsible for the improvisation process. These parameters will be explained in more detail in the next steps. Step.2. Initialize the harmony memory The harmony memory (HM) is a memory location which contains sets of solution vectors which are determined by HMS (see Eq.5). In this step, these vectors are heuristically constructed and stored in the HM in ascending order, based on the objective function values, such that f (x1 ) ≤ f (x 2 ) ≤ ... ≤ f (x HMS ) . ⎡ x11 ⎢ 2 x HM = ⎢ 1 ⎢ . ⎢ HMS ⎣⎢ x1
x12 x22 . x2HMS
x1n ⎤ ⎥ ... xn2 ⎥ ... . ⎥ ⎥ ... x nHMS ⎦⎥ ...
(5)
The feasibility for all HM timetabling solutions is maintained with a method that combines the largest weighted degree (LWD), backtracking algorithms, and the MultiSwap algorithm[14]. Step 3. Improvise a new harmony The HSA constructs a new harmony timetable solution, x' = ( x1′ , x 2′ ,..., x n′ ) from scratch based on three operators: (1) memory consideration. (2) random consideration, and (3) pitch adjustment. If a complete new harmony is not obtained, then the repair process takes over [14]. The feasibility of the new harmony must be maintained through the search. As such, a feasibility matrix is proposed, as in Definition 2.
154
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
Definition 2. Feasibility matrix is a binary matrix FM of size n × HMS where fmi , j changes iteratively during the improvisation process which contains either fmi , j = 1 , if and only if an event, i has a feasible location in the solution, j that is stored in HM to be scheduled in a new harmony solution or if fmi , j = 0 otherwise. This matrix is initialized by 1 at the beginning of the improvisation process. It is also updated when an event is scheduled out of memory consideration or random consideration, or adjusted by pitch adjustment procedures. In UCTP, the smallest position algorithm [14] is used to arrange the events according to the difficulty level of the scheduling in the new harmony solution; the events that have the least feasible locations in the HM solutions to be scheduled in the new harmony, must be selected first. Formally, let sumk = ∑ j =1 fmk , j be the HMS
total number of feasible locations of event xk , the smallest position algorithm selects event xi′ such that i = arg min sumk k =1...n
If there is more than one event at each iteration with the same least feasible locations, the proposed algorithm selects one event based on the LWD heuristic method.
Memory Consideration. Every event selected by smallest position algorithm is scheduled in the new harmony solution by randomly selecting a feasible location from the solutions stored in HM, with the probability of HMCR[14]. In the authors’ previous work [24], the memory consideration was modified to always mimic the best solutions stored so far in the HM, that has feasible locations for all the events. This is inspired by the Practical Swarm Optimisation (PSO)[29]. Formally, let’s set Η i = {xij | fmi , j = 1, ∀j ∈ [1, HMS ]} , where i ∈ [1, n] and fmi , j ∈ FM , contain the feasible locations of event xi′ to be scheduled in the new harmony from the solutions stored in HM. Let’s set,
⎧ ⎫ Ζbest = ⎨ xij j = arg mink f (x k )⎬ k s.t. x ∈ Η i i ⎩ ⎭ where it contains all the feasible locations for all the events from the best solutions stored in HM. The location of event, xi′ is selected from the best solution stored so far in HM, that has a feasible location for xi′ such that xi′ = xij where ( xij ∈ Ζ best ) with the probability of HMCR.
Random Consideration. The remaining events that have not been scheduled by memory consideration will select any feasible location available to be scheduled in the new harmony solution with the probability of (1-HMCR). Formally, let event, xi′ be selected by the smallest position algorithm to be scheduled in the new
A Harmony Search with Multi-pitch Adjusting Rate
155
harmony solution. Let’s set Ρ = {l | l is feasible location for xi′} , where the event, xi′ is scheduled in any feasible location in set Ρ with the probability of (1HMCR).
Pitch Adjustment. Every event, xi′ of a new harmony vector, x' = ( x1′ , x 2′ ,..., x n′ ) , that has been scheduled out of memory considerations is examined to view if it should be pitch adjusted with the probability of PAR where 0 ≤ PAR ≤ 1 , as in Eq.(6).
⎧Yes xi′ = ⎨ ⎩ No
w.p.
PAR
w.p.
1 − PAR
(6)
For UCTP, the pitch adjustment operator is designed to work similar to the neighbourhood structures in the local search-based methods, where the pitch adjustment operator is divided into eight procedures: (1) the pitch adjustment move-timeslot, (2) the pitch adjustment Swap-timeslot ,(3) the pitch adjustment move-location,(4) the pitch adjustment swap-location,(5) the pitch adjustment exchange-location, (6) the pitch adjustment swap-distinct-timeslots, (7) the pitch adjustment move-room, and (8) the pitch adjustment Swap-room. Each of these procedures is controlled by a particular PAR range, as shown in Eq. (7).
⎧ move-timeslot ⎪ Swap-timeslot ⎪ ⎪ move-location ⎪ ⎪ swap-location ⎪ xi′ = ⎨exchange-location ⎪ swap-distinct-timeslots ⎪ ⎪ move-room ⎪ ⎪ Swap-room ⎪⎩ do nothing
0 < U( 0,1 ) ≤ 0.10 × PAR 0.10 × PAR < U( 0,1 ) ≤ 0.20 × PAR 0.20 × PAR < U( 0,1 ) ≤ 0.30 × PAR 0.30 × PAR < U( 0,1 ) ≤ 0.40 × PAR 0.40 × PAR < U( 0,1 ) ≤ 0.50 × PAR
(7)
0.50 × PAR < U( 0,1 ) ≤ 0.60 × PAR 0.60 × PAR < U (0,1) ≤ 0.70 × PAR 0.70 × PAR < U (0,1) ≤ 0.80 × PAR 0.80 × PAR < U (0,1) ≤ 1
Where U(0,1) generates a uniform random distribution between 0 and 1. The proposed pitch adjustment procedures are designed to work as follows: 1. The pitch adjustment move-timeslot. An event, xi′ that meets the probability of 10%×PAR is randomly moved to any feasible timeslot where the room is not changed. 2. The pitch adjustment Swap-timeslot. An event, xi′ , that meets the probability between 10%×PAR and 20%×PAR is swapped with the timeslot of another event, (say x ′j ) while the rooms of both events are not changed. 3. The pitch adjustment move-location. An event, xi′ , that meets the probability between 20%×PAR and 30%×PAR is randomly moved to any free feasible location in the new harmony solution.
156
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
4. The pitch adjustment swap-location. An event, xi′ , that meets the probability between 30%×PAR and 40%×PAR is randomly swapped with another event (say x ′j ) while the feasibility is maintained. 5. The pitch adjustment exchange-location. An event, xi′ , that meets the probability between 40%×PAR and 50%×PAR is randomly exchanged with another two events (say x ′j and x k′ ) while the feasibility is maintained. 6. The pitch adjustment swap-distinct-timeslots. An event, xi′ , that meets the probability between 50%×PAR and 60%×PAR is adjusted as follows: (1) select all the events that have the same timeslot, (say t j ) as event xi′ . (2) select a timeslot in random (say t k ). (3) simply swap all the events in timeslot, t j with all the events in other timeslot, t j without changing the rooms. 7. The pitch adjustment move-room. An event, xi′ that meets the probability between 60%×PAR and 70%×PAR is moved to any free feasible room while the timeslot is not changed. 8. The pitch adjustment Swap-room. An event, xi′ that meets the probability between 70%×PAR and 80%×PAR swaps its room with a room of another event in the same timeslot while reserving the feasibility. The original HSA [30] adjusts the decision variables that meets a probability of PAR randomly without checking whether the objective function is affected. In UCTP, the numbers of events (or variables) are considerable and the correlation between them is high. As such, the acceptance rule of the pitch adjustment procedures is changed to work, as follows: the adjustment done by each pitch adjustment procedure is accepted if and only if the objective function value of the new harmony is not negatively affected.
Step 4. Update the harmony memory If the new harmony vector, x' = ( x1′ , x 2′ ,..., x n′ ) , is better than the worst harmony stored in HM in terms of the objective function value, the new harmony vector is added to the HM and the worst harmony vector is deleted from the HM. Step 5. Check the stop criterion Step 3 and step 4 of HSA are repeated until the stop criterion (maximum number of improvisation) is met. This is specified by NI parameter.
4 Experimental Results The proposed method is evaluated by using the UCTP data instances which is made available for free at ‘http: //iridia.ulb.ac.be/ msampels/tt.data/’ by Socha et al.[17]. For the purpose of this study, let’s call this the ‘Socha benchmark’. The 11 problem instances have different levels of complexity and are in various sizes. They are grouped into five small problem instances (S1,…,S5), five medium problem instances (M1,…,M5) and one large problem instance (L), as shown in Table 2. The
A Harmony Search with Multi-pitch Adjusting Rate
157
solution to all the problem instances must satisfy the defined hard constraints stated in Section 2. Furthermore, the solution cost is measured by the defined soft constraints violation as described in Eq.(4).The proposed methods are coded in Microsoft Visual C++ 6 on Windows XP platform which ran on Intel 2 GHz Core 2 Quad processor with 4 GB of RAM. Socha’s problem instances were experimented using different settings of parameter values, as shown in Table 3. Each problem instances ran ten times in a different random seed, and the best problem cost obtained for all problem instances is reported in Table 4. Table 2. The characteristics of each class of Socha benchmarks [15] Class
Small
Medium
Large
number of events
100
400
400
number of rooms
5
10
10
number of features
5
5
10
number of students
80
200
400
number of timeslots
45
45
45
approximate feature per room
3
3
5
percentage of feature use
70
80
90
maximum number of events per student
20
20
20
maximum number of students per event
20
50
100
Table 3. The parameter values of the proposed HSA Parameter NI Value
HMS HMCR PAR
100000 10
99%
100%
The results are compared with those in the literature mentioned below that used the same Socha benchmarks, as shown below: RRLS (2002) MMAS (2002) THH (2003) VNS (2005) FMHO (2005) GHH (2007) RII( 2007) HEA (2007) EGD (2008) HSA (2008) GD (2008) NGD (2008) GALS (2008)
- Random Restart Local Search [17]. - MAX-MIN Ant System [17]. - Tabu-search Hyper Heuristic [6]. - Variable Neighbourhood search[19]. - Fuzzy Multiple Heuristic Ordering[4]. - Graph-based Hyper-Heuristic[7]. - Randomised Iterative Improvement [18]. - Hybrid Evolutionary Approach [5]. - Extended Great Deluge [21]. - Harmony Search Algorithm [14]. - Great Deluge[20]. - Non-Linear Great Deluge[20]. - Genetic Algorithm and Local Search [23].
158
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
ENGD (2009) NGDHH-SM (2009) NGDHH-DM (2009) EFDRGD (2009) HHSA (2009) MHSA (To appear)
- Evolutionary Non-linear Great Deluge [25]. - Great Deluge Hyper-Heuristic –Static Memory [31]. - Great Deluge Hyper-Heuristic-Dynamic Memory[31]. - Electromagnetism Mechanism Great Deluge[32]. - Hybrid Harmony Search Algorithm[24]. - Modified Harmony Search Algorithm [27].
Table 4 shows the solution costs of the proposed method in terms of the number of soft constraints violations compared with those that appeared in the previous methods using the same Socha benchmark. The best solution costs are highlighted while ‘#’ indicates that the method could not find a feasible timetable solution for the Socha benchmark. The methods in bold line are the variations of HSA applied to UCTP. It is apparent that the proposed method is able to obtain feasible solutions for all Socha benchmarks. Furthermore, it is able to obtain high quality solutions in comparison with previous methods. Fig.2 shows a clear comparison with some methods that are able to produce feasible solutions for all Socha benchmarks which are marked with ‘+’ in the last column of Table 4; the total number of solution costs is used as a factor of comparison. The proposed method outperforms the previous works in the total solution costs of all Socha benchmarks. Table 4. Comparison with previous works S1
S2
S3
S4
S5
Proposed Method
0
0
0
0
0
M1 M2 124 117
M3 M4 190 132
M5 73
RRLS(2002)
8
11
8
7
5
199 202.5 #
MMAS(2002)
1
3
1
1
0
195 184
THH(2003)
1
2
0
1
0
146 173
284 164.5 219.5 851.5 1904.5+ 267 169 303 1166 2228+
VNS(2005)
0
0
0
0
0
317 313
375 247
292
FMHO(2005)
10
9
7
17
7
243 325
249 285
132
GHH(2007)
6
7
3
3
4
372 419
359 348
171
15441138 2422+ 1068 2760+
265 181
151
#
177.5 #
L 424
#
Total
1060+ 618-
#
10001438+
RII(2007)
0
0
0
0
0
242 161
HEA(2007)
0
0
0
0
0
221 147
246 165
130
529
EGD (2008)
0
0
0
0
0
80
139 88
88
730
HSA (2008) GD (2008)
5
3
2
3
1
316 243
255 235
215
#
17
15
24
21
5
201 190
229 154
222
NGD(2008)
3
4
6
6
0
140 130
189 112
141
1066 2144+ 876 1607+
GALS(2008)
2
4
2
0
4
254 258
251 321
276
ENGD(2009)
0
1
0
0
0
146 147
185 116
129
1026 2398+ 821 1545+
NGDHH-SM (2009) 0
0
0
0
0
71
82
137 55
106
777
NGDHH-DM (2009) 0
0
0
0
0
87
88
112 84
103
915
EFDRGD (2009)
0
0
0
0
0
96
96
135 79
87
683
HHSA (2009)
0
0
0
0
0
105 102
135 122
123
671
1176+ 1258+
0
168 160
176 144
71
417
1136+
MHSA (To appear) 0
0
0
0
105
1230+ 1278-
1228+ 1389+
A Harmony Search with Multi-pitch Adjusting Rate
159
Fig. 2 Comparison of results with previous methods
5 Conclusions and Future Research In this chapter, the HSA with multi-pitch adjusting rate is presented to tackle the UCTP. The proposed method enhanced the solution quality further by means of fine-tuning the search space region of new harmony in each iteration. Eight pitch adjustment procedures were proposed, each of which is controlled by a particular PAR range. Furthermore, each pitch adjustment procedure accepts the adjustments that meet the parameter value if the objective function is not negatively affected. The results show that the proposed modification is able to obtain high quality solutions in comparison with previous methods that tackled eleven Socha benchmarks. The authors believe that the HSA is very valuable with a significant potential in the domain of scheduling. For future research, the HSA can be applied on other timetabling problems like examination timetabling, nurse rostering, etc.
Acknowledgments The first author would like to thank Universiti Sains Malaysia for the financial support under USM fellowship scheme for his PhD study.
References 1. Burke, E.K., Jackson, K., Kingston, J.H., Weare, R.: Automated university timetabling: The state of the art. The Computer Journal 40, 565–571 (1997) 2. Schaerf, A.: A Survey of Automated Timetabling. Artif. Intelli. Rev. 13, 87–127 (1999)
160
M.A. Al-Betar, A.T. Khader, and I.Y. Liao
3. Wood, D.: A technique for colouring a graph applicable to large scale timetabling problems. The Computer Journal 12, 317–319 (1969) 4. Asmuni, H., Burke, E.K., Garibaldi, J.: Fuzzy Multiple Heuristic Ordering for Course Timetabling. In: al-SMAe (ed.) Proceedings of the 5th United Kingdom Workshop on Computational Intelligence (UKCI 2005), London, UK, pp. 302–309 (2005) 5. Abdullah, S., Burke, E.K., McCollum, B.: A Hybrid Evolutionary Approach to the University Course Timetabling Problem. In: Proceedings of the IEEE Congress on Evolutionary Computation, Singapore, September 2007, pp. 1764–1768 (2007) 6. Burke, E.K., Kendall, G., Soubeiga, E.: A Tabu-Search Hyperheuristic for Timetabling and Rostering. Journal of Heuristics 9, 451–470 (2003) 7. Burke, E.K., McCollum, B., Meisels, A., Petrovic, S., Qu, R.: A graph-based hyperheuristic for educational timetabling problems. Eur. J. Opl. Res. 176, 177–192 (2007) 8. Lewis, R., Paechter, B., Rossi-Doria, O.: Metaheuristics for University Course Timetabling, Ph.D. Thesis (August 2006) 9. Lewis, R.: A survey of metaheuristic-based techniques for University Timetabling problems. OR Spectrum 30, 167–190 (2008) 10. Blum, C., Roli, A.: Metaheuristics in combinatorial optimization: Overview and conceptual comparison. ACM Comput. Surv. 35, 268–308 (2003) 11. Lewis, R., Paechter, B.: New crossover operators for timetabling with evolutionary algorithms. In: Lofti, A. (ed.) The fifth international conference on recent advances in soft computing (RASC 2004), Nottingham, England, pp. 189–194 (2004) 12. Socha, K., Joshua, K., Michael, S.: A MAX-MIN Ant System for the University Course Timetabling Problem. In: Dorigo, M., Di Caro, G.A., Sampels, M. (eds.) Ant Algorithms 2002. LNCS, vol. 2463, pp. 1–13. Springer, Heidelberg (2002) 13. Malim, M.R., Khader, A.T., Mustafa, A.: Artificial Immune Algorithms for University Timetabling. In: Burke, E.K., Rudova, H. (eds.) The 6th International Conference on Practice and Theory of Automated Timetabling, Brno, Czech Republic, pp. 234–245 (2006) 14. Al-Betar, M.A., Khader, A.T., Gani, T.A.: A harmony search algorithm for university course timetabling. In: 7th International Conference on the Practice and Theory of Automated Timetabling (PATAT 2008), Montreal, Canada, August 18-22 (2008) 15. Thompson, J., Dowsland, K.: Variants of simulated annealing for the examination timetabling problem. Annals of Operations Research 63, 105–128 (1996) 16. Chiarandini, M., Birattari, M., Socha, K., Rossi-Doria, O.: An effective hybrid algorithm for university course timetabling. J. of Scheduling 9, 403–432 (2006) 17. Rossi-Doria, O., Blum, C., Knowles, J., Sampels, M., Socha, K., Paechter, B.: A local search for the timetabling problem. In: Proceedings of the 4th International Conference on the Practice And Theory of Automated Timetabling (PATAT 2002), August 2002, pp. 124–127 (2002) 18. Abdullah, S., Burke, E., McCollum, B.: Using a Randomised Iterative Improvement Algorithm with Composite Neighbourhood Structures for the University Course Timetabling Problem. Metaheuristics, 153–169 (2007) 19. Abdullah, S., Burke, E.K., McCollum, B.: An Investigation of Variable Neighbourhood Search for University Course Timetabling. In: Proceedings of the 2nd Multidisciplinary Conference on Scheduling: Theory and Applications (MISTA), New York, USA, pp. 413–427 (2005) 20. Landa-Silva, D., Obit, J.H.: Great deluge with non-linear decay rate for solving course timetabling problems Intelligent Systems. In: Proceedings of the 4th International IEEE Conference on Intelligent Systems, pp. 8-11-18-18 (2008)
A Harmony Search with Multi-pitch Adjusting Rate
161
21. McMullan, P.: An extended implementation of the great deluge algorithm for course timetabling. In: Shi, Y., van Albada, G.D., Dongarra, J., Sloot, P.M.A. (eds.) ICCS 2007. LNCS, vol. 4487, pp. 538–545. Springer, Heidelberg (2007) 22. Qu, R., Burke, E.K., McCullom, B., Merlot, L.T.G., Lee, S.Y.: A survey of search methodologies and automated approaches for examination timetabling. Journal of Scheduling 12, 55–89 (2009) 23. Abdullah, S., Turabieh, H.: Generating university course timetable using genetic algorithms and local search. In: The Third 2008 International Conference on Convergence and Hybrid Information Technology (ICCIT), pp. 254–260 (2008) 24. Al-Betar, M.A., Khader, A.: A hybrid harmony search for university course timetabling. In: Proceedings of the 4nd Multidisciplinary Conference on Scheduling: Theory and Applications (MISTA 2009), Dublin, Ireland, August 10-12, pp. 157–179 (2009) 25. Landa-Silva, D., Obit, J.: Evolutionary Non-linear Great Deluge for University Course Timetabling. In: Corchado, E., et al. (eds.) HAIS 2009. LNCS (LNAI), vol. 5572, pp. 269–276. Springer, Heidelberg (2009) 26. Carter, M.W., Laporte, G.: Recent developments in practical course timetabling. In: Burke, E.K., Carter, M. (eds.) PATAT 1997. LNCS, vol. 1408, pp. 3–19. Springer, Heidelberg (1998) 27. Al-Betar, M.A., Khader, A.: A Harmony Search Algorithm for University Course Timetabling. Annals of Operations Research (to appear) 28. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 29. Eberhart, R., Kennedy, J.: A new optimizer using particle swarm theory. In: Proceedings of 6th International Symposium on Micro Machine and Human Science (MHS 1995), pp. 39–43 (1995) 30. Lee, K.S., Geem, Z.W.: A new structural optimization method based on the harmony search algorithm. Computers & Structures 82, 781–798 (2004) 31. Obit, J.H., Landa-Silva, D., Ouelhadj, D., Sevaux, M.: Non-Linear Great Deluge with Learning Mechanism for Solving the Course Timetabling Problem. In: The 8th Metaheuristics International Conference (MIC 2009), Hamburg, Germany (July 2009) 32. Turabieh, H., Abdullah, S., McCollum, B.: Electromagnetism-like Mechanism with Force Decay Rate Great Deluge for the Course Timetabling Problem. In: RSKT 2009. LNCS, vol. 5589, pp. 497–504. Springer, Heidelberg (2009)
An Optimization Algorithm Based on Harmony Search for RNA Secondary Structure Prediction Abdulqader M. Mohsen, Ahamad Tajudin Khader, and Dhanesh Ramachandram
1
Abstract. The determination of RNA molecules function relies heavily on its secondary structure. The current physical methods for RNA structure determination are time consuming and expensive. Hence, the methods of computational prediction of structure are the better alternatives. Various algorithms have been used for the RNA structure prediction, including dynamic programming and meta-heuristic algorithms. This chapter proposes the meta-heuristic harmony search algorithm (HSRNAFold) to find RNA secondary structure with minimum free energy and similarity to the native structure. HSRNAFold is compared to dynamic programming techniques: RNAFold and the benchmark, Mfold. The results show that HSRNAFold is comparable to dynamic programming in finding the minimum free energies in all RNA test sequences. The proposed method is efficient and promising in predicting the RNA secondary structure based on the minimum free energy.
1 Background The number of the biological functions of RNA has increased in the recent years. In addition, the scope has been expanded, thus RNA is not only a passive messenger of genetic information from DNA to proteins manufactures as it was thought before. It turns out that RNA performs a variety of tasks in many different biological contexts. For example, catalyzing chemical reactions or complementing protein enzyme based-activity[1, 2]. Determining the secondary structure of an RNA molecule is very important in understanding its biological function [3, 4]. An RNA molecule is a sequence of four different types of nucleotides. Each nucleotide has one of these bases: adenine (A), guanine (G), cytosine (C) or uracil (U). This sequence is the primary structure of the RNA molecule. The hydrogen bonds among nucleotides that are not neighbors in the chain constitute a secondary structure. These hydrogen bond occur mostly between G and C, A and U, or G and U (or vice versa). The connected nucleotide bases are called canonical base pairs. RNA secondary structure has a number of elements, as illustrated in Figure 1. These elements include common motifs such as helices (stems), hairpin loops, internal loops, bulges, multi-branched loops and external bases. The stacked base Abdulqader M. Mohsen, Ahamad Tajudin Khader, and Dhanesh Ramachandram School of Computer Science, University of Science Malaysia, Penang, 11800, Malaysia E-mail:
[email protected], {tajudin,dhaneshr}@cs.usm.my Z.W. Geem: Recent Advances in Harmony Search Algorithm, SCI 270, pp. 163–174. springerlink.com © Springer-Verlag Berlin Heidelberg 2010
164
A.M. Mohsen, A.T. Khader, and D. Ramachandram
pairs form the helices. The stability of the secondary structure increases according to the number of stacked base pairs, which are the stems. On the contrary, the number of unpaired bases decreases the stability of the structure such as interior loops, hairpin loop or bulges.
Fig. 1 RNA secondary structure components: stems (helices), interior loops, hairpin loop, multi loops and bulges loops. This figure is created using jViz.RNA [5] for the Deinococcus radiodurans organism.
The RNA secondary structure prediction is not a trivial problem. It is much more difficult to predict the specific base pairings that results in the native RNA structure. It has been estimated that the number of secondary structures modeled from the input of n nucleotides is greater than 1.8n [6]. For example, Saccharomyces cerevisiae (X67579) 5S rRNA with 118 nucleotides in length has an estimated of 1.3 × 10 30 secondary structure models, while a larger RNA such as the Sulfolobus acidocaldarius (D14876) 16S rRNA , with 1493 nucleotides, has an estimated total of 1.3 × 10 381 possible secondary structure models. Since RNA folding is subject to the laws of thermodynamics, there is an assumption that the correct structure is the low energy structure [3, 7]. The stability of the secondary structure depends on the amount of free energy released to form
An Optimization Algorithm Based on Harmony Search
165
the base pairs. Consequently, more negative free energy in a structure yields to more stable formation of a particular sequence. One of the main approaches to study the RNA’s secondary structures is the single sequence approach. The general objective of this approach is to compute the secondary structure by minimizing the total free energy of its substructures such as stems, loops and bulges. Most of the methods that have been developed are based on the free energy minimization by either applying dynamic programming or meta-heuristics to the domain. In this chapter, Section 2 will present a short overview of the RNA secondary structure algorithms. Harmony search will be presented in Section 3 and HSRNAFold will be introduced in Section 4. The experimental results will be discussed in Section 5. Finally, conclusions and future works will be elaborated in Section 6.
2 RNA Secondary Structure Prediction Algorithms Dynamic programming algorithms, based on the free energy minimization of a single RNA sequence has been studied since the early 1970s [8]. Mathews [9] provided a review of the revolutions that have occurred in the development of a number of algorithms. Zuker et al. [10-12] proposed the dynamic programming algorithm Mfold. It is still a popular algorithm for finding the minimum free energy (MFE) pseudoknotfree secondary structure of an RNA molecule. Moreover, it has become the benchmark for computational RNA secondary structure prediction. Mfold takes the primary RNA sequence as input, and uses a complex thermodynamic model for free energy evaluation of structures by seeking the pseudoknot-free secondary structure with the MFE. RNAFold from ViennaRNA Package predicts the RNA secondary structure through energy minimization. It reads an RNA sequence as input and provides three kinds of dynamic programming algorithms for the structure prediction, as follows: i) the minimum free energy algorithm to find a single optimal structure, ii) the partition function algorithm to calculate the base pair probabilities in the thermodynamic ensemble, and iii) the suboptimal folding algorithm to generate all suboptimal structures based on the minimum free energy [13]. On the other hand, many meta-heuristics algorithms were proposed such as Genetic Algorithms (GAs), Simulated Annealing (SA) and Particle Swarm Algorithm (PSA). The more recent GAs’ works in this area are RnaPredict and its parallelized version, P-RnaPredict which was proposed by Wiese and his students. They showed that the quality of their algorithm is comparable to Mfold [14, 15]. SARNA-Predict is an SA algorithm that was introduced in [3, 16] which was used to predict an RNA secondary structure that has a low free energy and high number of correctly predicted base pairs when compared to the known native structures. Recently, HelixPSO which is a PSA was proposed by Geis and Middendorf [17]. It was used for finding secondary structures with low free energy.
166
A.M. Mohsen, A.T. Khader, and D. Ramachandram
Harmony Search (HS) algorithm is an optimization technique that was developed by Geem[18]. HS mimics the improvisation process of musicians. The HS algorithm has been proven to be successful in a wide variety of optimization problems in the several optimization fields such as continuous engineering optimization, vehicle routing, combined heat and power economic dispatch, water pump switching problem, optimal scheduling of multiple dam system and transport energy modelling[19]. This chapter proposes a version of a HS algorithm dubbed HSRNAFold for finding the RNA secondary structure with minimum free energy. The behavior of HSRNAFold is compared to both, dynamic programming Mfold and RNAFold on the standard sets of RNA test molecules.
3 Harmony Search Algorithm Harmony search algorithm [18] refers to the methods that are inspired by a musical performance process which is simulated on a computing platform. Geem et al. in [18] [20] mentioned four advantages of HS compared to other optimization techniques. These advantages are: i) HS requires less mathematics; ii) initial values for the decision variables are not needed; iii) derivative information is also unnecessary and v) HS is more flexible and produces better solutions than GA. Similarities between the music improvisation and the optimization algorithms are summarized as follows: • Music improvisation seeks the best state (fantastic harmony) determined by the aesthetic estimation, as the optimization algorithms seek the best state (global optimum) by objective function evaluation. • Aesthetic estimation is determined by the set of pitches played by joined instruments, just as objective function (function evaluation) is determined by the set of values of decision variables. • Aesthetic sound quality (better aesthetic) can be improved practice after practice; just as function value can be improved iteration after iteration.
In general, HS has five steps as shown in Figure 2 and as follows: 1. Initializing the problem and algorithm parameters including a representation of solution vectors to the problem. 2. Creating an initial harmony memory (HM) of candidate solutions as a solution vector. 3. Improvising a new harmony from HM. 4. Updating the harmony memory. 5. And, finally, checking the stopping criterion. HS manages the harmony memory vectors of harmonies in which each harmony represents a potential solution to the given problem. It executes an essentially blind search in complex search space. To be successful, HS must strike a balance between exploitation and exploration [21, 22].
An Optimization Algorithm Based on Harmony Search
167
Fig. 2 Optimization steps of the harmony search algorithm
HS has four main parameters that direct the search toward the most favorable areas of the search space. These parameters are: • Harmony memory size (HMS) represents the total number of harmonies in the HM. • Harmony memory consideration rate (HMCR) represents the probability of picking up values from HM to the variables in the solution vector. • Random selection rate (RSR) represents the probability of randomly choosing feasible values from the rage of all possible values to the variables in the solution vector. • Pitch adjusting rate (PAR) represents the probability of further adjusting the pitch with neighboring pitches.
In each cycle or ‘improvisation’, each harmony is evaluated to determine its relative fitness within the harmony memory vectors; a new harmony is retained via each improvisation process. HMCR and PAR are applied to the HM in each improvisation process. After the improvisation of the new harmony is completed, it is evaluated by its objective function (fitness function). If the value of its objective function is better than the value of the objective function of the worst harmony in the HM, the new harmony is included in the HM and the existing worst harmony is excluded from the HM. Consequently, the vectors are sorted out based on their fitness functions. Then, the cycle repeats itself with a new harmony. After a varying number of improvisations, the algorithm converges to the best harmony, which represents a quasi-optimal or optimal solution to the given problem.
168
A.M. Mohsen, A.T. Khader, and D. Ramachandram
4 HSRNAFold The proposed algorithm (HSRNAFold) builds a set of feasible helices H , and then it tries to find a subset of H that defines an optimal secondary structure with the minimum free energy. Consequently, the structure prediction becomes a combinatorial optimization problem of picking a subset, x from H . Since RNA folds into a structure with near minimal free energy, HSRNAFold attempts to find the combination of helices that produces a feasible structure with the lowest possible free energy. The first step of HSRNAFold algorithm is to build a base pairs pool of all possible canonical base pairs for a given RNA sequence. Then, from this pool, the algorithm builds the set H of all the potential helices of an RNA molecule. The algorithm iterates through each base pair in the pool and attempts to build a helix by stacking additional base pairs on top of the existing ones. Each base pair is checked if it can be extended to the candidate helix or not by applying the secondary structure constraints. If the candidate helix satisfies the constraints, then that helix must be added to H . A valid helix is specified by three constraints:1) each helix must have at least three stacked canonical base pairs; 2) pairing bases must be at least three bases apart ( j − i > 3) ; 3) each helix must not share its base with
{ }
others, i.e.: {i , j } ∩ i ' , j ' = φ . Once a new helix is created, HSRNAFold computes its free energy contribution. The helix size and the type of base pairs contribute to decrease the free energy of an RNA secondary structure[23]. Then, HSRNAFold fills HM by randomly generating feasible solutions of RNA secondary structures. These solutions are randomly created by subsets of helices from H with the size of (N * M) where N is the length of RNA nucleotide and M is the HMS. All generated structures are evaluated using RNAeval algorithm from the ViennaRNA and then these structures are sorted in the HM. In this case, each harmony in the HS encodes a potential RNA feasible structure. A permutationbased representation is used to encode the RNA secondary structure. Each helix in H is numbered by an integer ranging from 0 to n − 1 ; where n is the number of helices in H . For example, if n = 4, {2, 3, 1, 0} and {1, 0, 3, 2} will be two possible permutations. To produce feasible structures, each permutation is decoded from left to right. Each helix is checked for conflicts with helices to its left. If there are no conflicts found, the helix is retained; otherwise it is discarded. After that, the algorithm generates a new structure based on the memory consideration rate, pitch adjustment and random selection. Then, the new structure is evaluated by calculating its free energy; if it is better than the worst structure in the HM, then it will be included in the HM and the existing worst structure will be excluded. Finally, the algorithm iterates through the solution vectors and generates a new structure in each iteration until the structure of the minimum free energy is found or the maximum number of iterations is reached. Figure 3 shows the pseudo code of the proposed HSRNAFold algorithm. For more details see [24].
An Optimization Algorithm Based on Harmony Search
169
Fig. 3 Pseudo code of the HSRNAFold algorithm
5 Results The proposed algorithm is implemented using C#. To conduct the experiments, six different RNA sequence lengths were used. These sequences are derived from the comparative RNA website [25] which represents a good variety of sequence lengths, organisms, and RNA types. The test RNA sequences including their organism, class, accession number, size and the number of helices are recorded in Table 1. Table 1 Test RNA sequences with their organism, class, accession number, length and the number of helices Organism Name
Seq. Length No. of Helices
Saccharomyces cerevisiae 5S rRNA (X67579)
118
48
Haloarcula marismortui 5S rRNA (AF034620)
122
102
Aureoumbra lagunensis Group I intron, 16S rRNA (U40258) 468
371
Drosophila virilis 16S rRNA (X05914)
784
280
Xenopus laevis 16S rRNA (M27605)
945
748
Sulfolobus acidocaldarius 16S rRNA (D14876)
1493
6183
170
A.M. Mohsen, A.T. Khader, and D. Ramachandram
Each chosen sequence has a known structure specified by the comparative methods. Table 2 demonstrates the best setting for these HSRNAFold parameters: HMS, HMCR, PAR and the number of iterations. The number of iterations is varies between 30 and 30000 iterations. The number of helices and the length of the sequences contribute directly to increase the number of iterations. Table 2 HSRNAFold parameters setting Parameter name Parameter setting HMS
90
HMCR
0.95
PAR
0.3
No. of iterations 30-30000
The proposed algorithm is compared to the web servers of the dynamic programming algorithms: Mfold and RNAFold. The comparison was conducted based on the structure with the minimum free energy as the structure with more negative free energy is more stable. Table 3 illustrates the minimum free energies found in both dynamic programming algorithms and HSRNAFold. Table 3 Minimum free energies ( ∆G in kcal/mol) for Mfold, RNAFold and HSRNAFold RNA length Mfold
RNAFold HSRNAFold
118
-53.50 -55.30
122
-56.44 -60.72
-54.50 -58.52
468
-140.50 -147.10
-133.75
784
-146.30 -150.66
-151.26
945
-250.60 -261.66
-259.96
1493
-803.30 -847.20
-662.30
Figure 4 demonstrates that HSRNAFold algorithm achieved comparable results to the dynamic programming algorithms in all six test’s RNAs. Figure 5 shows that the secondary structure predicated by HSRNAFold is compared to the known secondary structure for the Saccharomyces cerevisiae 5S rRNA (X67579). The dark grey lines represent the base pairs for both the known and predicted structure (true positive base pairs). The light grey lines represent the predicated base pairs which are not found in the known structure (false positive base pairs). The black lines indicate base pairs in the known structures which have not been predicted (false negative base pairs).
An Optimization Algorithm Based on Harmony Search
171
0 -100 -200
MFE
-300
Mfold RNAFold HSRNAFold
-400 -500 -600 -700 -800 -900
118
122
468
784
945
1493
RNA Sequences
Fig. 4 The comparison between minimum free energies of Mfold, RNAFold and HSRNAFold
Fig. 5 The comparison between the known and predicted secondary structures for the Saccharomyces cerevisiae RNA sequence base pairs. This figure was created by [5].
For the true positive base pairs, it should be noted that HSRNAFold and Mfold have found 33 out of 37, that is, 89.2% of the known base pairs in the native structure. In contrary, the RNAFold has found only 28 out of 37, namely 75.7%. In terms of false positive base pairs, HSRNAFold has found fewer base pairs (6 base pairs) which are not found in the known structure compared to both Mfold and RNAFold (8, 14 base pairs respectively). In case of false negative base pairs, HSRNAFold and Mfold are tied. They have failed to predict only 4 base pairs whereas RNAFold has failed to predict 9 base pairs. For more details see [26].
172
A.M. Mohsen, A.T. Khader, and D. Ramachandram
Consequently, this implies that the minimum free energy does not necessarily guarantee predicting the native structure. It is interesting to note that the HSRNAFold algorithm performance is influenced by the length of RNA sequence and the number of helices. Accordingly, the finding of the structure with minimum free energy requires a few iterations with short sequences and a few numbers of helices. Thus, the number of iterations increases whenever the length of sequence and the number of helices increase. For example, the number of iterations required to find the minimum free energies of Saccharomyces cerevisiae 5S rRNA (X67579) and Sulfolobus acidocaldarius 16S rRNA (D14876) are 30 and 30000 iterations respectively.
6 Conclusions In this chapter, a harmony search algorithm (HS) called the HSRNAFold is presented for finding the RNA secondary structure with minimum free energy. Comparing to dynamic programming algorithms, HSRNAFold is comparable to RNAFold and Mfold in predicting the RNA secondary structure with minimum free energy. On the other hand, HSRNAFold takes longer time to reach the optimum solution for large sequences compared to the small sequences. Future work will include the refinement of helix generation algorithm and the study of the effect of the HS parameters to enhance the results.
Acknowledgements The first author would like to acknowledge University of Science Malaysia for the financial support under USM Fellowship scheme. Also he would like to acknowledge the Ministry of Science, Technology and Innovation, MOSTI for funding this research under the EscienceFund grant, for “An Intelligent Genetic Algorithms’ Parameters Adaptation for RNA Folding Problem” Project [USM0001306].
References 1. Doudna, J.A., Cech, T.R.: The chemical repertoire of natural ribozymes. Nature 418, 222–228 (2002) 2. Hansen, J.L., Schmeing, T.M., Moore, P.B., et al.: Structural insights into peptide bond formation. Proceedings of the National Academy of Sciences, 11670–11675 (2002) 3. Tsang, H.H., Wiese, K.C.: SARNA-Predict: A study of RNA secondary structure prediction using different annealing schedules. In: Proceedings of the IEEE Symposium on Computational Intelligence in Bioinformatics and Computational Biology, pp. 239– 246 (2007) 4. Neethling, M., Engelbrecht, A.P.: Determining RNA Secondary Structure using Setbased Particle Swarm Optimization. In: IEEE Congress on Evolutionary Computation (CEC 2006), pp. 1670–1677 (2006)
An Optimization Algorithm Based on Harmony Search
173
5. Wiese, K.C., Glen, E., Vasudevan, A.: jViz.RNA - A Java Tool for RNA Secondary Structure Visualization. IEEE Transactions on NanoBioscience 4, 212–218 (2005) 6. Doshi, K.J., Cannone, J.J., Cobaugh, C.W., et al.: Evaluation of the suitability of freeenergy minimization using nearest-neighbor energy parameters for RNA secondary structure prediction. BMC Bioinformatics 5, 1471–2105 (2004) 7. Deschênes, A.A.: A genetic algorithm for RNA secondary structure prediction using stacking energy thermodyamic models. Master’s thesis, Simon Fraser University (2005) 8. Tinoco, I., Uhlenbeck, O.C., Levine, M.D.: Estimation of secondary structure in ribonucleic acids. Nature 230, 362–367 (1971) 9. Mathews, D.H.: Revolutions in RNA secondary structure prediction. Journal of Molecular Biology 359, 526–532 (2006) 10. Zuker, M., Stiegler, P.: Optimal computer folding of large RNA sequences using thermodynamics and auxiliary information. Nucl. Acids. Res. 9, 133–148 (1981) 11. Zuker, M.: Prediction of RNA Secondary Structure by Energy Minimization. In: Annette, M.G., Hugh, G.G. (eds.) Computer Analysis of Sequence Data, pp. 267–294. Humana Press (1994) 12. Zuker, M.: Mfold web server for nucleic acid folding and hybridization prediction. Nucleic Acids Research 31, 3406–3415 (2003) 13. Hofacker, I.L., Fontana, W., Stadler, P.F., et al.: Fast folding and comparison of RNA secondary structures (The Vienna RNA Package). Monatshefte f. Chemie 125, 167– 188 (1994) 14. Wiese, K.C., Hendriks, A.: Comparison of P-RnaPredict and mfold algorithms for RNA secondary structure prediction. Bioinformatics 22, 934–942 (2006) 15. Wiese, K.C., Deschnes, A., Hendriks, A.: Rnapredict - an evolutionary algorithm for RNA secondary structure prediction. IEEE/ACM Transactions on Computational Biology and Bioinformatics 5, 25–41 (2007) 16. Tsang, H.H., Wiese, K.C.: The signifcance of thermodynamic models in the accuracy improvement of RNA secondary structure prediction using permutation-based simulated annealing. In: Proceedings of the IEEE Congress on Evolutionary Computation, Singapore, pp. 3879–3885 (2007) 17. Geis, M., Middendorf, M.: A Particle Swarm Optimizer for Finding Minimum Free Energy RNA Secondary Structures. In: Proceedings of IEEE Swarm Intelligence Symposium, SIS 2007 (2007) 18. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A New Heuristic Optimization Algorithm: Harmony Search. Simulation 76, 60–68 (2001) 19. Mahdavi, M., Fesanghary, M., Damangir, E.: An improved harmony search algorithm for solving optimization problems. Applied Mathematics and Computation 188, 1567– 1579 (2007) 20. Lee, K.S., Geem, Z.W.: A new meta-heuristic algorithm for continuous engineering optimization: harmony search theory and practice. Computer Methods in Applied Mechanics and Engineering 194, 3902–3933 (2005) 21. Yang, X.-S.: Harmony Search as a Metaheuristic Algorithm. In: Geem, Z.W. (ed.) Music-Inspired Harmony Search Algorithm. Springer, Heidelberg (2009) 22. Omran, M.G.H., Mahdavi, M.: Global-best harmony search. Applied Mathematics and Computation 198, 643–656 (2008) 23. Hendriks, A.: A parallel evolutionary algorithm for RNA secondary structure prediction. Master’s thesis, Simon Fraser University (2005)
174
A.M. Mohsen, A.T. Khader, and D. Ramachandram
24. Mohsen, A.M., Khader, A.T., Ramachandram, D., et al.: Finding the minimum free energy RNA Secondary Structures using Harmony Search Algorithm. In: WCSET 2009, Singapore (2009) 25. Cannone, J.J., Subramanian, S., Schnare, M.N., et al.: The comparative rna web (crw) site: an online database of comparative sequence and structure information for ribosomal, intron, and other rnas. BMC Bioinformatics 3, 169–172 (2002) 26. Mohsen, A.M., Khader, A.T., Ramachandram, D.: Comparison of HSRNAFold and RNAFold algorithms for RNA secondary structure prediction. In: TENCON 2009, Singapore (accepted, 2009)
Author Index
Abraham, Ajith 65 Al-Betar, Mohammed Azmi Artrit, Pramin 23 Ayvaz, M. Tamer 111 Bo, Guihua
Khader, Ahamad Tajudin
123
Das, Swagatam 65 de A. Bernert, Diego L. 77 dos Santos Coelho, Leandro 77 Fesanghary, Mohammad Forsati, Rana 51 Fourie, Jaco 37
Liao, Iman Yi
147
Mahdavi, Mehrdad 51 Meesomboon, Anupap 23 Mills, Steven 37 Mohsen, Abdulqader M. 163
135
Cisty, Milan
99
¨ urk, Ferruh Ozt¨
89
Panigrahi, B.K.
65
Ramachandram, Dhanesh 163 Ravikumar Pandi, V. 65 Tangpattanakul, Panwadee
Gao, X.Z. 11 Geem, Zong Woo 1 Green, Richard 37
Wang, Tong 11 Wang, Xingwei 135
Huang, Min
Xu, He 11 Xue, Kai 11
Ip, W.H.
135 135
147, 163
147
Yildiz, Ali Rıza
89
23