Skip to main content
MethodsX logoLink to MethodsX
. 2020 Jun 4;7:100948. doi: 10.1016/j.mex.2020.100948

Optimization of water distribution of network systems using the Harris Hawks optimization algorithm (Case study: Homashahr city)

Saeid Khalifeh a, Saeid Akbarifard b,, Vahid Khalifeh c, Ebrahim Zallaghi d
PMCID: PMC7296336  PMID: 32566493

Abstract

In this article applies the Harris Hawks Optimization Algorithm for optimization of the water distribution network of the Homashahr located in Iran for a period of one month (from 30 September 2018 to 30 October 2019). The utilized time-series data included water demand, reservoir storage. In this article, a model based on the Harris Hawks Optimization Algorithm (HHO) was developed for the optimization of the water distribution network. The analysis showed that the best solutions achieved by the Harris Hawks Optimization Algorithm (HHO) were 35,508 $. The results revealed that the HHO algorithm was well in the optimal design of water supply networks problem. At the end, about 12% of the optimization was done by this algorithm.

  • In this article applied the Harris Hawks Optimization Algorithm for optimization of the water distribution network of the Homashahr located in Iran.

  • The method presented in this article can be useful for managers of water and wastewater companies, water resource facilities and water distribution system managing director for optimal network design to reduce costs.

  • The present algorithm performs better than the other algorithms in the discussion of the optimization of water distribution networks.

Keywords: Optimization, Homashahr city, Water distribution network, Harris Hawks optimization algorithm

Graphical abstract

Image, graphical abstract


Specifications table

Subject Area Engineering
More specific subject area Optimization of problem using Harris Hawks Optimization Algorithm.
Method name Harris Hawks Optimization Algorithm (HHO)
Name and reference of original method Heidari, A. A., Mirjalili, S., Faris, H., Aljarah, I., Mafarja, M., & Chen, H. (2019). Harris hawks optimization: Algorithm and applications. Future generation computer systems, 97, 849–872. https://doi.org/10.1016/j.future.2019.02.028.
Resource availability - Computer (Intel(R)CoreTMi7-7700 3.60-GHz 32 GB
- MATLAB software
- EPANET software

Literature review

During the last years, several Evolutionary Algorithms (EAs) including Water Cycle Algorithm (WCA) [1], [2], Moth–Flame Optimization (MFO) [3], [4], Mine Blast Algorithm (MBA) [5], Equilibrium Optimization Algorithm (EOA) [6], Butterfly Optimization Algorithm (BOA) [7], Grasshopper Optimization Algorithm (GOA) [8], Symbiotic Organism Search (SOS) [9], [10], [11], Moth-Swarm Algorithm (MSA) [12], [13], and Harris Hawks Algorithm (HHO) [14], [15] have been applied for solving different optimization problems [16].

The Harris Hawks Algorithm (HHO) is a one of the new meta-heuristic algorithms which be used in the different optimization subjects. So far, many researchers have been used this algorithm to solve some problems. Kurtuluş et al., (2020) was used the hybrid Harris hawks and simulated annealing algorithm (HHOSA) to optimize the design variables of the highway guardrails [17]. Yıldız et al., (2019) utilized the HHO in comparison with the grasshopper optimization algorithm (GOA) and the multi-verse optimization algorithm (MVO) for solving the manufacturing optimization problems [15]. Moayedi et al., (2019) compared the HHO related to the dragonfly algorithm to assess the bearing capacity of two-layer foundation soils [18]. Bao et al., (2019) introduced a novel hybrid HHO and differential evolution (DE) for color image multilevel thresholding segmentation [19]. Yıldız et al., (2019) compared some meta-heuristic algorithm including the HHO to optimize structural design of vehicle components [20]. Also, some other researches have been conducted in the field of engineering [21], [22], [23].

Method description

In this paper, a model based on the Harris Hawks Algorithm (HHO) was developed for the optimization of the water distribution network (WDN) of the Homashahr located in Iran, which is effective in designing.

The HHO algorithm is coupled with the water distribution network analyze software, EPANET 2. After analyzing the model by EPANET 2, the pressure for each node and velocity of flow in each pipe are resulted then the values are compared to constraint limits.

The optimal design of water distribution systems is regarded as a problem at which the minimum cost is considered, and the diameter of pipes is considered as the main optimization parameter.

In the present paper, the time series Hydraulic dataset consists of Specifications of the nodes, pipe and, reservoir storage for a period of 1 year (2018). Also, all data is available in the Mendeley Data (https://data.mendeley.com/datasets/269dd3ywf2/draft?a=4b1596dc-f44e-4420–9b00-21c1ad32849b).

In the following, the methodology employed in this article, containing the WDN model, cost function, and optimization algorithms are explained in detail.

The Harris Hawks algorithm

In this paper, the Harris Hawks Optimizer (HHO) algorithm as a nature-inspired optimization paradigm, is proposed to solve optimization problems by Heidari et al. in 2019 [14]. This algorithm is a population-based search that is implemented in three main phases.

In each iteration, search factors update its position using the three search operators for hunt (exploration phase), a transition from exploration to exploitation (extraction phase) and exploitation.

The basic steps of the HHO algorithm are described as follows (Fig. 1):

Fig. 1.

Fig 1

Different level of Harris Hawks optimization (Heidari et al. [14]).

Exploration phase

The observation and discovery of prey by the Harris Hawks is performed at this step.

Usually, the Harris Hawks is on high trees to hunt prey.

A mathematical model is introduced to stimulate the searching process of Harris Hawks such as (1),

Where the Harris Hawks perch close to the hunt if q< 0.5 or perch on a random high trees if q ≥ 0.5, where q is a random number between 0 and 1.

X(iter+1)={Xrand(iter)r1|Xrand(iter)2Xr(iter)...............if...q0.5Xrabit(iter)Xm(iter))r3(LB+r4(UBLB))..if...q0.5} (1)

Where Xiter is the current location of candidate solution (hawks), Xrand is the randomly chosen hawk among the available population, Xrabit is the rabbit location, iter denotes the present iteration, r1, r2, r3, r4 and q are random numbers ranging in [0–1], LB and UB indicate the upper and lower values of the variables Xm displays the mean location of current hawks population and is computed as follows:

Xm(iter)=1Ni=1NXi(iter), (2)

In which Xi shows the location of each hawks and N represents the size of hawks’ population.

Transition from exploration to exploitation phase

The HHO computes the running energy of the bait (E) using Eq. (3), where T is the maximum number of iteration and E0 is the initial energy. The running energy may be changed the exploration and exploitation.

E=2E0(1iterT) (3)

The E0 varies randomly between [−1, 1] then E is changing from [−2, 2], but it decreases with the iteration increases as in (3). Therefore, if the fleeing energy of prey big (|E| ≥ 1) then the Harris Hawks are searching for fleeing prey (exploration stage), otherwise ((|E|< 1) then the Harris Hawks are trying to hunt the tired fleeing rabbits (exploitation stage).

Exploitation phase

Based on escaping states of the rabbit and different tracking plans of the hawks, four possible solutions have obtained. These solutions have changed by variation of the running energy of the bait and the besiege strategies of the hawks.

The hawks may perform a soft or hard attack to hunt the bait from different path. The “r” describes the running chance of the bait. When the running chance of the bait is less than 0.5 (r < 0.5), the bait escape successfully, otherwise, the bait will be Caught. Moreover, when the running energy of the bait is more than 0.5 (|E| ≥0.5), the HHO performs a soft encircling maneuver, and otherwise, a hard attack is applied by the hawk. It is worth mentioning that a successful running of the bait, not only depends on the escaping energy, but also the running chance is effective parameter. Meanwhile, the process of trapping depends on both the hunt escaping and hawk besiege strategy [14].

Optimization model formulation

There are several methods to optimize the water distribution network (WDN), which is defined in this paper the objective function of the cost reduction approach based on the reduction of the diameters by the permissible pressure in the nodes.

These problems are restrained by specified pressure head for nodes and sometimes specified velocity in pipe flow that can warranty service and secure flow with specified node demand. In this paper, the HHO algorithm is used for the optimization of water supply networks in order to minimize cost by changing pipe size. The equations for optimization can be written as: [24], [25], [26], [27]

Minfcost=i=1npCDi.Li (4)

Subject to:

{QinQout=QeHjHjmin} (5)

In which, C (Di) is the cost for unit length of diameter D for pipe i and Li is the length of pipe i and np is the number of pipes used in the network. Continuity Equation is presented in Eq. (5) displays that the amount of water is being carried into the network should be consumed in nodal demands. There are different formulas for computing head loss and the Hazen Williams equation is one of the best known formulas regularly used for head loss calculation. The Equation used in this paper is Hazen-Williams formula as presented in Eq. (6):

hf=σLCβDγQβ (6)

where, in SI system σ = 10.67, β = 1.85, ɣ= 4.87, Q is the flow (m3/s), C is the Hazen-Williams roughness coefficient which equal 150, D is the diameter of pipe (m), and L is pipe length (m), [25]. Excellent value for σincreases head loss and network needs larger diameter to deliver that amount of water because these can violate requirements for minimum pressure. Therefore, higher value for σ requires a more costly the water distribution network (WDN) design. The algorithm initiates the design process by selecting initial values for calculating design variables. Then, the algorithm checks the pressure head and velocity at each node and pipe and calculates the cost of the network. After processing a model, the pressure of each node is obtained and these values are compared to the allowable limits to compute the penalty functions as equations of (7) and (8):

{HjminHjΔj=0HjHjminΔj=HjminHjHj},j=1,2,...,np (7)

In this way, the objective function is defined by introducing the cost function as:

Fcost=fcost.(1+ε1(Δj)ε2) (8)

Here, the constant parameters are chosen considering the detection and operation rate of the search amplitude. ε1 is set to unity and ε2 choose in a way that it reduces the penalties and the values of the variables, as well. Thus, in the first steps of the search process, ε2 is set to 0.5 and ultimately increased to 1.05.

Simulation

The HHO algorithm is coupled with the water distribution network analyze software, EPANET 2. After analyzing the model by EPANET 2, the pressure for each node and velocity of flow in each pipe are resulted then the values are compared to constraint limits. The software usage process implemented in MATLAB and optimization runs were carried out on a computer. A brief description of the stags that are taken for optimization of network is given below:

  • (1)

    Generate N CPs for starting analysis in MATLAB with random numbers. Each of the CPs is a possible combination of pipelines that indicates network to be solved.

  • (2)

    Compute the network cost for each population and sort them for analyzes mentioned in the HHO algorithm.

  • (3)

    Update the input file of the problem to be solved. In this type of optimization only pipe diameters are changed.

  • (4)

    Processes network using EPANET 2 for determining pipe flow velocities and node pressures.

  • (5)

    Generate penalty function and use it in determining the objective function.

Case study

The Hamashahr network model, which was analyzed by Khalife et al. [28] in Sirjan, is shown in Fig. 2. As well as the Hamashahr network map is shown in Fig. 3. In 2018, Khalife et al. [28] used the Darwin Designer operator in Water Gems software, which was based on a genetic algorithm to optimize Hamashahr's water distribution network in Iran. While, in this article, the new Harris Hawks algorithm (2019) which has a stronger performance for optimization, is used for this purpose. This algorithm has also been used for the first time in optimizing the distribution network.

Fig. 2.

Fig 2

Location of the Homashahr-city in the Kerman Province (Southeastern of Iran).

Fig. 3.

Fig 3

Homashahr network plan layout.

Another difference between this method and the previous method is writing code in MATLAB software, while the previous method of optimizing the water distribution network was done only with the Water Gems software itself.

The cost of available pipe sizes that are determined for consumption in this network are {63, 90, 110, 160, 200, 250, 315; in mm} that cost {0.95, 0.995, 1.066, 1.387, 1.445, 1.725, 2.137; in Dollar/meter}. The characteristics for pipes and nodes are presented and before optimizing in Table 1. The water required in this network is much higher than the accustomed demands for other ones, so for satisfying these demands, the maximum velocity limitation is set to 2 m/s. The pressure limit for nodes are minimum of 55 m and length of pipes are shown in Table 2 [29]. Brief description of the model in the following:

Table 1.

Identification of the city's water distribution network Pipes before to the optimization.

Economic analysis before optimization
Total Cost ($) Cost per meter ($) Length Pipe(m) Diameter(mm)
9918 0.95 10,440 63
5968 0.995 5993 90
8475 1.066 7945 110
5872 1.387 4232 160
6286 1.445 4348 200
1128 1.725 654 250
3450 2.137 1614 315
41,097 Total

Table 2.

Values of used algorithms parameters for problem.

HHO parameter Max iterations Number of variables Number of search agents
Value 6000 3 100

Fig. 2 shows the location of the Homashahr city in the geographical map. Fig. 3 Shows that the Homashahr network plan layout.

Table 1 gives the main characteristics of the city's water distribution network Pipes before the optimization. Table 2 displays the Nodal Pressure head for the Homashahr network. Table 3 describes the objective Values of used algorithms parameters for the problem. Table 4 Show the Economic analysis after optimization with HHO. The Homashahr water distribution systems. Fig. 4 shows to converging in HHO Algorithm.

Table 3.

Economic analysis after optimization with HHO.

Total Cost ($) Cost per meter ($) Length Pipe(m) Diameter(mm)
2831 0.95 2980 63
3133 0.995 3149 90
6783 1.066 6363 110
8957 1.387 6458 160
5001 1.445 3461 200
3822 1.725 2216 250
4981 2.137 2331 315
35,508 Total

Fig. 4.

Fig 4

Nodal heads for Homashahr network.

Results and discussion

The analyses of this paper displayed that the best solution achieved the algorithm presented in this paper achieved the best solution answer for this network, which equals 35,508$ by 6000 iterations. It means convergence speed of this algorithm in achieving the minimum solution answer is good.

Constrain and nodal head pressure is presented in Fig. 4.

The speeds of the algorithm id good enough and it is shown in Fig. 5 that the best costs for the new algorithm can be obtained in lower iterations. The HHO algorithm reached 35,508 (13.6% away from best reached answer) after 600 iterations.

Fig. 5.

Fig 5

Converging in HHO Algorithm.

All analyses of this research for the HHO algorithm are presented in Tables 3 and Figs. 2 to 4.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Contributor Information

Saeid Khalifeh, Email: Khalifeh.saeid@mail.um.ac.ir.

Saeid Akbarifard, Email: Akbarifard_saeid@yahoo.com.

Vahid Khalifeh, Email: vahid.khalifeh@sirjantech.ac.ir.

Ebrahim Zallaghi, Email: ezallaghi@yahoo.com.

References

  • 1.Yıldız B.S., Yıldız A.R. Comparison of grey wolf, whale, water cycle, ant lion and sine-cosine algorithms for the optimization of a vehicle engine connecting rod. Mater. Test. 2018;60(3):311–315. [Google Scholar]
  • 2.Qaderi K., Akbarifard S., Madadi M.R., Bakhtiari B. Vol. 171. Thomas Telford Ltd; 2018, August. Optimal operation of multi-reservoirs by water cycle algorithm; pp. 179–190. (Proceedings of the Institution of Civil Engineers-Water Management). [Google Scholar]
  • 3.Abderazek H., Yildiz A.R., Mirjalili S. Comparison of recent optimization algorithms for design optimization of a cam-follower mechanism. Knowl. Based Syst. 2020;191 [Google Scholar]
  • 4.Yıldız B.S. Optimal design of automobile structures using moth-flame optimization algorithm and response surface methodology. Mater. Test. 2020;62(4):371–377. [Google Scholar]
  • 5.Yıldız B.S. The mine blast algorithm for the structural optimization of electrical vehicle components. Mater. Test. 2020;62(5):497–501. [Google Scholar]
  • 6.Özkaya H., Yıldız M., Yıldız A.R., Bureerat S., Yıldız B.S., Sait S.M. The equilibrium optimization algorithm and the response surface-based metamodel for optimal structural design of vehicle components. Mater. Test. 2020;62(5):492–496. [Google Scholar]
  • 7.Yıldız B.S., Yıldız A.R., Albak E.İ., Abderazek H., Sait S.M., Bureerat S. Butterfly optimization algorithm for optimum shape design of automobile suspension components. Mater. Test. 2020;62(4):365–370. [Google Scholar]
  • 8.Khalifeh S., Esmaili K., Khodashenas S., Akbarifard S. Data on optimization of the non-linear Muskingum flood routing in Kardeh River using Goa algorithm. Data Brief. 2020 doi: 10.1016/j.dib.2020.105398. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Akbarifard S., Radmanesh F. Predicting sea wave height using Symbiotic Organisms Search (SOS) algorithm. Ocean Eng. 2018;167:348–356. [Google Scholar]
  • 10.Madadi M.R., Akbarifard S., Qaderi K. Performance evaluation of improved symbiotic organism search algorithm for estimation of solute transport in rivers. Water Resour. Manage. 2020:1–12. [Google Scholar]
  • 11.Khalifeh S., Esmaili S., Esmaili K., Khodashenas S. Comparison Application of the Symbiotic Organisms Search Algorithm With Meta Heuristic Algorithms in Flood Routing Model. J. Water and Soil. 2020;34(2) doi: 10.22067/jsw.v34i2.85190. [DOI] [Google Scholar]
  • 12.Madadi M.R., Akbarifard S., Qaderi K. Improved Moth-Swarm Algorithm to predict transient storage model parameters in natural streams. Environ. Pollut. 2020 doi: 10.1016/j.envpol.2020.114258. [DOI] [PubMed] [Google Scholar]
  • 13.Akbarifard S., Sharifi M.R., Qaderi K. Data on optimization of the Karun-4 hydropower reservoir operation using evolutionary algorithms. Data Brief. 2020 doi: 10.1016/j.dib.2019.105048. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Heidari A.A., Mirjalili S., Faris H., Aljarah I., Mafarja M., Chen H. Harris Hawks optimization: algorithm and applications. Future Gener. Comput. Syst. 2019;97:849–872. doi: 10.1016/j.future.2019.02.028. https://doi.org/ [DOI] [Google Scholar]
  • 15.Yıldız A.R., Yıldız B.S., Sait S.M., Li X. The Harris hawks, grasshopper and multi-verse optimization algorithms for the selection of optimal machining parameters in manufacturing operations. Mater. Test. 2019;61(8):725–733. [Google Scholar]
  • 16.Kalantary S., Jahani A., Pourbabaki R., Beigzadeh Z. Application of ANN modeling techniques in the prediction of the diameter of PCL/gelatin nanofibers in environmental and medical studies. RSC Advances. 2019;9(43):24858–24874. doi: 10.1039/C9RA04927D. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Kurtuluş E., Yıldız A.R., Sait S.M., Bureerat S. A novel hybrid Harris Hawks-simulated annealing algorithm and RBF-based metamodel for design optimization of highway guardrails. Mater. Test. 2020;62(3):251–260. [Google Scholar]
  • 18.Moayedi H., Nguyen H., Rashid A.S.A. Comparison of dragonfly algorithm and Harris Hawks optimization evolutionary data mining techniques for the assessment of bearing capacity of footings over two-layer foundation soils. Eng. Comput. 2019:1–11. [Google Scholar]
  • 19.Bao X., Jia H., Lang C. A novel hybrid Harris Hawks optimization for color image multilevel thresholding segmentation. IEEE Access. 2019;7:76529–76546. [Google Scholar]
  • 20.Yıldız B.S., Yıldız A.R. The Harris Hawks optimization algorithm, salp swarm algorithm, grasshopper optimization algorithm and dragonfly algorithm for structural design optimization of vehicle components. Mater. Test. 2019;61(8):744–748. [Google Scholar]
  • 21.Golilarz N.A., Gao H., Demirel H. Satellite image de-noising with Harris Hawks meta heuristic optimization algorithm and improved adaptive generalized gaussian distribution threshold function. IEEE Access. 2019;7:57459–57468. [Google Scholar]
  • 22.Ridha H.M., Heidari A.A., Wang M., Chen H. Boosted mutation-based Harris Hawks optimizer for parameters identification of single-diode solar cell models. Energy Convers. Manage. 2020;209 [Google Scholar]
  • 23.Moayedi H., Osouli A., Nguyen H., Rashid A.S.A. A novel Harris Hawks’ optimization and k-fold cross-validation predicting slope stability. Eng. Comput. 2019:1–11. [Google Scholar]
  • 24.Prasad T.D., Walters G.A., Savic D.A. Booster disinfection of water supply networks: multiobjective approach. J. Water Resour. Plan. Manage. 2004;130(5):367–376. [Google Scholar]
  • 25.Sheikholeslami R., Kaveh A., Tahershamsi A., Talatahari S. Application of charged system search algorithm to water distribution networks optimization. Int. J. Optim. Civil Eng. 2014;4(1):41–58. [Google Scholar]
  • 26.Cisty M. Hybrid genetic algorithm and linear programming method for least-cost design of water distribution systems. Water Resour. Manage. 2010;24(1):1–24. [Google Scholar]
  • 27.Fujiwara O., Khang D.B. A two‐phase decomposition method for optimal design of looped water distribution networks. Water Resour. Res. 1990;26(4):539–549. [Google Scholar]
  • 28.khalife S., esmaili K., khalife H. 'Optimization of water distribution systems by maximizing the profit'. J. Water and Wastewater Sci. Eng. 2018;3(2):35–43. doi: 10.22112/jwwse.2018.128930.1083. [in Persian] [DOI] [Google Scholar]
  • 29.Sheikholeslami R., Zecchin A.C., Zheng F., Talatahari S. A hybrid cuckoo–harmony search algorithm for optimal design of water distribution systems. J. Hydroinform. 2016;18(3):544–563. [Google Scholar]

Articles from MethodsX are provided here courtesy of Elsevier

RESOURCES