Optimization of Water Distribution Networks Using Genetic Algorithm Based SOP–WDN Program

: Water distribution networks are vital hydraulic infrastructures, essential for providing consumers with sufﬁcient water of appropriate quality. The cost of construction, operation, and maintenance of such networks is extremely large. The problem of optimization of a water distribution network is governed by the type of water distribution network and the size of pipelines placed in the distribution network. This problem of optimal diameter allocation of pipes in a distribution network has been heavily researched over the past few decades. This study describes the development of an algorithm, ‘Smart Optimization Program for Water Distribution Networks’ (SOP–WDN), which applies genetic algorithm to the problem of the least-cost design of water distribution networks. SOP–WDN demonstrates the application of an evolutionary optimization technique, i.e., genetic algorithm, linked with a hydraulic simulation solver EPANET, for the optimal design of water distribution networks. The developed algorithm was applied to three benchmark water distribution network optimization problems and produced consistently good results. SOP–WDN can be utilized as a tool for guiding engineers during the design and rehabilitation of water distribution pipelines.


Introduction
A water distribution network (WDN) is comprised of various elements, such as reservoirs, pumps, pipes, tanks, and valves. Around 80% of the total cost of a water supply project is invested in its water distribution system [1]. Hence, the design of a cost-effective and reliable water distribution network is a must. Optimization of the WDN involves the design of a reliable, efficient, and cost-effective distribution network that fulfils the necessary water demands, while maintaining adequate pressure heads. This is crucial for conservation of water resources, as well as for reducing energy requirements and maintenance costs. Optimization of WDNs can be categorized into many types, viz. design, operation, calibration, level-of-service, monitoring system and network testing. This paper deals with determining the optimal diameters of pipelines in a water distribution network with a predetermined layout.

Background and Related Work
Over the years, numerous researchers have presented many different methods for obtaining the optimal solution to the pipe network optimization problem. The Hardy cross method is considered as the oldest method for solving a pipe network. In this method, at any pipe junction, the algebraic sum of flow must be zero, and the algebraic sum of pressure drops at any loop must also be zero [2]. This method was improved upon by many other researchers. Alperovits and Shamir [3] proposed one of the most significant approaches for solving the problem of water distribution network design by utilizing the successive Linear Programming Gradient (LPG) method. This method was adopted and further expanded upon by other researchers [4,5].
However, deterministic methods, such as linear programming and non-linear programming, presented drawbacks, such as entrapment in local minima, and dependence on the starting point. Hence, they failed to obtain near optimal solutions for complex, multi-objective, real-world pipe network problems. It is crucial to escape local minima [6] and to overcome these drawbacks, researchers began to utilize meta-heuristic algorithms (genetic algorithms, simulated annealing, etc.) for water network design problems. These techniques include algorithms having some stochastic components. Goldberg and Kuo introduced stochastic methods for the optimization of water distribution networks using the principles of natural selection and genetics [7]. Simpson et al. used simple genetic algorithms (GA), and obtained a near optimal solution [8], while Simpson et al. [9] compared the GA technique with other methods, such as complete enumeration and non-linear optimization, and concluded that the GA technique generates multiple alternative solutions that are both practical and close to the optimum. The results obtained by Simpson et al. [8] were further improved upon by Dandy et al. [10] using the concept of variable power scaling of the fitness function, an adjacency mutation operator, and gray codes. Savic and Walters developed the computer model GANET [11] that utilizes GA for the least-cost design of pipe networks.
To avoid unfeasible solutions due to the violation of constraints, a penalty factor is necessary during the selection process of GA. Deb and Agrawal [12] developed a nichedpenalty method to more effectively solve constrained optimization problems using GAs. Wu and Simpson [13] demonstrated significant improvements in efficiency and robustness for single-objective optimization utilizing a boundary search method. Liong and Atiquzzaman used the shuffled complex evolution (SCE) linked with EPANET hydraulic network solver [14] to obtain the least cost of some well-known water distribution networks in the literature. SCE was demonstrated to be a potential alternative to other optimization algorithms, due to its faster computational speed. Other algorithms, such the shuffled frog-leaping algorithm (SFLA) by Eusuff [15] and the harmony search Algorithm (HS) by Geem [16], have obtained comparable results, and have proven to be effective tools for the optimal design of water networks.
Some studies consider a single economic objective (least-cost) to formulate the network optimization and rehabilitation problem, whereas others consider a multi-objective optimization approach that compares interesting trade-offs (e.g., a slight pressure deficit can sometimes be outweighed by substantial cost reduction) [17]. To improve network reliability, Chandramouli and Malleswararao [18] used fuzzy logic based on the excess pressure available at demand nodes. Jin et al. analyzed additional objectives, such as considering both pressure and velocity violations [19]. Prasad and Park utilized genetic algorithms and considered both minimization of cost and maximization of network reliability [20]. More recent developments include improving algorithm convergence by using an engineered initial population, rather than a random one [21]; improvement of computational efficiency via the reduction of search space [22]; combining GA and mathematical programming with the inclusion of new elements such as pressure reducing valves [23]; using artificial neural networks (ANNs) rather than hydraulic and water quality simulation models together with differential evolution (DE) for optimization [24]; developing the Harris hawks optimization algorithm (HHO) for WDN optimization [25].
Additionally, Bilal and Pant utilized a hybrid metaheuristic algorithm (FA-PSO) [ [28] for least cost design of benchmark distribution networks. Surco et al. utilized a modified particle swarm optimization (PSO) algorithm for the optimization of distribution networks [29]. Cassiolato et al. proposed a deterministic mathematical programming approach without utilizing hydraulic simulators for cost minimization of looped WDNs, where generalized disjunctive programming is used to reformulate the discrete optimization problem to a mixed-integer nonlinear programming (MINLP) problem [30]. Pant and Snasel proposed a fuzzy C-means adaptive differential evolution (FCADE) for optimizing well-known benchmark WDN problems [31]. Bi et al. compared the searching behavior of evolutionary algorithms on water distribution system design optimization [32]. Zhao et al. proposed an in-sync optimization model for network layout and pipe diameter determination of a self-pressurized drip irrigation system [33]. Shao et al. utilized genetic algorithm for optimal placement of flow meters and valves in a distribution system [34].
Moreover, many researchers have considered operational optimization of WDNs, since minimization of operational energy costs during pumping must also be accounted for together with the construction costs. Electricity consumption during operation is one of the biggest marginal expenditures for water utilities [35]. Operational optimization can be achieved by controlling times when pumps operate, also called pump scheduling [36,37], flow rates [38], pump speeds [39] and tank-water trigger levels [40]. Furthermore, other factors such as real-time control and water quality can also be considered [41][42][43]. Metaheuristics such as GA have been abundantly utilized for operational optimization of WDNs, primarily with the objective of minimizing the overall cost of the pumping operation [44][45][46]. Research works in optimization of WDNs have been comprehensively reviewed by Mala et al. for design and rehabilitation [47] and system operation [35]. GA have also been abundantly applied for optimization in multiple fields of research [48][49][50]. Katoch et al. [51] have elaborated the advancements made in the field of GA.

Problem Formulation
Cost-effective WDN design is a discrete optimization problem, as the individual pipe sizes are to be selected from a list of available commercial size diameters. The search space can be determined as the number of available diameters, raised to the power of the number of pipes in the network [52]; e.g., if 8 different commercial pipe sizes are available for the design of a WDN having 10 pipelines, the search space size would be 8 10 , i.e., 1,073,741,824 different pipe combinations. Hence, even for a relatively small pipe network, the search space is large. The design of an economically optimal water distribution network is a difficult task, because it involves solving many complex, nonlinear, and discontinuous hydraulic equations, while simultaneously optimizing pipe sizes and other network components [53,54].
Optimization of a water distribution network aims to find the optimal pipe diameters in the network for the given layout and demand requirements. The optimal pipe sizes that satisfy all implicit constraints (conservations of mass and energy), and explicit constraints (hydraulic and design constraints) are selected in the final network.
The continuity equation is given as: The continuity equation is applied to each node, with q i being the flow rate (flow into and flow out of the node), and n is the number of pipes connected at the node.
The energy equation is given as: The energy equation is applied to each loop in the distribution network, where h i is the head loss in each pipe, and m is the number of pipes in the loop.
The objective function is the total cost of the given network. The total cost C T is calculated as: where, N p is the total number of pipes, C i (D i ) is the cost per unit length of pipe i with diameter D i , and L i is the length of pipe i. The objective function is to be minimized under the implicit constraints and explicit constraints. The head loss is the sum of the local head losses and the friction head losses. The equation used to calculate the head loss is the Hazen-Williams equation. This equation is an empirical equation that relates the flow of water in a pipe with the physical properties of the pipe and the energy loss due to friction. The Hazen-Williams coefficient, abbreviated as C, is a dimensionless number used in the Hazen-Williams equation [55]. The equation can be expressed as: where, h f is the head loss, Q is the flow rate, C is the Hazen-Williams coefficient, D is the pipe inside diameter, and L is the pipe length.

Genetic Algorithm
A genetic algorithm (GA) is a search algorithm based on the mechanics of natural selection and natural genetics [56]. Although stochastic at certain aspects, a genetic algorithm is not entirely random, as it utilizes historical information to determine new search points. GAs have been widely utilized to solve optimization problems in multiple fields [57]. Following the concept of 'survival of the fittest', improvements in solutions evolve from past generations, until a near optimal solution is obtained. In genetic algorithms, the candidate solutions are represented by chromosomes (e.g., binary strings), and are collectively known as the population. The chromosomes are then evolved in each subsequent generation, according to their fitness. The fitness evaluation of each candidate solution depends upon how well it the meets the requirements of a pre-defined objective function (e.g., lowest cost). The more fit the candidate solution, the greater probability it will have of being selected for reproduction. Hence, the more fit chromosomes replace the less fit chromosomes, and the process continues until a near optimal solution is found.
The general idea of GA in a pipe network optimization problem is to select a population of initial solution points, scattered randomly in the optimization space, and then converge iteratively to better solutions, until the desired criteria for stopping are achieved. The steps for using GA for pipe network optimization can be briefly described as follows [8]:

Generation of initial population
The GA randomly generates an initial population of coded strings (binary) representing pipe network solutions of population size N. Each of the N strings represents a possible combination of pipe sizes.

Computation of network cost
For each N string in the population, the GA decodes each substring into the corresponding pipe size and computes the total network cost (material cost, construction cost, etc.).

3
Hydraulic analysis of each network A steady state hydraulic network solver computes the heads and discharges under the specified demand patterns for each of the network designs in the population. The actual nodal pressures are compared with the minimum allowable pressure heads, and any pressure deficits are noted. Similarly, the actual water velocities at pipes are compared with the desired velocity of the water distribution network and any deviation in velocity are also noted.

Computation of penalty cost
The GA assigns a penalty cost for each individual network design in the population if a pipe network does not satisfy the pressure and velocity constraints (for example, pressure violation at a particular node if the pressure in the node is less than or greater than the desired pressure).

Computation of total network cost
The total cost of each network in the current population is then taken as the sum of the network cost (Step 2) and the penalty cost (Step 4).

Computation of the fitness
The fitness of the coded string is taken as some function of the total network cost. For each proposed pipe network in the current population, fitness can be computed as the inverse or the negative value of the total network cost (Step 5).

Generation of a new population using the selection operator
The GA generates new members for the next generation by a selection scheme that depends on the fitness of the initial members.

The crossover operator
Crossover occurs with some specified probability for each pair of parent strings selected in Step 7. A uniform type of crossover operator is commonly used to accompany the comparatively large string size for pipe network optimization.

The mutation operator
Mutation occurs with some specified probability of mutation for each bit in the strings that have undergone crossover. The purpose of the mutation operator is to maintain genetic diversity from one generation of a population to another.

Production of successive generations
The use of the three operators described above produces a new generation of pipe network designs using Steps 2 to 9. The GA repeats the process to generate successive generations. The final costs and pipe network designs are stored, and the cheaper cost alternatives that meet the required constraints are updated.

EPANET
EPANET is a hydraulic simulator that can perform extended hydraulic and water quality simulations for pressurized water distribution networks (Rossman, [58]). Generally, a water distribution network consists of many elements, such as pipes (links), pipe junctions (nodes), pumps, control valves, and tanks/reservoirs. EPANET solves the water distribution network for the flow of water in each pipe, pressure at each junction, water height in each tank, concentration of chemical species, etc. During the hydraulic analysis of the water distribution network, EPANET solves both the conservation of mass and energy equations.
EPANET-MATLAB Toolkit is a software for interfacing a drinking water distribution system simulation library, EPANET, with the MATLAB technical computing language developed by Eliades [59]. The Toolkit allows users to access EPANET and EPANET-MSX through their shared object libraries, as well as their executables. EPANET can be called and used through a programming interface by an external software, which can be written in different programming languages (such as C/C++, Python, or MATLAB). Generally, a large number of commands have to be written to achieve specific results, such as extracting the node pressures, pipe diameters, pipe roughness coefficients, or specifying demand patterns. However, in the EPANET-MATLAB toolkit, a significant part of the repetitive code is already included in the toolkit functions and can be used directly.

SOP-WDN
Smart optimization program for water distribution networks (SOP-WDN) is an algorithm that has been developed by Smart Water Grid (SWG) research works for water distribution network optimization by using a genetic algorithm. The algorithm is written in MATLAB programming language. It interfaces with EPANET-MATLAB toolkit [59] (hydraulic solver integrated within SOP-WDN) for steady state hydraulic simulation and solution. The algorithm imports the network layout and data from EPANET. Design parameters, such as available pipe sizes, respective cost of pipes, roughness coefficient, and required pressure and velocities for the network, are to be added. GA optimization parameters, such as population size, crossover probability, and mutation rate, are prerequisites for the algorithm, and can be set by the user. Figure 1 shows a flowchart of the overall algorithm:

Encoding Scheme, Interpretation and Redundancy
A sequence of binary numbers is used to represent a water distribution network in SOP-WDN, as it enables a relatively extensive exploration of the search space. The coding scheme is also simple in implementation for the given task. Reflected binary code (RBC) or grey ode is utilized since it assures that two successive values differ by only one bit (binary digit). The number of bits required to represent an individual pipe in the network depends upon the number of available pipe diameters. The total binary sequence represents the entire pipe network. An example for the process of interpretation of a water distribution network by the algorithm is demonstrated.
Consider, a water distribution network having 1 reservoir, 1 tank, 5 demand nodes and 6 pipelines (all 100 m in length); there are 8 available pipe sizes for this network as shown in Table 1. As there are 8 available pipe sizes in the example, the number of bits required to represent each individual pipe is 3 bits (starting from 000 to 100).
Any 18-character-long binary string can, hence, represent all 6 pipelines in this distribution network. Consider a randomly generated binary string of length 18 (exe. 101110011001000111). Since there are 6 pipes in the distribution system layout, the generated binary string of length 18 can be divided into six binary strings, each a length of 3 bits. Each binary string of 3 bits then represents a unique pipe size and the position of that binary string represents the position of the pipe in the overall network layout. The resulting pipe network and its respective cost can be obtained as shown in Table 2 and the network layout can be visualized as shown in Figure 2.  When a parameter belonging to a finite discrete set is encoded with binary notations, some of the codes may become redundant. For example, consider the design of a water distribution system where the number of commercially available diameters is 13. In this case, a minimum of 4 bits are required for coding the elements of the set of diameters, and this gives 2 4 = 16 discrete values. With 13 diameter options, three of the substrings become redundant (do not represent any diameters). The challenges of dealing with redundant binary codes have been overlooked in the literature and in published methods [60]. Saleh and Tanyimboh proposed representing redundant codes with closed pipes of fictitious diameters and low fitness values, assuming their extinction through evolution and natural selection [61]. However, this approach was found to prematurely lose valuable genetic information.
Alternatively, the redundant codes may be mapped to valid codes. In this case, some diameter options will be represented more than once. The mapping options may be fixed or random. In fixed mapping, the redundant codes are assigned to valid pipe diameter options prior to optimization. Random mapping assigns the redundant codes to the valid diameter options randomly. Tanyimboh [62] observed that, during mapping, over-representation of the largest pipe diameter performed better than over-representation of the smallest pipe diameter. It was also overserved that a balanced, unbiased allocation achieved good results. SOP-WDN handles redundant mapping by linearly scaling the probability of allocation of pipe diameters prior to optimization, where the largest pipe has 2 times the allocation chance than the smallest.

Genetic Algorithm Operators
Genetic algorithms differ from conventional optimization algorithms and search procedures as they work with a coding of the solution set and not the solutions themselves [56]. GA mainly consists of four basic operators: selection, crossover, mutation and elitism and utilizes these operators together to produce new generations.

Selection
Selection is a crucial step in GA that determines whether a particular candidate will participate in the reproduction process or not. The selection operators give preference to the fitter chromosomes (candidate solutions), allowing them to pass on their 'genes' (information) to the next generation. Hence, worse chromosomes (with poor fitness) get eliminated. SOP-WDN algorithm computes fitness of an individual as the reciprocal of (the total cost times the imposed penalty). The selection operator then randomly picks chromosomes out of the population according to fitness. Roulette wheel, rank, and tournament selection are well-known techniques for selection and are commonly utilized in the literature.
In general, the probability of selection of an individual is calculated as the fitness values of the individual divided by fitness value of the population. Selection pressure is defined as the degree to which the better individuals are favored in the population; it drives the GA into improving the fitness over successive generations. In this study, power-law based probability selection was utilized, where P(i) is the preserved probability based on rank of the ith ranked individual (ranked based on fitness) in the population a having total of n individuals. The value of τ = 1.1 ∼ 1.2 (controlling selection pressure) was found ideal after numerous simulations.

Crossover
Crossover is a genetic operator that combines two chromosomes (parents) in order to produce new chromosomes (children). Some common crossover techniques utilized in the literature are one-point crossover, two-point or k-point crossover, uniform crossover, shuffle crossover, three-parent crossover. In one point crossover, a crossover point is selected at random through the length of the chromosome. Summation of genes from the first parent, put before crossover point and second parent after the crossover point creates the new child. In two-point or k-point crossover, genetic material is exchanged between two or more random positions along the length of chromosome. Uniform crossover operates in individual genes of the selected chromosome, rather than on blocks.
Since GAs are problem specific, crossover is applied considering the chromosomes as group of distribution pipelines. Here, change of any single gene in a chromosome means changing and replacing the current pipe with another one of a different diameter. It is preferred to alter and test many different pipe combinations when searching for the optimal solution. After experimenting with varying crossover operators, k-point crossover was selected as the preferred crossover method. The number of crossover points is taken as (0.8 × N p ) rounded to the nearest integer, where N p is the total number of pipelines in the distribution system. The locations of crossover points are taken randomly. For example, the number of crossover points for a distribution network with 6 pipes is shown in Figure 3. The higher mixing ratio showed faster convergence. Uniform crossover also showed good results whereas the worst results were obtained from one-point crossover. The applied crossover probability was 85-90%.

Mutation
After crossover, the chromosomes are subjected to mutation. Mutation prevents the algorithm from being trapped in a local optimum (premature convergence of the GA). It involves the modification of the value of each 'gene' of a chromosome with a small probability, called the mutation probability. Mutation plays the role of re-discovering lost or unexplored genetic materials, as well as for maintaining genetic diversity [56]. Mutation operators produce random changes in various chromosomes of the population.
Generally, a mutation probability of (1/l), where l is the chromosome length considered appropriate in the literature. In this study, mutation rate was kept around (4-6)%, which is considered higher, especially for networks with large number of pipelines, and a hillclimbing mutation operator was applied for the final 10% of the generations, which would permit mutation only if it improved the quality of the solution. The mutation strategy utilized in the study, shown in Figure 4, was bit-flip mutation since it complements the encoding scheme of the algorithm.

Elitism
Elitism involves selecting a small proportion of the fittest chromosomes of one generation and copying them directly into the next generation. Elitism is used to protect the fittest chromosomes from crossover and mutation. The least-cost distribution networks, without violating any pressure and velocity constrains per generation are considered as the elite chromosomes. The 2 best performing individuals from each generation are saved prior to crossover and mutation for the next generation.

Penalty Functions
The following Equations (6) and (7) are used to calculate the penalty cost [63]. The penalty imposed will be higher, the larger the violations of pressure and velocity from the target values. The penalty equation for violation of pressure constraint in the water distribution network implemented by SOP-WDN can be represented as: (6) where, N n is the number of nodes in the network, P P the pressure penalty, P j is the pressure of node j, T P is the target pressure, P P1 is the pressure penalty coefficient if the pressure at the node is above the target pressure, and P P2 is the pressure penalty coefficient if the pressure at the node is below the target pressure. The penalty equation for the violation of velocity constraint in the distribution network implemented by SOP-WDN can be represented as: where, N p is the number of pipes in the network, V P is the velocity penalty, V i is the flow velocity at link i, T V is the target velocity, V P1 is the velocity penalty coefficient if the velocity at a given link is above target velocity, and V P2 is the velocity penalty coefficient if the velocity at the link is below target velocity.

Sensitivity Analysis
Optimal solutions are not guaranteed in evolutionary algorithms; hence, maximizing 'near optimal' solutions is essential [64]. Genetic algorithm parameters are user input parameters that significantly affect the overall performance and speed of SOP-WDN. These parameters interact in a complex way [65] and must be tuned to obtain better solutions and faster convergence.
A sensitivity analysis was carried out to determine the most influential parameters and to obtain the best parameter combinations for effective execution of the algorithm. The parameters tested were: A total of 100 individual runs were performed (2000 iterations each) for any one alteration of any one of the seven parameters. Crossover rate and mutation rate were further tuned in combination since a proper balance between these operators is essential to ensure global optima. In total, 10-12 different values were tested in total for any one parameter and the value assigned per alteration was based on the literature and the preceding results. The final set of parameters selected, and the results obtained are given in Table 3 and Figure 5. It is to be noted that larger population size and iterations may be required for large water distribution networks.

Results and Discussion
The conventional approach when testing the functionality, validity, and efficiency of a developed optimization algorithm is to choose some benchmark water distribution network problems and obtain their solution. Benchmark WDNs have provided a common testbed for newly developed optimization algorithms and design approaches. To prove their significance, the developed optimization algorithms are applied to benchmark WDN problems and are compared to the existing algorithms. Using SOP-WDN, some benchmark networks of the literature have been examined.

Example 1: Two-Loop Network
The two-loop network is an imaginary network introduced by Alperovitz and Shamir [3] that consists of 8 pipelines and 7 nodes (with reservoir), all fed by gravity flow from a single reservoir with an elevation of 210 m. The layout of the two-loop network is given in Figure 6. All pipes in the layout are 1000 m in length, and the Hazen-Williams coefficient is 130. The minimum head requirement in each node is 30 m above ground level. The commercially available diameters for the distribution network are described below on Table 4. The details of the distribution network have been provided in Appendix A: Figure 6. The Two-loop network layout.  Table 5 gives the solution obtained by SOP-WDN for the two-loop network. Figure 7 shows the EPANET network layout of the solved network and Figure 8 shows the pressure heads obtained at the nodes of the distribution network. Table 6 compares the solution obtained from SOP-WDN with the solution obtained by other research reports:    The optimal cost of USD 419,000 was obtained for the Two-loop network, and the minimum pressure requirement of 30 m was fulfilled for all nodes. Table 6 shows the results obtained by other research reports for comparison. The optimal cost of USD 419,000 obtained by SOP-WDN for the two-loop network, is same as the solution obtained by Van Dijk et al. and Geem.

Example 2: Hanoi Network
Hanoi network, located in Vietnam, was first presented by Fujiwara and Kang [66]. It consists of 32 nodes, 34 pipes, and 3 loops, and is fed by gravity from a reservoir with a 100 m fixed head. The layout of the Hanoi network is given in Figure 9. All pipes available for this distribution network have a Hazen-Williams coefficient C of 130. The elevation of all nodes is 0 m, and minimum head limitation is 30 m above ground level. The commercially available diameters for the distribution network are described below on Table 7. The details of the distribution network have been provided in Appendix A.   Table 8 gives the solution obtained by SOP-WDN for the Hanoi network, while Table 9 compares the solution obtained from SOP-WDN with the solution obtained by other research reports. Figure 10 shows the EPANET network layout of the solved network and Figure 11 shows the pressure heads obtained at the nodes of the distribution network.   Table 9. Comparison of SOP-WDN results to past studies for the Hanoi network.

Studies Savic and Walters Liong and Atiquzzaman
Geem Van Dijk et al.

SOP-WDN
Least cost obtained (Million USD) 6.187 6.220 6.056 6.110 6.081  The optimal cost of USD 6.081 million was obtained for Hanoi network, and the minimum pressure constraint of 30 m was fulfilled for all nodes. It was observed to be the best solution (lowest cost) without the violation of any constraints. The solution obtained by Geem [16] has a lower cost. However, this solution failed to meet the pressure constraint of 30 m at five nodes.

Example 3: GoYang Network
The GoYang water network is located in South Korea, and consists of 30 pipes, 22 nodes, and 9 loops. This network was first introduced by Kim et al. [67] and is fed by a single fixed pump of 4.52 kW from a 71 m constant head reservoir. The layout of the GoYang network is given in Figure 12. The Hazen-Williams coefficient for all pipes in the network is 100. The minimum head limitation for this network is 15 m above ground level. The commercially available diameters for the distribution network are described below on Table 10. The details of the distribution network have been provided in Appendix A.   Table 11 gives the solution obtained by SOP-WDN for the GoYang network. Figure 13 shows the EPANET network layout of the solved network and Figure 14 shows the pressure heads obtained at the nodes of the distribution network. Table 12 compares the solution obtained from SOP-WDN with the solution obtained by other research reports.    The lowest cost obtained by SOP-WDN for the GoYang network was 177,010,359 Won, which compared to the other studies, is the cheapest cost. The obtained solution also has no nodes containing pressure violations, as all nodes in the distribution network have fulfilled the minimum pressure requirement of 15 m.

Conclusions
In this study, the developed Genetic Algorithm based optimization algorithm SOP-WDN was tested on three benchmark water distribution networks, and in comparison, to the other studies, it was able to produce competitive results. EPANET software, which was used for the hydraulic analysis and calculations of the water distribution systems is a well-accepted and utilized software. EPANET-MATLAB toolkit enabled the SOP-WDN algorithm to perform EPANET based calculations directly in the MATLAB environment, which greatly improved the overall computational speed, performance, and efficiency of the algorithm. Hence, the EPANET-MATLAB toolkit can prove to be an important tool that enables the facile use of EPANET software in the MATLAB environment for many different research purposes. SOP-WDN can be used as a reliable algorithm and can easily be implemented and adapted to aid engineers and designers during the design process of new water distribution networks, or the rehabilitation of existing water distribution networks.     2  890  3  850  4  130  5  725  6  1005  7  1350  8  550  9  525  10  525  11  500  12  560  13  940  14  615  15  280  16  310  17  865  18  1345  19  60  20  1275  21  930  22  485  23  1045  24  820  25  170  26  900  27  370  28  290  29  360  30  360  31  105  32  805   Table A4. Pipe data for the Hanoi network.