Use of Honey-Bee Mating Optimization Algorithm to Design Water Distribution Network in Gurudeniya Service Zone, Gurudeniya, Sri Lanka

Water distribution network (WDN) is a highly complex urban infrastructure that is intended to supply water from source node to consumer nodes. As far as the components of an infrastructure are concerned, the interconnecting pipes that transport water from source node to the demand nodes account for the major fraction of the capital cost. Therefore, when designing WDN, the primary concern is on finding the optimal combination of pipe diameters that satisfies the hydraulic-head requirements at minimum cost. More recent methodologies employ direct heuristic and stochastic heuristic algorithms for the design of WDN. In this study, the use of Honey-Bee Mating Optimization (HBMO) stochastic algorithm for the design of WDN in the Gurudeniya Service Zone, Gurudeniya, Sri Lanka, has been examined. In-built hydraulic constraints have enabled the algorithm to deliver results without needing a separate hydraulic simulation software in this design. The solutions given by HBMO algorithm and the solution implemented by National Water Supply and Drainage Board, Sri Lanka have been compared. From the implementation of the HBMO algorithm, results show that the HBMO algorithm is successful in addressing the WDN design problem with given hydraulic constraints for Gurudeniya Service Zone.


Introduction
Water distribution network is an infrastructure that is intended to collect, transmit, treat, store, and distribute water for homes, commercial establishments, industry, and irrigation, as well as for such public needs as firefighting and street flushing. Of all municipal services, provision of potable water is considered to be the most vital department. People depend on a water supply system for drinking, cooking, washing, carrying away wastes, and other domestic needs. Water supply systems shall comply with the requirements for public, commercial, and industrial activities. In all cases, the water delivered through the system must fulfill both quality and quantity requirements [12].
Water utilities seek to provide customers with a safe, reliable, continuous supply of high quality water while minimizing costs. Water is often delivered through a complex distribution system involving miles of pipe and often incorporating numerous pumps, regulating valves, consumer nodes and storage reservoirs. The performance of these systems is often difficult to be understood due to its physical size and complexity and presence of large amount of system information and data when determining its function.
Therefore, analyzing and modeling of these water distribution systems are essential to meet the goals of delivering safe, reliable water supply at optimal cost. Network analysis is critical for proper operation and maintenance of a water supply system. [3].
In practice, the conventional way of designing a water distribution network is manual analysis by making an educated guess for the least cost combination of pipe diameters.
In the recent past, the rise of water simulation software, such as WaterGEMS, WaterCAD, and EPANET, has enabled WDN design engineers to design water distribution networks with relatively less effort. However, a globally accepted right way of determining optimal combination of pipe diameters, especially for a large scale water distribution network, is still a subject of research due in part to the complexity of the problem. A small change in the combination of pipe diameters will result in a large change in the capital that has to be invested in the project implementation [11].

Literature Review
Due to these issues, instead of making educated guesses for optimal combination of pipe diameters, notable amount of research shows that WDN design engineers and analysts have started employing direct-heuristic and stochastic-heuristic algorithms for the design of water distribution networks.
Noticeable studies that have used direct methods include the works done by Alporevits and Shamir [1], Suribabu [10], Lin et al. [7], Hsu and Cheng [6], Mohan and Babu [8], and Awe et al. [2]. As far as the general direct method criterion to determine pipe diameters of WDN is concerned, initially, all the pipes in the network have been set to their minimum discrete commercially available size, and the network has been simulated to determine the pressures at all the nodes in the network. The hydraulic simulations, alongside with the proposed algorithm, have been carried out with a hydraulic simulation software. If the minimum pressure requirements have not been satisfied in a node, the pipe exhibiting the maximum velocity has been increased to next commercially available size. Then the network has again been simulated to determine the pressure and flow velocity. Identification of maximum flow velocity in a pipe and increasing its size has been continued until the pressure head at all the demand nodes has exceeded the corresponding minimum required. At the end of this process, a feasible solution to the network has been obtained. The pipes for which the diameter has been more than required should have been replaced with smaller diameters to achieve the cost effective design. Hence, at the second stage, each pipe diameter has then been reduced to the next available size based on the selection indices proposed according to the study, until the pressure head at any one node has approached the minimum required. It is noticeable that, these general direct methods have been applicable where the shape of the objective function has been known with respect to the set of decision variables (i.e. diameters). On the other hand, as a drawback, if the shape of the objective function is unknown, these direct methods become partly misleading when aiming for a global optimal solution.
On the contrary to the direct methods, the stochastic methods employ a search procedure over the entire solution space. When picking a solution whose objective function to be evaluated, the stochastic algorithms use probabilistic rules inspired mostly by the biological or any other natural phenomena. The applicability even with the complex non-linear problems, not-needing to identify the shape of the objective function (i.e. convex, concave etc.), are some of the benefits of these stochasticheuristic algorithms. A few recent studies that use stochastic algorithms such as, Simulated Annealing Approach by Cunha and Sousa [4], Genetic Algorithm (GA) by Dijk et al. [5], and Honey-Bee Mating Optimization (HBMO) by Mohan and Babu [9], have been carried out to check their performance upon given WDNs. Further, in the study done by Mohan and Babu [9], it has been systematically proven the efficacy of the HBMO algorithm over the other well-established stochastic algorithms by making use of the number of iterations taken to reach the optimal solution as a basis of evaluation.
In this study, the use HBMO algorithm for the design of WDN of Gurudeniya Service Zone, Gurudeniya, Sri Lanka, has been examined. The basic structure of the HBMO algorithm was adopted from Mohan and Babu [9]. To preserve the simplicity of the algorithm, it was updated with the change of the omission of the Nurse bees' mutation process. Further, comparison of solutions given by HBMO algorithm to the solution implemented by National Water Supply and Drainage Board (NWSDB), Sri Lanka, has been examined.
In the following sections, methodology and analysis, followed by the results and discussion, are presented. The conclusions made in the study are given towards the end of the paper.

Methodology and Analysis
In this section, the terminology in the study, mathematical model formulation, and adaptation of HBMO algorithm for the WDN design of Gurudeniya Service Zone are written explicitly. A description of the type of data used in the study is given at the latter part of this section.

Terminology • Water pipe:
A water pipe is a component for conveying water from source node to consumer demand nodes. This can be in meter scale or in kilometer scale.
• Consumer node or demand node: This is a point from which water is taken out of the water distribution network. These nodes could be housing units, factories, or any other establishment that draws water from the water distribution network.
• Serial/looped pipe configuration: A serial pipe configuration is a WDN configuration where all the pipes in the network are connected in series, whereas a looped configuration has at least one loop of pipes connected.
• Water source or reservoir or tank: This is a source point by which water supplier distributes water through the network to the consumer nodes. Usually, this source point is chosen to be at a higher elevated place. An advantage of the source point being at a high elevated place is that the water can then be sent through the distribution network by the use of earth's gravitational pull. This kind of flow is commonly known as gravity flow. Pumps may be used when the water pressure at consumer nodes is not significant with the only use of gravity flow.

Optimization Model Formulation
The objective function of the design of water distribution network is defined as, where, = number of pipes in the water distribution network; ( , ) = cost of the i th pipe having diameter D and length L.
The hydraulic constraints to be satisfied while minimizing the objective function are, where, = flow in the ℎ pipe; = demand in the ℎ node; = nodal water head at ℎ node; = residual water head available at the ℎ node; = nodal elevation (from mean sea level MSL) at ℎ node; = minimum residual water head required at the ℎ node; = number of demand nodes; and = number of pipes.
The friction of a pipe is calculated using the Hazzen's Williams Formula as follows.
where, ℎ = friction loss in the ℎ pipe; = fitting loss coefficient; = Hazzen's Williams Coefficient = total friction loss of the ℎ pipe; and = length of the ℎ pipe.

Honey-Bee Mating Optimization (HBMO) Algorithm 3.3.1
Biological Basis of Honey-Bee Colony A honey-bee colony is composed of queens, drones, and workers or nurses. Division of labor, individual and group level communications, and cooperative behavior are the strange features of the honey-bee colony. The number of queen bees in a colony may be either one (monogynous) or many (polygynous).
Queens are the main reproductive sources of the honey-bee colony. Drones (the male bees) are fathers of the colony. The role of a drone is to inject its sperm into queen's spermatheca. The nurse bees take care of broods' growth and do not involve in the process of reproduction. As a honey-bee colony is concerned, the mating process begins with the queen bee's mating flight and its travel far away from the nest. At the beginning of the mating flight, the queen's speed is very fast and the speed gradually gets reduced as the mating process is progressing. During the mating flight of the queen, swarm of drones follow the queen bee and mate with the queen in the air. The queen bee can have several number of matings with different drones even in a single mating flight. But a drone's life ends up with a single mating. Eventual death of the drone indicates the successful insemination. The sperms accumulated in the queen's spermatheca create a genetic pool for the new colony to be born. The queen starts off a mating flight with an empty spermatheca, but by the time of coming back to the nest, its spermatheca is filled with accumulated sperms, either fully or partially. After a mating flight, the queen bee turns onto fertilize the eggs by retrieving the sperms accumulated in the spermatheca.

Adoptation of Biological Behavior of Honey-Bees for the Computational Purpose
For the execution of HBMO algorithm, the number of queens and drones need to be fixed in the beginning. The parameters associated with the queens that require pre-specification are maximum number of broods that can be produced after a mating flight, spermatheca size, initial speed, speed reduction factor and the maximum number of mating flights. Each honey bee in a colony represents a trial in the solution space. This point onwards, the words honey bee and solution are used synonymously. To begin the search, the ancestors of the honey-bee colony need to be initialized. The individuals are represented by the string of genes and the string length is equal to the number of decision variables. The genes of the individuals can be represented by binary coded or real coded values. To initialize the gene values, it can be assigned at random from the available discrete set of choices available in the list.
After initialization, the fitness of the individuals has to be evaluated. For minimization problems, the inverse of the objective or cost function value can be taken as the fitness of a honey bee. As analogous to the real honey-bee colony, the solution with more fitness value would act as queen.
The queen sets off the mating flight with an empty spermatheca and with a high initial speed. The mating flight can be treated as a set of transitions in a state space -the environment -where the queen moves between the different states in some speed and mates with the randomly selected drones one by one. The mating can take place only when the probabilistic rule of mating described in the equation (10)  After each transition in the space, speed of the queen gets reduced as per Equation (11).
To replicate the death of a drone after insemination, the solution which represents the drone that successfully mates with the queen bee has to be removed from the drone population. The mating process of a queen can hold on until the spermatheca gets filled with sperms or the speed falls below the threshold value. The mating flight is postulated for all the queens if there exists more than one queen.
After the mating flight, the new broods can be brought forth by coupling the queen's and drone's genes. In HBMO, the function of nurse bees is limited to brood care only as the new broods arise only from the queen's eggs. After bringing forth the specified numbers of broods, the objective function requires to be evaluated to subsequently compute the fitness values of the broods. The broods with higher fitness values than current queens' fitness, have to be replaced as queens of the next generation. The routine of mating flight and subroutine of brood generation need to be continued until the termination criteria is met. The termination criteria may be either arrival of maximum number of mating flights or no more improvement in solution over certain number of mating flights. The pseudo-code of this algorithm is presented in Figure 1.

Individual Representation
The number of genes in an individual is taken as the number of decision variables involved in the problem. That is, the number of pipes, whose diameters need determining, can be taken as the number of decision variables for a particular problem. For demonstration, the set of genes of a queen bee for an eight-variable problem can be represented as follows: where Q1 to Q8 are the genes of the queen. The gene values of the individuals have to be initialized from the list of discrete variables at random.
The set of genes of a drone bee for an eightvariable problem can be represented as follows:

Figure 1 -Pseudo-Code of the HBMO Algorithm [9]
The set of genes of a brood bee for an eightvariable problem can be represented as follows:

3.3.4
Crossover Operation -Single-Point Crossover A single cutoff point has to be selected at random. For the brood's string, drone's genes have to be placed up to the cutoff point, after that the queen's genes have to be placed.
where, NP, NPF, PP, and PPF denote nodal penalty, nodal penalty factor, pipe penalty, and pipe penalty factor, respectively. The solutions which do not satisfy the minimum hydraulichead constraint and maximum friction loss constraint, are penalized in proportion to the hydraulic-head deficit ( − ) and excess friction loss (ℎ − ℎ ) values, as mentioned in Equation 12 and Equation 13, respectively.

Figure 2 -Random Cut-off Point Selection in the Queen's and the Drone's Genes [9]
The random cut-off point selection is illustrated in Figure 2. As shown in Figure 2, B1, B2, B3, B4, B5, B6, B7 and B8 are the genes of a brood. The shaded boxes show the part of the string formed by the queen's genes.

3.4
Adapting the HBMO for the Designing of WDN The procedure in which the HBMO was used for the optimal WDN design is presented in Figure 3. In order to begin the implementation of the algorithm, the WDN parameters, such as source head, nodal elevations and demands, minimum hydraulic-head value to be maintained at the demand nodes, maximum allowable friction loss gradient, pipe layout, length of the individual pipes, commercially available pipe sizes, and unit cost associated with the commercial pipes are fed to the model. After specifying these parameters, the initial colony of honey-bees, also known as set of ancestors, is generated. To evolve the ancestors, the gene values are assigned from the list of commercially available pipe sizes. After initialization, the queen is selected at random from the initial colony. A penalty is added with the objective function value of the solutions that do not satisfy the minimum hydraulic-head constraint. Similarly, another penalty is added with the objective function value of the solutions that do not satisfy the maximum friction loss gradient. The penalty values added for the constraint violation are modeled through equations: Once the initial colony of honey bees are generated, the mating flight of the queen-bee begins. During the mating flight, the queen mates with the drones that are randomly selected from the drone population only when the probabilistic rule of mating gets satisfied.
Then, the queen starts to fertilize the eggs through crossover process. The fitness values of some of the newly born broods might be higher than that of the current queen. If a better brood appears, replacement of the queen by the brood with better fitness is carried out. The processes of mating flight, new brood generation, and replacement of the queen are continued until either the maximum number of mating flights or no improvement in solution over the prespecified number of mating flights can be observed.

Gurudeniya Service Zone, Gurudeniya, Sri Lanka
The Honey-bee Mating Optimization (HBMO) algorithm was tested using the water distribution network of Gurudeniya Service Zone, Gurudeniya, Sri Lanka.

Figure 3 -Flowchart for the Design of Water Distribution Network using Honey-Bee Mating Optimization (HBMO) Algorithm [9]
The data set consisting of pipe layout, pipe lengths, nodal water demands, nodal elevations and reservoir (source) elevation data were obtained from National Water Supply and Drainage Board (NWS&DB), Sri Lanka. The schematic layout of the main pipe trunk, that has a serial pipe configuration, has been shown in Figure 4. As shown in Figure 4, P1,P2,P3,…,P10 are the supply pipes. N1, N2, N3,…, N10 show consumer nodes and R1 shows the reservoir or source node. Lengths of pipes of the WDN are shown in Table 1. Nodal water demands and nodal elevations are shown in Table 2.
The list of commercially available pipe sizes and their unit costs (adapted from Cunha and Sousa [4]) are shown in Table 3. The elevation at the reservoir node has been taken to be 555m. Depending on the material of the pipes present in the WDN, Hazen William's coefficient was selected to be 130 for all the pipes.

Assignment of Values for the Parameters in the Algorithm
The initial step when implementing HBMO was to evolve the ancestors. For this, the genes of individuals were assigned from the randomly selected pipe sizes.  The number of genes of an individual was made equal to the number of pipes in the system. Therefore, for Gurudeniya WDN, each honey-bee was provided with ten number of genes for each. The analysis was carried out for a combination of one queen-bee and 499 drones. The number of mating flights was selected to be 1000. The spermatheca size of the queen-bee was selected as 100. The initial speed and the speed reduction factor were taken as 2 and 0.95, respectively. The threshold probability of the queen-bee to mate with a drone was selected as 0.01. In this state of the study, the Pipe Penalty Factor was kept constant, and only the Nodal Penalty Factor was varied to check its effect on the solution. At each of the nodes, the minimum residual head ( ) required was set to 10 m, while the maximum friction loss (ℎ ) allowed was set to 0.005 m/m, as per the design standard adapted at NWS&DB, Sri Lanka.

Results and Discussion
Solutions that were obtained for six trials are shown in  Cost has risen to a relatively high value. It can be undeniably observed that, when the Nodal Penalty Factor is in close proximity to 5000, the cost of solution by the algorithm has gone below the cost of the solution NWS&DB has used in project implementation. Therefore, it can be promising that, with the use of HBMO algorithm, more solutions could be obtained whose costs are below the cost value of NWS&DB implemented solution.

Conclusions
In this study, the use of Honey-Bee Mating Optimization (HBMO) for the design of WDN in the Gurudeniya Service Zone, Gurudeniya, Sri Lanka, has been examined. From the implementation of the HBMO algorithm, it could be observed that the HBMO algorithm is successful in addressing the WDN design problem with given mathematical constraints.
In-built hydraulic constraints have enabled the algorithm to deliver results without needing a separate hydraulic simulation software in the design. The comparison of results given by HBMO algorithm to the solution implemented by NWS&DB shows that the HBMO algorithm not only gives feasible solutions, but also gives solutions that have lower costs involved when compared with NWS&DB implemented solution. It should be noted that, although this study has used the unit costs involved with the pipes, the true costs could be significantly high, depending on the value of a monetary unit concerned. Moreover, having proven the applicability of the HBMO algorithm for serial pipe configuration in Gurudeniya Service Zone, authors recommend further research on checking the applicability of the same algorithm on looped pipe configuration.