## Abstract

In the present work, a model is presented for the optimization of water distribution networks (WDN). The developed model can be used to verify node pressures, head losses, and fluid flow rate and velocity in each pipe. The algorithm is based on particle swarm optimization (PSO), considering real and discrete variables and avoiding premature convergence to local optima using objective function penalization. The model yields the minimum cost of the network, the node pressures and the velocities in the pipes. The pressures and velocities are calculated using the hydraulic simulator Epanet. Some benchmark problems are used to test the applicability of the developed model, considering WDN for small-, medium-, and large-scale problems. Obtained results are consistent with those found in the literature.

## NOMENCLATURE

• α

Coefficient to preset maximum particle velocity

•
• c1, c2

Cognitive and social acceleration coefficients

•
• Cj

Hazen-Williams roughness coefficient for pipe j

•
• CTG

Value of the objective function for particle G

•
• CTi

Value of the objective function for particle i

•
• CTmax

Maximum total cost of the WDN

•
• dmd

Demand at the node

•
• Di,j

Diameter of tube j in solution i

•
• Dmax

Maximum available pipe diameter

•
• Dmin

Minimum available pipe diameter

•
• DSET

Set of diameters available for the network

•
• e

Node elevation

•
• EP

Energy released by the pump

•
• f

Friction factor

•
• Fi

Value of the penalized objective function with vector Pbest for particle i

•
• G

Global-best-solution vector

•
• Gmax

Vector where all pipes have Dmax diameters

•
• hf

•
• i

Particle i

•
• j

Pipe j

•
• k

Node k

•
• K

Total number of nodes

•
• Lj

Length of pipe j

•
• M

Total number of pipes

•
• nd

Total number of available diameters

•
• NP

Total number of particles in the swarm

•
• NV

Number of hydraulic violations

•
• Pi

Best-position vector for particle i

•
• pr(k)

Pressure at node k

•
• prmin(k)

Minimum required pressure at node k

•
• pi,j

Component of vector P for particle i

•
• qin

Flow rate entering the node

•
• qout

Flow rate exiting the node

•
• r, r1, r2

Random numbers from uniform distribution [0,1]

•
• t

Iteration number t

•
• tmax

Maximum number of iterations

•
• vmax, vmin

Maximum and minimum flow velocities

•
• vPi,j

Component of the velocity vector for particle i

•
• Vi

Velocity vector for particle i

•
• VPSOmax

Maximum particle velocity

•
• w

Inertia weight

•
• WDN

Water distribution network

•
• wmax

Maximum inertia weight

•
• wmin

Minimum inertia weight

•
• Wpenal

Penalty value

•
• Xi

Current position vector for particle i

•
• xi,j

Diameter of pipe j belonging to particle i

•
• ɛ

Darcy-Weisbach roughness height

## INTRODUCTION

Any water supply system should be able to transport potable water from a certain tank to the consumer. A water distribution network (WDN) is the most important element in such a system, consisting of a piping system, as well as devices made of pumps, valves, tanks, meters, among other accessories.

The efficient and continuous delivery of water in adequate quantity, quality, and pressure to the consumer must be guaranteed. Great investments are made throughout the world to provide or update water supply systems efficiently. Even so, a large part of the population has no access to adequate WDN. Setting up the WDN begets most of the cost of a water supply system.

The WDN optimization problem is a complex one, due to practical considerations. The diameters of the pipes should be selected from a set of available ones and, as such, cannot be considered as continuous variables. The proposed objective function usually takes into consideration the cost of the network. The constraints of the optimization model may be nonlinear, allowing the problem to have local minima if it is not convex. Furthermore, because pipe diameters are discrete variables, there is an additional complexity.

The analytical solution to this problem is a complex one, as it simultaneously involves equations for conservation of mass and energy, head losses, and the minimum network requirements such as minimum pressures at demand nodes and flow velocities, which should stand between the minimum and maximum limits imposed by the problem.

When the dimensioning of a WDN is treated as an optimization problem, two types of approach may be used: Split-pipe and Single. While the Split-pipe approach uses two or more diameters in a pipe of the network, the Single approach uses a single diameter per pipe. Figure 1 shows both approaches. In the present work, the Single approach is used.

Figure 1

Single and Split-pipe approaches for WDN dimensioning.

Figure 1

Single and Split-pipe approaches for WDN dimensioning.

An optimum WDN design implies in finding the diameter of each network pipe so its total cost is minimized within the hydraulic constraints. A WDN is usually represented by a graph with vertices (nodes) and edges (pipes) connected at the vertices. The nodes may represent tanks or demand nodes, while the lines may represent pipes, valves, or pumps.

The WDN optimization problem can be formulated using mixed-discrete nonlinear programming (MDNLP) with the diameters of each pipe as the decision variables, which are real-valued and discrete.

In the 1970s, researchers approached the WDN optimization using linear, non-linear, dynamic, and mixed-integer programming methods. Thereafter, many works were developed in this area, some of them deserving special highlight. Among those using LP (linear programming), Alperovits & Shamir (1977) introduced a significant method, named linear programming gradient (LPG). This is an iterative method carried out in two steps, the first one consisting of considering optimization of the design when the distribution of flow rates in the network is assumed to be known and the second one consisting of calculating the length of pipes with normalized diameters belonging to a certain part of the network. The LPG method was subsequently improved by several researchers, such as Quindry et al. (1981), Goulter et al. (1986), and Kessler & Shamir (1989).

In the case of NLP (nonlinear programming), some works stand out. Watanatada (1973) used the Box transformation to eliminate inequality constraints and solved the problem with equality constraints using the Haarhoff and Buys method. Shamir (1974) used the GRG (generalized reduced gradient) method to solve the NLP, and the penalty method together with the Newton-Raphson method to calculate flow rates. Su et al. (1987) integrated the GRG method with the Kypipe hydraulic simulator. Lansey & Mays (1989) used the GRG2 generalized reduced gradient method to solve the NLP problem. Fujiwara & Khang (1990) used the two-phase decomposition method as an extension of the LPG method, using NLP with the Split-pipe solution method, where each pipe is segmented with unknown lengths according to the number of selected diameters. Bragalli et al. (2008) solved the MINLP (mixed integer nonlinear programming) problem using the Bonmin solver in the AMPL (A Mathematical Programming Language) systems modelling environment.

According to Van Dijk et al. (2008), the optimization of a relatively small WDN requires countless repetitive calculations due to the discrete variables (pipe diameters) and the size of the solution space, making it virtually impossible to use any conventional optimization technique to find a global optimum. The development of hydraulic models in the last decades improved the ability to simulate the hydraulic behavior of big WDN. In the last few years, metaheuristic algorithms have been used due to their simplicity and generality, being able to solve the problem. Yates et al. (1984) recommended the heuristic methods for the non-deterministic polynomial-time hard (NP-hard) problems with Single solution approaches. Several of such techniques were used to solve the WDN optimization problem, as shown in Table 1.

Table 1

Heuristic models used in WDN

 ACO Ant Colony Optimizations Maier et al. (2003) DE Differential Evolution Suribabu & Neelakantan (2014) GA Genetic Algorithms Simpson et al. (1994), Savic & Walters (1997) and Abebe & Solomatine (1998) HBMO Honey Bee Mating Optimization Mohan & Babu (2010) HS Harmony Search Geem (2006) ILS Iterated Local Search De Corte & Sörensen (2016) PSO Particle Swarm Optimization Suribabu & Neelakantan (2006) and Ezzeldin et al. (2014) SA Simulated Annealing Loganathan et al. (1995) and Cunha & Sousa (1999) SCE Shuffled Complex Evolution Moosavian & Jaefarzadeh (2014) SFLA Shuffled Frog Leaping Algorithm Eusuff & Lansey (2003) STA State Transition Algorithm Zhou et al. (2016) TS Tabu Search Fanni et al. (1999), Liberatore et al. (2003) and Cunha & Ribeiro (2004) WCA Water Cycle Algorithm Sadollah et al. (2014)
 ACO Ant Colony Optimizations Maier et al. (2003) DE Differential Evolution Suribabu & Neelakantan (2014) GA Genetic Algorithms Simpson et al. (1994), Savic & Walters (1997) and Abebe & Solomatine (1998) HBMO Honey Bee Mating Optimization Mohan & Babu (2010) HS Harmony Search Geem (2006) ILS Iterated Local Search De Corte & Sörensen (2016) PSO Particle Swarm Optimization Suribabu & Neelakantan (2006) and Ezzeldin et al. (2014) SA Simulated Annealing Loganathan et al. (1995) and Cunha & Sousa (1999) SCE Shuffled Complex Evolution Moosavian & Jaefarzadeh (2014) SFLA Shuffled Frog Leaping Algorithm Eusuff & Lansey (2003) STA State Transition Algorithm Zhou et al. (2016) TS Tabu Search Fanni et al. (1999), Liberatore et al. (2003) and Cunha & Ribeiro (2004) WCA Water Cycle Algorithm Sadollah et al. (2014)

In the present work, a model based on particle swarm optimization (PSO) techniques for WDN optimization is presented. The proposed algorithm anticipates the penalization of the objective function during the usage of the PSO to prevent the solution from being trapped in local optima. The Epanet hydraulic simulator is used to calculate the pressures and other hydraulic variables. Epanet is a public domain hydraulic analysis package for water supply networks and was developed by the EPA (Environment Protection Agency) and provides a Programmer's Toolkit. The functions of EPANET Programmer's Toolkit can be incorporated into a program code developed in some computation language. Some benchmark problems were used to test the applicability of the developed model.

## WDN OPTIMIZATION MODEL

The optimization model developed for WDN design considers the set of available diameters to be used in the network and their corresponding properties, such as cost per unit of length and roughness. The set named DSET={D1, D2, …, Dnd} represents the different diameters available for the WDN, with D1<D2<…<Dnd, D1=Dmin, and Dnd=Dmax. Each element in DSET has corresponding cost and roughness values, shown in Table 2.

Table 2

Diameters available for the WDN, with costs and roughnesses

 Diameter D1 D2 … Dnd Cost cost1 cost2 … costnd Roughness Roug1 Roug2 … Rougnd
 Diameter D1 D2 … Dnd Cost cost1 cost2 … costnd Roughness Roug1 Roug2 … Rougnd

### Objective function

M pipes and K nodes are considered in the WDN to be optimized. The objective function is represented by Equation (1), where CTi is the total cost of setting up the pipes for solution i, Lj is the length of pipe j and its corresponding cost Cost (Di,j) per unit of length to set up the pipe with diameter Di,j.
(1)

### Constraints

The Model constraints are:
• (a) The algebraic sum of the input and output flow rates in a node (k) must equal zero (law of conservation of mass) according to Equation (2), where qin(k) and qout(k) represent the input and output flow rates in node k, respectively, and dmd(k) is the demand in node k.
(2)
• (b) The sum of the head losses in the set of pipes in a loop must equal zero (law of conservation of energy) according to Equation (3), where hfj represents the head loss (hf) in pipe j, which is part of a set of pipes in a given loop.
(3)
If a pump is present in the loop, the law of conservation of energy is given by Equation (4), where EP is the energy released by the pump.
(4)
• (c) The pressure in each node must be greater than a minimum required value for the WDN according to Inequality (5), where pr(k) is the pressure and prmin(k) is the minimum required pressure in node k.
(5)
• (d) In some WDN, the minimum and maximum flow velocities of the fluid are constraints of the system according to Inequality (6), where vmin and vmax are, respectively, the minimum and maximum velocities imposed to the WDN and vj is the flow velocity in pipe j.
(6)
• (e) The diameters to be used must be in the set of available diameters as represented in Equation (7), where xi,j is the diameter of pipe j of solution i and DSET is the set of available diameters to be used in the WDN.
(7)

### Equations used for head loss calculation

The equations used to calculate the head losses in the pipes are Hazen-Williams's (H-W), Equation (8), and Darcy-Weisbach's (D-W), Equation (9), where D is the diameter of the pipe (m), q is the flow rate (m3/s), L is the length of the pipe (m), C is the Hazen-Williams roughness coefficient, and f is the Darcy-Weisbach friction factor.
(8)

(9)
Roughness coefficient C (Hazen-Williams) is a dimensionless value exclusively dependent on the type of material and time of use.

Friction factor f is also dimensionless and depends on four variables, namely diameter (D), flow rate (q), Darcy-Weisbach roughness coefficient (ɛ) and the fluid kinematic viscosity. In order to obtain f values for all flow regimes, equations such as Churchill's (1977) were developed for every flow regime and relative roughness values (ɛ/D) (Raoni et al. 2017).

Equations (8) and (9) are evidently nonlinear and the diameters, as previously mentioned, are discrete variables. Therefore, whatever the equation used to calculate head losses, the optimization model has the form of an MDNLP problem. In the present work, an optimization method based on the PSO algorithm was developed to solve the problem.

The PSO algorithm was introduced by Kennedy & Eberhart (1995) and it belongs to the group of meta-heuristic algorithms, which are based on the behavior of a flock of birds or a school of fish. It considers the social and cognitive aspects, that is, each element of the group has its behavior influenced by the group and by its own individual experiences. The term ‘particle’ can be understood as an element of the group, like a bird in the flock or a fish in the school. Through this analogy, in the optimization problem, the particle can be imagined as close or distant from the target. Therefore, its performance must be evaluated, thus the indicator named fitness, which is a reference scalar (value of the objective function), is used.

A possible solution to the system is vector Xi = (xi,1, xi,2xi,j, … , xi,M), which represents the position of particle i, with dimension M. The velocity of particle i, represented by vector , represents the search direction in the solution space. The particle is evaluated at each iteration t. The best particle position is named Pbest (personal best) and is stored in vector . Furthermore, the particle is compared with the best position ever achieved by the group, named Gbest (global best), stored in vector . The orientation of the speed of the particle is influenced by both vectors, and G.

The PSO algorithm is formulated by Equations (10) and (11), where i = 1, 2,, NP (number of particles); j = 1, 2,, M (number of decision variables); t is the iteration number; r1 and r2 are random numbers with uniform distribution in the interval [0, 1]; c1 and c2 are, respectively, the coefficients of the cognitive and the social accelerations; pi,j is component j of vector Pbest of particle i; gj is component j of vector Gbest; and w is the inertia weight introduced by Shi & Eberhart (1998).
(10)

(11)

### Strategy for penalization of the objective function

Particle Xi should be evaluated using Equation (1) at every movement (iteration). The particle must be verified for viability and hydraulic violations. Such violations can be:

• pressure in a demand node lower than the minimum allowed;

• fluid velocity inside the pipes lower than minimum or higher than maximum velocities allowed.

In the present work, Epanet was used to verify the pressures and to calculate the velocities.

For particle i, for each existing violation, a penalty is issued through the incorporation of a value named Wpenal into the objective function. The number of violations NV must be multiplied by Wpenal in Equation (1), if these violations exist. The objective function is then penalized and represented by Equation (12).
(12)

Each particle i (Xi) is associated with its respective vector Pbesti (Pi) and with its performance . For each iteration, if the performance of Xi is better, Pbest and its performance are updated. The PSO algorithm is as follows:

• 1.

Initialize the position of the NP particles of the group randomly, between the minimum and maximum limits of the decision variables, as well as the velocities of the particles.

• 2.

Calculate the value of the penalized objective function (performance) for each particle (CTPi), according to its new position.

• 3.

For each particle i:

• 3.1

Compare its performance (CTPi) with Fi (Pbesti performance). If it is better, update the value of Fi as well as the components of vector Pi.

• 3.2

Compare its performance with that of vector Gbest. If it is better, update the performance of Gbest as well as the respective components of vector G.

• 4.

Compare the criteria of iteration finalization. If the number of iterations is achieved the optimization process ends. Otherwise, update the position of the NP particles and return to step 2.

If the group has NP particles, matrices X, V, and P, necessary to formulate the algorithm, are represented by expressions (13), (14), and (15).
(13)

(14)

(15)
The performance function for vector Pi is stored in the scalar Fi. The set of Fi values forms the column vector FL, represented by expression (16).
(16)
The formulation of the PSO algorithm, presented previously, may result in the particles finding a local solution if the problem has a nonlinear and non-convex nature. Due to its quick convergence, it may lose the ability to explore new spaces, when the objective is to look for an optimum global solution or at least to approach it. Thus, in the present work, a modification is proposed for this algorithm so this problem can be alleviated.

## PSO ALGORITHM MODIFICATION FOR WDN OPTIMIZATION

If there are any violations when calculating the head losses and the velocities, the optimization model, while searching for a global optimum, may converge to a local optimum, due to the problem having a nonlinear and non-convex nature. Standard PSO optimization methods cannot escape this trap. Therefore, in the present work, a modification was proposed in the algorithm in an attempt to mend this situation.

The PSO algorithm, which is governed by the use of Equations (10) and (11), quickly converges to local solutions when the solution space is non-convex, multimodal, and discontinuous, as is the case in WDN optimization problems. If a particle i achieves the same position as Gbest, then the vector Pi = Xi = G. In this situation, and in Equation (11):
After a given number of iterations (t1), the expression is represented by and, since w < 1, the expression approaches zero , meaning, in Equation (10), that the particle Xi stalls together with vector Gbest.
The consequence of this behavior is that, as the number of iterations grows, the particles gather in a local optimum, thus losing their ability to explore new solution spaces. Figure 2 shows this behavior of the standard PSO algorithm.
Figure 2

The particles come to rest at a local optimal solution.

Figure 2

The particles come to rest at a local optimal solution.

Therefore, aiming at better results from the PSO algorithm, a modification is proposed in this section. This alteration avoids particle concentration in the position of the leader, thus improving particle distribution throughout the solution space, providing searches that are more promising, as shown in Figure 3.

Figure 3

Behavior of the particles in the modified PSO algorithm.

Figure 3

Behavior of the particles in the modified PSO algorithm.

Particle initialization is carried out randomly, with continuous real values between the Dmin and Dmax limits, as shown in Equation (17), r being a random number with uniform distribution in the interval [0, 1].
(17)
Since diameters are discrete, xi,j must be in the set of available diameters, DSET. In this regard, a procedure is used to convert diameter xi,j, initially continuous, to a discrete one, as shown in Figure 4.
Figure 4

Discretization of continuous diameter xi,j.

Figure 4

Discretization of continuous diameter xi,j.

Variable xi,j assumes the value of either DL or DU according to Expression (18).
(18)
This is done for the group of NP particles, forming matrix X of order NP x M.
The components of vector Vi start either at rest (vPi,j = 0) or randomly between values VPSOmin and VPSOmax following Equation (19), where VPSOmax and VPSOmin are, respectively, the maximum and minimum particle velocities, that is, .
(19)
The velocity VPSOmax, according to Ezzeldin et al. (2014), can be limited using Equation (20), where α ∈ [0,1]. Some authors, such as Montalvo et al. (2008) and Ezzeldin et al. (2014), assume α = 0.50 in some examples, just as the minimum velocity of the particle can be assumed as VPSOmin = −VPSOmax.
(20)
The new position of particle xi,j, in iteration t+1, is described by Equation (10). Once more, the value xi,j(t+1) must be in the set of available diameters and thus it has to be discretized, according to Figure 4, as velocity vPi,j is a continuous real value.

A viable vector, in particular, is that which has as elements the maximum diameters (Dmax), which shall be named Gmax = (Dmax, Dmax,…, Dmax), whose function value given by Equation (1) should equal CTmax (maximum value achieved by the objective function relative to the installation costs of the pipes). If this vector has pressure violations, the network is unfeasible.

The evaluation of vector Gbest = (g1,g2,g3,…,gM), according to Equation (1), yields a scalar named CTG that is, for now, the best result found in the process. The particle Gbest is named the current leader of the group. The process of particle movement (iterations) ends when CTG presents no variation in the following iterations or when the maximum number of iterations, tmax, is surpassed.

### Modified PSO algorithm for the optimum WDN project

A modification was implemented in the PSO algorithm to keep particles dispersed, thus avoiding stagnation together with the Gbest leader particle, maintaining the exploration of the solution space and avoiding repetitive operations for particles that have the same position. The procedures of the modified algorithm are as follows:

• 1.

Initialize Xi, Vi, Pi, ∀ . Xi values are initialized according to Equation (17) and the diameters are discretized according to Expression (18). Particles are assumed to start from zero, vPi,j = 0, ∀. Vector Pbest is and its respective initial performance is . Vector Gbest is and its respective performance is .

• 2.

For each particle (i = 1 to NP):

• 2.1

Using Epanet, calculate the pressures and velocities, as well as the number of violations (NVi) and the value of the penalized objective function CTPi, according to Equation (12).

• 2.2

Compare CTPi with the performance of Gbest. If , reinitialize particle Xi according to Equation (17) and discretize the diameter according to Expression (18). Reinitialize vector Pbesti: , . Keep the velocities and return to step 2 for the next particle.

• 2.3

Compare performance CTPi with performance Fi from vector Pbesti. If it is better, update Pbest performance as well as the components of vector Pi.

• 2.4

Compare performance CTPi with performance CTG from vector Gbest. If it is better, update Gbest performance , the components of vector G, pressure results vector pR, and speed results vector vR.

• 3.

If the iteration number (t) is greater than the maximum number of iterations (tmax), print the results (G, CTG, pR, vR). Otherwise, update the particle position and return to step 2.

In order to determine the inertia weight, the function Simulated annealing inertia weight was used with λ = 0.95, as presented by Shrivatava et al. (2015). This function is shown in Equation (21).
(21)
The penalty costs used in the literature take many forms, Savic & Walters (1997), Abebe & Solomatine (1998), Wu & Simpson (2002) and Djebedjian et al. (2005). In the present paper, some parameters were obtained by trial and error. Some approaches can be used in order to find a good set of parameters. The acceleration coefficients are provided good values by trial and error, but generally c1 = c2 = 2. VPSOmax is chosen as the maximum variation between two consecutive available diameters. The penalty value Wpenal is chosen as the maximum cost (CTmax) divided by the number of pipes (M). The number of particles is chosen as NP ≅ (M) × (nd)/2.5. The maximum number of iterations is chosen as tmax ≅ (M) × (nd)/3.

## CASE STUDIES

Four case studies were carried out. The Two-Loop network (small problem), originally proposed by Alperovits & Shamir (1977); the main network in the city of Hanoi, Vietnam (medium problem), presented by Fujiwara & Khang (1990); the R-9 network, located in the city of João Pessoa, Paraíba, Brazil (intermediate problem), presented by Gomes et al. (2009) and the Balerma irrigation network, located in Almería, Spain (large problem), presented by Reca & Martínez (2006).

### Case study 1

The first case study was carried out using a network known as Two-Loop, originally studied by Alperovits & Shamir (1977). Figure 5 presents the network layout, showing node elevations and demands.

Figure 5

Two-Loop network. Source:Alperovits & Shamir (1977).

Figure 5

Two-Loop network. Source:Alperovits & Shamir (1977).

The network comprises eight pipes with 1,000 m in length. The minimum pressure requirement in each node equals 30 water column meters above the node. Head losses are calculated using the Hazen-Williams equation and the dimensionless roughness coefficient C is 130 for all pipes.

The main feeding is done using gravity and the elevation of the tank (210 m) is enough to fulfill the minimum node pressures. The Two-Loop network has 7 nodes and 8 interconnected pipes. The set of available diameters (in mm) is DSET = {25.4, 50.8, 76.2, 101.6, 152.4, 203.2, 254.0, 304.8, 355.6, 406.4, 457.2, 508.0, 558.8, 609.6}, comprised of 14 available diameters (nd = 14), as shown in Table 3.

Table 3

Cost data for the Two-Loop network (Alperovits & Shamir 1977)

Diameter (mm)Cost (US$/m)C(H-W)Nominal diameter (in.) 25.4 2.00 130.0 50.8 5.00 130.0 76.2 8.00 130.0 101.6 11.00 130.0 152.4 16.00 130.0 203.2 23.00 130.0 254.0 32.00 130.0 10 304.8 50.00 130.0 12 355.6 60.00 130.0 14 406.4 90.00 130.0 16 457.2 130.00 130.0 18 508.0 170.00 130.0 20 558.8 300.00 130.0 22 609.6 550.00 130.0 24 Diameter (mm)Cost (US$/m)C(H-W)Nominal diameter (in.)
25.4 2.00 130.0
50.8 5.00 130.0
76.2 8.00 130.0
101.6 11.00 130.0
152.4 16.00 130.0
203.2 23.00 130.0
254.0 32.00 130.0 10
304.8 50.00 130.0 12
355.6 60.00 130.0 14
406.4 90.00 130.0 16
457.2 130.00 130.0 18
508.0 170.00 130.0 20
558.8 300.00 130.0 22
609.6 550.00 130.0 24

The following PSO algorithm parameters were considered for the Two-Loop network: dynamic inertia weight wmax = 0.9 and wmin = 0.5; acceleration coefficients c1 = c2 = 2; penalty Wpenal = US$100,000; number of particles NP = 50; maximum PSO velocity VPSOmax = 51 mm; number of iterations tmax = 33. Execution time was in the order of centiseconds, in an Intel Core i5 1.6 GHz CPU. The optimized value was found to be US$ 419,000.00, which represents the global optimum according to Ezzeldin et al. (2014). Table 4 shows the optimized diameters in inches, in order to compare with previous works.

Table 4

Optimized diameters (inches) and comparison for the Two-Loop network

PipeAlperovits & Shamir (1977) Goulter et al. (1986) Zhou et al. (2016) Present work
20 18 20 18 18 18
8 6 10 10 10
18 16 16 16
8 6 6 4
16 16 14 16 16
12 10 12 10 10 10
10 8 10 10
6 4 2 1
Cost (US$) 497,525 435,015 419,000 419,000 PipeAlperovits & Shamir (1977) Goulter et al. (1986) Zhou et al. (2016) Present work 20 18 20 18 18 18 8 6 10 10 10 18 16 16 16 8 6 6 4 16 16 14 16 16 12 10 12 10 10 10 10 8 10 10 6 4 2 1 Cost (US$) 497,525 435,015 419,000 419,000

Table 4 shows that authors Alperovits & Shamir (1977), as well as Goulter et al. (1986), used the Split-pipe method with two segments per pipe. In pipe 1, for example, a 20-inch diameter was used for the first segment and an 18-inch one for the second segment. In the present work and in that of Zhou et al. (2016), an 18-inch diameter was used for the whole pipe.

The pressures obtained using the model proposed in the present work, according to the optimized diameters, are shown in Table 5, being evidently higher than the minimum required (30 m).

Table 5

Pressures for the Two-Loop network

Node no.1234567
Min. pressure (mTank 30 30 30 30 30 30
Calculated pressure (m53.25 30.46 43.45 33.81 30.44 30.55
Node no.1234567
Min. pressure (mTank 30 30 30 30 30 30
Calculated pressure (m53.25 30.46 43.45 33.81 30.44 30.55

Figure 6 presents the cost comparison between the standard PSO and the modified PSO algorithms. It can be seen that the best value found using the standard PSO was US$420,000 in the iteration 26 (this value remains unaltered until the end of the optimization process). The modified PSO algorithm achieves the optimum value (US$ 419,000) in the iteration 33.

Figure 6

Standard PSO and modified PSO comparison for Two-Loop network.

Figure 6

Standard PSO and modified PSO comparison for Two-Loop network.

### Case study 2

The second case study refers to the main network in the city of Hanoi, Vietnam (Fujiwara & Khang 1990), which comprises 34 pipes, 32 nodes, and three loops, as shown in Figure 7.

Figure 7

Network in the city of Hanoi (Vietnam).

Figure 7

Network in the city of Hanoi (Vietnam).

The network is fed by gravity, with a fixed-level tank in node 1 at a relative elevation of 100 m. The minimum required pressure is 30 water column meters for each node. The set of pipes available for use, in mm, is DSET = {304.8, 406.4, 508.0, 609.6, 762.0, 1016.0}, as shown in Table 6. The head losses were calculated using the Hazen-Williams equation and every available diameter has a dimensionless roughness coefficient C equal to 130. The cost of each pipe may be calculated by: Costi=1.1 x Li x Di1,5 (Fujiwara & Khang 1990), with Di in inches and Li in meters.

Table 6

Cost data for the pipes in the Hanoi network

Diameter (mm)Cost (US$/m)C (H-W)Nominal Diameter (in.) 304.8 45.73 130 12 406.4 70.40 130 16 508.0 98.39 130 20 609.6 129.33 130 24 762.0 180.75 130 30 1,016.0 278.28 130 40 Diameter (mm)Cost (US$/m)C (H-W)Nominal Diameter (in.)
304.8 45.73 130 12
406.4 70.40 130 16
508.0 98.39 130 20
609.6 129.33 130 24
762.0 180.75 130 30
1,016.0 278.28 130 40

The following parameters were considered in the PSO algorithm for the network in the city of Hanoi: dynamic inertial weight , cognitive and social acceleration coefficients c1 = c2 = 2, penalty Wpenal = US$130,000, population NP = 200, maximum PSO velocity VPSOmax = 179 mm, number of iterations tmax = 90. Considering all pipes to have a diameter of 1,016.0 mm (maximum diameter), CTmax = US$ 10,969,797.60. The optimum value was found to be US$6,081,150.91. The execution time was 2 s (same computer used in the previous case). According to the results shown in Table 7, the solution found by Fujiwara & Khang (1990), highlighted by the symbol **, shows Split-pipe results. Some solutions from other researchers were verified using the Epanet program and some nodes were noted to have pressures below the minimum requirement. Such solutions are highlighted by the symbol *. Table 7 Optimized solutions for the network in the city of Hanoi (pipe diameters in inches) Pipe no.Fujiwara & Khang (1990) Savic & Walters (1997) Cunha & Sousa (1999) Liong & Atiquzzaman (2004) Suribabu & Neelakantan (2006) Present work GA1GA2 40 40 40 40 40 40 40 40 40 40 40 40 40 40 30 40 40 40 40 40 40 40 30 40 40 40 40 40 40 40 30 40 40 40 40 40 40 40 30 40 40 40 40 40 40 40 30 40 40 40 40 40 40 40 30 40 40 40 40 30 40 40 30 40 40 30 40 30 40 40 10 24 30 30 30 30 30 30 30 11 20 24 24 30 24 30 24 24 12 20 24 24 24 24 24 24 24 13 16 20 20 16 20 16 20 20 14 12 16 16 16 16 12 16 16 15 12 12 12 12 12 12 12 16 16 20 12 16 12 24 12 12 17 20 24 16 20 16 30 16 16 18 24 30 20 24 20 30 24 24 19 24 30 20 24 20 30 20 20 20 30 40 40 40 40 40 40 40 21 16 20 20 20 20 20 20 20 22 12 12 12 12 12 12 12 23 24 30 40 40 40 30 40 40 24 16 20 30 30 30 30 30 30 25 16 20 30 30 30 24 30 30 26 12 20 20 20 12 20 20 27 20 24 12 12 12 20 12 12 28 20 24 12 12 12 24 12 12 29 16 20 16 16 16 16 16 16 30 16 20 16 16 12 16 12 12 31 12 16 12 12 12 12 12 12 32 12 12 12 16 16 16 16 33 12 16 16 16 20 16 16 34 16 20 20 20 24 24 24 24 Cost ($ 1065.562a 6.073b 6.195 6.056b 6.220 6.081 6.081
Pipe no.Fujiwara & Khang (1990) Savic & Walters (1997)
Cunha & Sousa (1999) Liong & Atiquzzaman (2004) Suribabu & Neelakantan (2006) Present work
GA1GA2
40 40 40 40 40 40 40
40 40 40 40 40 40 40
30 40 40 40 40 40 40 40
30 40 40 40 40 40 40 40
30 40 40 40 40 40 40 40
30 40 40 40 40 40 40 40
30 40 40 40 40 40 40 40
30 40 40 40 40 30 40 40
30 40 40 30 40 30 40 40
10 24 30 30 30 30 30 30 30
11 20 24 24 30 24 30 24 24
12 20 24 24 24 24 24 24 24
13 16 20 20 16 20 16 20 20
14 12 16 16 16 16 12 16 16
15 12 12 12 12 12 12 12
16 16 20 12 16 12 24 12 12
17 20 24 16 20 16 30 16 16
18 24 30 20 24 20 30 24 24
19 24 30 20 24 20 30 20 20
20 30 40 40 40 40 40 40 40
21 16 20 20 20 20 20 20 20
22 12 12 12 12 12 12 12
23 24 30 40 40 40 30 40 40
24 16 20 30 30 30 30 30 30
25 16 20 30 30 30 24 30 30
26 12 20 20 20 12 20 20
27 20 24 12 12 12 20 12 12
28 20 24 12 12 12 24 12 12
29 16 20 16 16 16 16 16 16
30 16 20 16 16 12 16 12 12
31 12 16 12 12 12 12 12 12
32 12 12 12 16 16 16 16
33 12 16 16 16 20 16 16
34 16 20 20 20 24 24 24 24
Cost ($1065.562a 6.073b 6.195 6.056b 6.220 6.081 6.081 aSplit pipe. bInfeasible solution. Table 8 shows nodal pressures for the network in Hanoi. Notably, there are pressures lower than the minimum network requirement, making the results infeasible. Table 8 Nodal pressures for the network in Hanoi (m) Node no.Savic & Walters (1997) Cunha & Sousa (1999) Liong & Atiquzzaman (2004) Present work GA1GA2 Tank 97.14 97.14 97.14 97.14 97.14 61.63 61.63 61.63 61.67 61.67 56.83 57.26 56.82 57.54 56.92 50.89 51.86 50.86 52.43 51.02 44.62 46.21 44.57 47.13 44.81 43.14 44.91 43.10 45.92 43.35 41.38 43.40 41.33 44.55 41.61 39.97 42.23 39.91 40.27 40.23 10 38.93 38.79 38.86 37.24 39.20 11 37.37 37.23 37.30 35.68 37.64 12 33.94 36.07 33.87 34.52 34.21 13 29.72a 31.86 29.66a 30.32 30.01 14 35.06 33.19 34.94 34.08 35.52 15 33.07 32.90 32.88 34.08 33.72 16 30.15 33.01 29.79a 36.13 31.30 17 30.24 40.73 29.95a 48.64 33.41 18 43.91 51.13 43.81 54.00 49.93 19 55.53 58.03 55.49 59.07 55.09 20 50.39 50.63 50.43 53.62 50.61 21 41.03 41.28 41.07 44.27 41.26 22 35.86 36.11 35.90 39.11 36.10 23 44.15 44.61 44.24 38.79 44.52 24 38.84 39.54 38.50 36.37 38.93 25 35.48 36.40 34.79 33.16 35.34 26 31.46 32.93 30.87 33.44 31.70 27 30.03 32.18 29.59a 34.38 30.76 28 35.43 36.02 38.60 32.64 38.94 29 30.67 31.38 29.64a 30.05 30.13 30 29.65a 30.47 29.90a 30.10 30.42 31 30.12 30.95 30.18 30.35 30.70 32 31.36 32.24 32.64 31.09 33.18 Node no.Savic & Walters (1997) Cunha & Sousa (1999) Liong & Atiquzzaman (2004) Present work GA1GA2 Tank 97.14 97.14 97.14 97.14 97.14 61.63 61.63 61.63 61.67 61.67 56.83 57.26 56.82 57.54 56.92 50.89 51.86 50.86 52.43 51.02 44.62 46.21 44.57 47.13 44.81 43.14 44.91 43.10 45.92 43.35 41.38 43.40 41.33 44.55 41.61 39.97 42.23 39.91 40.27 40.23 10 38.93 38.79 38.86 37.24 39.20 11 37.37 37.23 37.30 35.68 37.64 12 33.94 36.07 33.87 34.52 34.21 13 29.72a 31.86 29.66a 30.32 30.01 14 35.06 33.19 34.94 34.08 35.52 15 33.07 32.90 32.88 34.08 33.72 16 30.15 33.01 29.79a 36.13 31.30 17 30.24 40.73 29.95a 48.64 33.41 18 43.91 51.13 43.81 54.00 49.93 19 55.53 58.03 55.49 59.07 55.09 20 50.39 50.63 50.43 53.62 50.61 21 41.03 41.28 41.07 44.27 41.26 22 35.86 36.11 35.90 39.11 36.10 23 44.15 44.61 44.24 38.79 44.52 24 38.84 39.54 38.50 36.37 38.93 25 35.48 36.40 34.79 33.16 35.34 26 31.46 32.93 30.87 33.44 31.70 27 30.03 32.18 29.59a 34.38 30.76 28 35.43 36.02 38.60 32.64 38.94 29 30.67 31.38 29.64a 30.05 30.13 30 29.65a 30.47 29.90a 30.10 30.42 31 30.12 30.95 30.18 30.35 30.70 32 31.36 32.24 32.64 31.09 33.18 aMin. pressure = 30 m. The variation in the pressure results is due to the use of the Hazen-Williams equation. According to Savic & Walters (1997), different researchers were using different values for the constant in the Hazen-Williams equation. In the present paper, the value used was 10.674. Figure 8 presents the cost comparison between the standard PSO and the modified PSO algorithms for the WDN of Hanoi. It can be seen that the best value found using the standard PSO was US$ 6,122,286.91 in the iteration 48. The modified PSO algorithm achieves the optimum value (US$6,081,150.91) in the iteration 70. Figure 8 Standard PSO and modified PSO comparison for the WDN of Hanoi. Figure 8 Standard PSO and modified PSO comparison for the WDN of Hanoi. ### Case study 3 The third case study was developed using the network presented by Gomes et al. (2009). The network encompasses an area of approximately 600 ha, having a demand designed to supply around 100 thousand people. The network comprises 72 pipes, 61 demand nodes, one tank, and 11 loops. It is shown in Figure 9. Figure 9 Network layout for case study 3. Figure 9 Network layout for case study 3. Network setup costs are shown in Table 9. Head losses are calculated using the Darcy-Weisbach equation. Ten diameter sizes are available. Table 9 Available diameters and their respective costs for case study 3 Diameter (mm)Darcy-Weisbach roughness coefficient ɛ (mm)Cost (US$/m)
100 0.01 17.98
150 0.01 44.75
200 0.01 63.68
250 0.01 85.19
300 0.10 101.95
350 0.10 121.55
400 0.10 136.83
450 0.10 171.09
500 0.10 195.21
600 0.10 255.32
Diameter (mm)Darcy-Weisbach roughness coefficient ɛ (mm)Cost (US$/m) 100 0.01 17.98 150 0.01 44.75 200 0.01 63.68 250 0.01 85.19 300 0.10 101.95 350 0.10 121.55 400 0.10 136.83 450 0.10 171.09 500 0.10 195.21 600 0.10 255.32 The following PSO algorithm parameters were considered for this network: dynamic inertia weight , cognitive and social acceleration coefficients c1 = c2 = 2.07, penalty Wpenal = US$ 78,000, number of particles NP = 288, maximum PSO velocity VPSOmax = 100 mm and number of iterations tmax = 406 in two attempts. Considering every pipe with a diameter of 600 mm (maximum diameter), CTmax = US$6,506,832.45. The optimum value was found to be US$ 2,123,238.51, while Gomes et al. (2009) found an optimized value of US$2.201 million. Registered time was 64 s, in the same computer used for the previous cases. The pressures in the network nodes are presented in Table 10. Table 11 shows the pipe length and optimized diameter for each pipe. Table 10 Pressures in network nodes for the optimized solution for case study 3 NodeDemand (L/s)Elevation (m)Min. Press. (m)Present work press. (m)NodeDemand (L/s)Elevation (m)Min. press. (m)Present work press. (m) 2.51 5.0 25 36.89 31 4.94 3.5 15 18.02 44.07 5.0 25 35.58 32 4.09 4.5 15 16.75 41.24 4.0 25 31.15 33 3.68 5.0 15 16.42 1.04 4.5 25 25.76 34 4.04 5.0 15 17.66 0.86 4.5 25 25.91 35 3.22 6.0 15 15.03 1.32 4.5 25 32.67 36 2.53 4.5 15 16.28 1.35 4.5 15 24.39 37 2.31 4.5 15 16.29 8.59 5.0 15 22.89 38 2.50 4.0 15 17.01 6.40 4.5 15 22.12 39 2.89 4.0 15 19.63 10 6.07 5.0 15 20.05 40 2.48 4.0 15 16.46 11 4.95 3.5 15 15.52 41 4.61 4.0 15 16.44 12 8.38 3.5 15 15.28 42 3.47 4.0 15 17.58 13 11.70 3.5 15 16.98 43 3.61 4.0 15 18.99 14 5.63 5.0 15 17.76 44 5.17 4.0 15 21.56 15 5.57 6.0 15 15.46 45 6.48 4.0 15 16.94 16 6.30 6.0 15 15.47 46 4.91 4.5 15 15.97 17 3.26 6.0 15 17.53 47 6.50 4.0 15 16.63 18 3.60 6.0 15 18.47 48 4.97 4.5 15 31.47 19 4.83 6.0 15 15.38 49 2.97 3.0 15 24.04 20 4.50 6.0 15 15.16 50 1.80 5.0 15 19.51 21 2.80 5.0 15 16.43 51 2.96 4.0 15 17.68 22 5.46 3.0 15 19.10 52 4.66 3.0 15 17.52 23 62.45 3.5 15 19.12 53 4.54 4.5 15 15.89 24 8.19 6.0 15 17.61 54 8.80 4.5 15 16.26 25 58.87 3.5 15 15.22 55 4.26 4.5 15 20.16 26 3.26 3.5 15 15.22 56 2.98 5.0 15 28.29 27 4.36 4.3 15 25.38 57 3.91 5.0 15 23.59 28 4.25 4.0 15 24.02 58 3.70 4.7 15 21.49 29 4.56 2.5 15 22.47 59 1.86 5.0 15 20.80 30 8.32 2.5 15 20.50 60 3.12 5.0 15 20.72 61 3.52 4.5 15 21.41 NodeDemand (L/s)Elevation (m)Min. Press. (m)Present work press. (m)NodeDemand (L/s)Elevation (m)Min. press. (m)Present work press. (m) 2.51 5.0 25 36.89 31 4.94 3.5 15 18.02 44.07 5.0 25 35.58 32 4.09 4.5 15 16.75 41.24 4.0 25 31.15 33 3.68 5.0 15 16.42 1.04 4.5 25 25.76 34 4.04 5.0 15 17.66 0.86 4.5 25 25.91 35 3.22 6.0 15 15.03 1.32 4.5 25 32.67 36 2.53 4.5 15 16.28 1.35 4.5 15 24.39 37 2.31 4.5 15 16.29 8.59 5.0 15 22.89 38 2.50 4.0 15 17.01 6.40 4.5 15 22.12 39 2.89 4.0 15 19.63 10 6.07 5.0 15 20.05 40 2.48 4.0 15 16.46 11 4.95 3.5 15 15.52 41 4.61 4.0 15 16.44 12 8.38 3.5 15 15.28 42 3.47 4.0 15 17.58 13 11.70 3.5 15 16.98 43 3.61 4.0 15 18.99 14 5.63 5.0 15 17.76 44 5.17 4.0 15 21.56 15 5.57 6.0 15 15.46 45 6.48 4.0 15 16.94 16 6.30 6.0 15 15.47 46 4.91 4.5 15 15.97 17 3.26 6.0 15 17.53 47 6.50 4.0 15 16.63 18 3.60 6.0 15 18.47 48 4.97 4.5 15 31.47 19 4.83 6.0 15 15.38 49 2.97 3.0 15 24.04 20 4.50 6.0 15 15.16 50 1.80 5.0 15 19.51 21 2.80 5.0 15 16.43 51 2.96 4.0 15 17.68 22 5.46 3.0 15 19.10 52 4.66 3.0 15 17.52 23 62.45 3.5 15 19.12 53 4.54 4.5 15 15.89 24 8.19 6.0 15 17.61 54 8.80 4.5 15 16.26 25 58.87 3.5 15 15.22 55 4.26 4.5 15 20.16 26 3.26 3.5 15 15.22 56 2.98 5.0 15 28.29 27 4.36 4.3 15 25.38 57 3.91 5.0 15 23.59 28 4.25 4.0 15 24.02 58 3.70 4.7 15 21.49 29 4.56 2.5 15 22.47 59 1.86 5.0 15 20.80 30 8.32 2.5 15 20.50 60 3.12 5.0 15 20.72 61 3.52 4.5 15 21.41 Table 11 Length and optimized diameter for each network pipe for case study 3 PipeLength (m)Present work D (mm)PipeLength (m)Present work D (mm) 2,540 600 37 285 100 350 500 38 210 100 1,140 450 39 240 100 1,430 450 40 250 100 1,020 100 41 340 100 1,430 300 42 270 100 1,710 400 43 240 100 220 400 44 160 100 190 400 45 260 100 10 295 400 46 250 100 11 390 400 47 330 100 12 370 100 48 230 100 13 190 100 49 385 100 14 310 100 50 160 100 15 205 100 51 330 150 16 305 100 52 210 150 17 295 100 53 150 100 18 300 100 54 255 100 19 290 100 55 260 100 20 180 150 56 230 100 21 315 200 57 115 150 22 300 100 58 180 100 23 295 100 59 140 100 24 215 100 60 215 100 25 140 100 61 175 100 26 220 150 62 180 100 27 220 350 63 260 100 28 285 350 64 205 100 29 300 200 65 255 100 30 315 100 66 260 150 31 170 100 67 275 100 32 110 250 68 315 100 33 280 250 69 200 100 34 225 150 70 175 100 35 200 150 71 300 100 36 190 100 72 250 100 PipeLength (m)Present work D (mm)PipeLength (m)Present work D (mm) 2,540 600 37 285 100 350 500 38 210 100 1,140 450 39 240 100 1,430 450 40 250 100 1,020 100 41 340 100 1,430 300 42 270 100 1,710 400 43 240 100 220 400 44 160 100 190 400 45 260 100 10 295 400 46 250 100 11 390 400 47 330 100 12 370 100 48 230 100 13 190 100 49 385 100 14 310 100 50 160 100 15 205 100 51 330 150 16 305 100 52 210 150 17 295 100 53 150 100 18 300 100 54 255 100 19 290 100 55 260 100 20 180 150 56 230 100 21 315 200 57 115 150 22 300 100 58 180 100 23 295 100 59 140 100 24 215 100 60 215 100 25 140 100 61 175 100 26 220 150 62 180 100 27 220 350 63 260 100 28 285 350 64 205 100 29 300 200 65 255 100 30 315 100 66 260 150 31 170 100 67 275 100 32 110 250 68 315 100 33 280 250 69 200 100 34 225 150 70 175 100 35 200 150 71 300 100 36 190 100 72 250 100 Figure 10 presents the cost comparison between the standard PSO and the modified PSO algorithms for the Gomes et al. (2009) WDN. The best minimum found using the standard PSO was US$ 2,160,544.55 in the iteration 447. The modified PSO algorithm achieves the optimum value of US\$ 2,123,238.51 in the iteration 545.

Figure 10

Standard PSO and modified PSO comparison for the Gomes et al. (2009) WDN.

Figure 10

Standard PSO and modified PSO comparison for the Gomes et al. (2009) WDN.

### Case study 4

The fourth case study involved the irrigation network in Balerma, which is an adaptation of the existing irrigation-WDN, in the Sol-Poniente irrigation district in Balerma, in the province of Almería (Spain). This is a network with four feeding sources, 443 demand nodes, 454 pipes, and eight loops (Reca & Martínez 2006).

The network is shown in Figure 11. Head losses are calculated using the Darcy-Weisbach equation. Pipes are made of PVC, with ten different diameters, with a Darcy-Weisbach roughness coefficient (ɛ) equal to 0.0025 mm. The minimum required pressure head is 20 water column meters.

Figure 11

Layout of the network in Balerma (Spain).

Figure 11

Layout of the network in Balerma (Spain).

Setup costs for the network in Balerma are shown in Table 12. The following PSO parameters were considered: dynamic inertia weight , cognitive and social acceleration coefficients c1 = c2 = 2.1, penalty Wpenal = € 40,000, population NP = 654, maximum PSO velocity VPSOmax = 94.5 mm, and number of iterations tmax = 900. Considering every pipe to have a diameter of 581.8 mm (maximum diameter), CTmax = € 21,641,682.21. The optimum value was found to be € 1,923,288.15. Time elapsed was 11,747 s, in 15 search attempts, in an Intel Core i5 3.1 GHz CPU.

Table 12

Pipe data for the network in Balerma

D (mm)Darcy-Weisbach roughness coefficient ɛ (mm)Cost (€/m)
113.0 0.0025 7.22
126.6 0.0025 9.10
144.6 0.0025 11.92
162.8 0.0025 14.84
180.8 0.0025 18.38
226.2 0.0025 28.60
285.0 0.0025 45.39
361.8 0.0025 76.32
452.2 0.0025 124.64
581.8 0.0025 215.85
D (mm)Darcy-Weisbach roughness coefficient ɛ (mm)Cost (€/m)
113.0 0.0025 7.22
126.6 0.0025 9.10
144.6 0.0025 11.92
162.8 0.0025 14.84
180.8 0.0025 18.38
226.2 0.0025 28.60
285.0 0.0025 45.39
361.8 0.0025 76.32
452.2 0.0025 124.64
581.8 0.0025 215.85

Several authors used this network to test various algorithms. Table 13 presents the results.

Table 13

Algorithms and respective minimum cost solutions for the network in Balerma

Solution algorithmMin. cost (€ MM.)
GA (Reca et al. 20083.738
SA (Reca et al. 20083.476
MSATS (Reca et al. 20083.298
PSHS (Geem 20092.633
HS (Geem 20062.601
PSO EDA (Qi et al. 20161.921
PSO (Present work) 1.923
Solution algorithmMin. cost (€ MM.)
GA (Reca et al. 20083.738
SA (Reca et al. 20083.476
MSATS (Reca et al. 20083.298
PSHS (Geem 20092.633
HS (Geem 20062.601
PSO EDA (Qi et al. 20161.921
PSO (Present work) 1.923

Qi et al. (2016) used two parallel algorithms, EDA (estimation of distribution algorithm) and PSO. The EDA generates and updates particles for the PSO algorithm and the result obtained using this method represents, for now, the minimum cost found in the literature. However, the results found with the method proposed in the present work is less than 0.001% greater than this optimum, which means that is still a very good solution.

Figure 12 presents the cost comparison between the standard PSO and the modified PSO algorithms for the Balerma WDN. The best minimum value found using the standard PSO was € 2,114,161.82 in the iteration 11,758. The modified PSO algorithm achieves the optimum value (€ 1,923,288.15) in the iteration 12,827.

Figure 12

Standard PSO and modified PSO comparison for the Balerma WDN.

Figure 12

Standard PSO and modified PSO comparison for the Balerma WDN.

A comparison between the standard PSO and the modified PSO for all the case studies is given in Table 14. It can be noted that the modified PSO presents better results for all the considered cases. Obviously, the solutions presented by the standard PSO were trapped in local optima.

Table 14

Comparison between the results using the standard PSO and the modified PSO

Case studyOptimium value (minimum cost) Modified PSOOptimum value (minimum cost) Standard PSONPNRPFENNSP
Two Loops 419,000.00 420,000.00 50 51 1,650 22
Hanoi 6,081,150.91 6,122,286.91 200 250 14,000 125
Gomes et al. (2009)  2,123,238.51 2,160,544.55 288 2,042 156,960 287
Balerma 1,923,288.15 2,114,161.82 654 137,520 8,388,858 653
Case studyOptimium value (minimum cost) Modified PSOOptimum value (minimum cost) Standard PSONPNRPFENNSP
Two Loops 419,000.00 420,000.00 50 51 1,650 22
Hanoi 6,081,150.91 6,122,286.91 200 250 14,000 125
Gomes et al. (2009)  2,123,238.51 2,160,544.55 288 2,042 156,960 287
Balerma 1,923,288.15 2,114,161.82 654 137,520 8,388,858 653

NRP, number of rebooted particles; FEN, function evaluation number; NSP, number of particles stagnant together with Gbest using standard PSO.

## CONCLUSIONS

In the present work, a model was developed for optimum WDN design. The problem presents an MDNLP formulation. An algorithm based on PSO was developed, with a modification proposed in order to avoid convergence to local optima. It was proven efficient, avoiding premature convergence when seeking optimum solutions and, in some cases, finding the global minimum, preventing particles from gathering in a single position, keeping them scattered, thus increasing the efficiency in exploring the solution space.

An approach was developed to convert continuous pipe diameters into discrete ones, which also showed efficiency, keeping a good performance when converging to an optimum value.

Hydraulic simulator Epanet was used to verify pressures in each node. Its response is instantaneous when solicited to calculate the hydraulic variables and to evaluate the network viability. Results obtained from applications, using small, medium, intermediate, and large problems, are consistent with those present in the literature.

The proposed PSO algorithm modification may be used in other areas of science, in non-linear programming problems with discrete and real variables.

## REFERENCES

REFERENCES
Abebe
,
A. J.
&
Solomatine
,
D. P.
1998
Application of global optimization to the design of pipe networks
. In:
Proceedings of the International Conference on Hydroinformatics
.
A.A. Balkema
,
Copenhagen
,
Denmark
, pp.
989
996
.
Alperovits
,
E.
&
Shamir
,
U.
1977
Design of optimal water distribution systems
.
Water Resources Research
13
(
6
),
885
900
.
Bragalli
,
C.
,
D'Ambrosio
,
C.
,
Lee
,
J.
,
Lodi
,
A.
&
Toth
,
P.
2008
Water Network Design by MINLP
.
IBM Research Report RC24495(W0802-056)
.
Churchill
,
S. W.
1977
Friction factor equations spans all fluid-flow ranges
.
Chemical Engineering
84
(
24
),
91
92
.
Cunha
,
M. C.
&
Ribeiro
,
L.
2004
Tabu search algorithms for water network optimization
.
European Journal of Operational Research
157
(
3
),
746
758
.
Cunha
,
M. C.
&
Sousa
,
J.
1999
Water distribution network design optimization: simulated annealing approach
.
Journal of Water Resources Planning and Management
125
(
4
),
215
221
.
De Corte
,
A.
&
Sörensen
,
K.
2016
An iterated local search algorithm for water distribution network design optimization
.
Networks
67
(
3
),
187
198
.
Djebedjian
,
B.
,
Yaseen
,
A.
&
Abou Rayan
,
M.
2005
A new adaptive penalty method for constrained genetic algorithm and its application to water distribution systems
. In:
Ninth International Water Technology Conference
,
IWTC 2005
,
Sharm El-Sheikh, Egypt
,
17–20 March
.
Eusuff
,
M. M.
&
Lansey
,
K. E.
2003
Optimization of water distribution network design using the shuffled frog leaping algorithm
.
Journal of Water Resources Planning and Management
129
(
3
),
210
225
.
Ezzeldin
,
R.
,
Djebedjian
,
B.
&
Saafan
,
T.
2014
Integer discrete particle swarm optimization of water distribution networks
.
Journal of Pipeline Systems Engineering and Practice
5
(
1
),
04013013-1 04013013-11
.
Fanni
,
A.
,
Liberatore
,
S.
,
Sechi
,
G. M.
,
Soro
,
M.
,
Zuddas
,
P.
1999
Optimization of water distribution systems by Tabu Search metaheuristic
. In:
Computing Tools for Modelling, Optimization and Simulation
(
Laguna
,
M.
&
González-Velarde
,
J. L.
, eds).
, pp.
279
298
.
Fujiwara
,
O.
&
Khang
,
D. B.
1990
A two-phase decomposition method for optimal design of looped water distribution networks
.
Water Resources Research
26
(
4
),
539
549
.
Geem
,
Z. W.
2006
Optimal cost design of water distribution networks using harmony search
.
Engineering Optimization
38
(
3
),
259
277
.
Geem
,
Z. W.
2009
Particle-swarm harmony search for water network design
.
Engineering Optimization
41
(
4
),
297
311
.
Gomes
,
H. P.
,
Bezerra
,
S. T.
,
Carvalho
,
P. S.
&
Salvino
,
M. M.
2009
Optimal dimensioning model of water distribution systems
.
Water SA
35
(
4
),
421
431
.
Goulter
,
I. C.
,
Lussier
,
B. M.
&
Morgan
,
D. R.
1986
Implications of head loss path choice in the optimization of water distribution networks
.
Water Resources Research
22
(
5
),
819
822
.
Kennedy
,
J.
&
Eberhart
,
R.
1995
Particle swarm optimization
. In:
Neural Networks, 1995. Proceedings, IEEE International Conference on, 4
.
Perth, WA, Australia
, pp.
1942
1948
.
Kessler
,
A.
&
Shamir
,
U.
1989
Analysis of the linear programming gradient method for optimal design of water supply networks
.
Water Resources Research
25
(
7
),
1469
1480
.
Lansey
,
K. E.
&
Mays
,
L. W.
1989
Optimization model for water distribution system design
.
Journal of Hydraulic Engineering
115
(
10
),
1401
1418
.
Liberatore
,
S.
,
Sechi
,
G. M.
&
Zuddas
,
P.
2003
Water distribution systems optimization by metaheuristic approach
. In:
.
Balkema Publisher
,
Lisse, The Netherlands
, pp.
265
272
.
Liong
,
S. Y.
&
Atiquzzaman
,
M.
2004
Optimal design of water distribution network using shuffled complex evolution
.
Journal of The Institution of Engineers, Singapore
44
(
1
),
93
107
.
Loganathan
,
G. V.
,
Greene
,
J. J.
&
Ahn
,
T. J.
1995
Design heuristic for globally minimum cost water-distribution systems
.
Journal of Water Resources Planning and Management, ASCE
121
(
2
),
182
192
.
Maier
,
H. R.
,
Simpson
,
A. R.
,
Zecchin
,
A. C.
,
Foong
,
W. K.
,
Phang
,
K. Y.
,
Seah
,
H. Y.
&
Tan
,
C. L.
2003
Ant colony optimization for design of water distribution systems
.
Journal of Water Resources Planning and Management
129
(
3
),
200
209
.
Mohan
,
S.
&
Babu
,
K. S.
2010
Optimal water distribution network design with honey-bee mating optimization
.
Journal of Computing in Civil Engineering
24
(
1
),
117
126
.
Montalvo
,
I.
,
Izquierdo
,
J.
,
Pérez
,
R.
&
Tung
,
M. M.
2008
Particle swarm optimization applied to the design of water supply systems
.
Computer & Mathematics with Applications
56
(
3
),
769
776
.
Moosavian
,
N.
&
,
M. R.
2014
Hydraulic analysis of water distribution network using shuffled complex evolution
.
Journal of Fluids
,
Article ID 979706, 12 pages
.
Qi
,
X.
,
Li
,
K.
&
Potter
,
W. D.
2016
Estimation of distribution algorithm enhanced particle swarm optimization for water distribution network optimization
.
Frontiers of Environmental Science & Engineering
10
(
2
),
341
351
.
Quindry
,
G. E.
,
Liebman
,
J. C.
&
Brill
,
E. D.
1981
Optimization of looped water distribution systems
.
Journal of the Environmental Engineering Division
107
(
4
),
665
679
.
Raoni
,
R.
,
Secchi
,
A. R.
&
Biscaia
,
E. C.
2017
Novel method for looped pipeline network resolution
.
Computers & Chemical Engineering
96
(
4
),
169
182
.
Reca
,
J.
&
Martínez
,
J.
2006
Genetic algorithms for the design of looped irrigation water distribution networks
.
Water Resources Research
42
(
5
),
W05416-1 W05416-9
.
Reca
,
J.
,
Martínez
,
J.
,
Gil
,
C.
&
Baños
,
R.
2008
Application of several meta-heuristic techniques to the optimization of real looped water distribution networks
.
Water Resources Management
22
(
10
),
1367
1379
.
,
A.
,
Yoo
,
D. G.
,
Yazdi
,
J.
,
Kim
,
J. H.
&
Choi
,
Y.
2014
Application of water cycle algorithm for optimal cost design of water distribution systems
. In:
International Conference on Hydroinformatics
.
,
New York, NY, USA
.
Savic
,
D. A.
&
Walters
,
G. A.
1997
Genetic algorithms for least-cost design of water distribution networks
.
Journal of Water Resources Planning and Management
123
(
2
),
67
77
.
Shamir
,
U.
1974
Optimal design and operation of water distribution systems
.
Water Resources Research
10
(
1
),
27
36
.
Shi
,
Y.
&
Eberhart
,
R. C.
1998
A modified particle swarm optimizer
. In:
1998 IEEE International Conference on Evolutionary Computation Proceedings
.
Anchorage, AK
, pp.
69
73
.
Shrivatava
,
M.
,
,
V.
&
Khare
,
R.
2015
Multi-objective optimization of water distribution system using particle swarm optimization
.
IOSR Journal of Mechanical and Civil Engineering
12
(
6
),
21
28
.
Simpson
,
A. R.
,
Dandy
,
G. C.
&
Murphy
,
L. J.
1994
Genetic algorithms compared to other techniques for pipe optimization
.
Journal of Water Resources Planning and Management, American Society of Civil Engineers
120
(
4
),
423
443
.
Su
,
Y.
,
Mays
,
L. W.
,
Duan
,
N.
&
Lansey
,
K. E.
1987
Reliability-based optimization model for water distribution system
.
Journal of Hydraulic Engineering ASCE
113
(
12
),
1539
1556
.
Suribabu
,
C. R.
&
Neelakantan
,
T. R.
2006
Design of water distribution networks using particle swarm optimization
.
Urban Water Journal
3
(
2
),
111
120
.
Suribabu
,
C. R.
&
Neelakantan
,
T. R.
2014
Optimal upgradation and expansion of existing water distribution networks using differential evolution algorithm
.
Asian Journal of Applied Sciences
7
(
6
),
375
390
.
Van Dijk
,
M.
,
Van Vuuren
,
S. J.
&
Van Zyl
,
J. E.
2008
Optimising water distribution systems using a weighted penalty in a genetic algorithm
.
Water SA
34
(
5
),
537
548
.
,
T.
1973
Least–cost design of water distribution systems
.
Journal of the Hydraulics Division
99
(
9
),
1497
1513
.
Wu
,
Z. Y.
&
Simpson
,
A. R.
2002
A self-adaptive boundary search genetic algorithm
.
Journal of Hydraulic Research
40
(
2
),
191
203
.
Yates
,
D. E.
,
Templeman
,
A. B.
&
Boffey
,
T. B.
1984
The computational complexity of the problem of determining least capital cost designs for water supply networks
.
Engineering Optimization
7
(
2
),
143
155
.
Zhou
,
X.
,
Gao
,
D. Y.
&
Simpson
,
A. R.
2016
Optimal design of water distribution networks by a discrete state transition algorithm
.
Engineering Optimization
48
(
4
),
603
628
.