The Modiﬁed Artiﬁcial Fish Swarm Algorithm for Least-Cost Planning of a Regional Water Supply Network Problem

: A regional water supply network (RWSN) plays a key role in the process of urbanization development. This paper researches the planning optimization model of a regional water supply network with the payo ﬀ characteristic between economical cost and reliability, in which the hydraulic-connectivity is selected as the surrogate measure of the reliability in the regional water supply network. The modiﬁed artiﬁcial ﬁsh swarm algorithm (MAFSA) is proposed to solve the optimization problem by adjusting research visual and the inertia weights of artiﬁcial ﬁsh swarm algorithm (AFSA) according to the hydraulic-connectivity. The experiment results of regional water supply network show that MAFSA can e ﬀ ectively obtain the optimal solution with the maximum reliability and least cost compared to other algorithms, which can thereby achieve the optimization of RWSN engineering applications.


Introduction
The regional water supply network (RWSN) (mainly including water intake project, water purification project and pipeline network subsystem) are typically part of an aging infrastructure, which faces challenges to efficiently and sufficiently serve a growing population and urbanization development under more stringent economic and environmental constraints. The water distribution network is the largest investment of the regional water supply system, which the optimal planning of water supply network affects the economy and reliability of the regional water supply networks [1]. The planning of the regional water supply network is a complicated project involving the scale of pipe network, initial flow distribution, pipelines, and so on [2]. Therefore, the optimal planning of the RWSN will influence the investment in the regional water supply system, which can safely and reliably transport water to every demand node of the network through water distribution pipelines.
The traditional optimization methods for the water supply network are those that distribute the flow of the pipe section firstly, then determine the diameter of the pipeline base on the flow rate, and make the hydraulic calculation according to the diameter of the pipeline, and finally obtain the water tower height and the pump head. The traditional method only considers the minimal cost for pipe laying under hydraulic conditions. However, the optimal design scheme of water supply network system can meet the actual project requirements for water quantity, water quality and hydraulic pressure, which have great practical significance for reducing energy consumption and promoting social and economic benefits. Therefore, this paper will formulate the multi-objective function subject Otherwise, the process selects new state x j again within the distance., If it still cannot find x j according to the f (x i ) < f (x j ) after attempting to try a number of times, the artificial fish will execute another behavior.
Swarm behavior: the artificial fishes often form the large group. This behavior should follow two principles: one is that the artificial fish will swim toward the center of its fellows around; the other is the swarm should avoid being over-crowded. The n f is the number fellows within visual scope of x i artificial fish. If n f /N < δ (0 < δ < 1), then the swarm is not a crowd. After comparing the food concentration at x i and the center of its fellows x c , if f (x i ) < f (x c ) then the artificial fish will swim towards to x c . Otherwise, the artificial fish execute another behavior.
Cluster behavior: this behavior means that the swarm of fish will follow the best fish finding more food. If the artificial fish is at x i , and fish swarm within its visual scope is at x max , compared the food concentration at x i and x max .
If f (x i ) < f (x max ) and n f /N < δ(0 < δ < 1), then the food concentration at x max is higher and the swarm is not a crowd. So the artificial fish will swim toward the x max . Otherwise, the artificial fish executes other behavior.
Random roam behavior: each artificial fish will make the random searching process, which is helpful for getting rid of the local optimum. The next state of artificial fish is x next : The individual artificial fish will choose different behaviors according to the perception from information of its environment. The artificial fish of AFSA searches the local solution within its visual scope, and the global optimal solution will be found by the cooperation of the fish swarm.
The performance of AFSA relies on the properties of visual scope, congestion factor, search step. This paper proposes the modified artificial fish swarm algorithm (MAFSA) by adjusting the parameters and the dynamic evaluation strategy, which can efficiently obtain the optimal solutions of the water supply network problem.
Compared with traditional optimization algorithms, the artificial fish swarm algorithm (AFSA) has parallel computational ability and adaptive ability to search a global optimal solution, which is fit for solving the NP hard problem and has been widely used in many fields.

Methodology
3.1. The Problem Statement for Least-Cost Planning of Regional Water Supply Network Problem

Model Description
For the planning optimization of a RWSN, four aspects should be considered: the water quantity, water pressure, reliability and economy. The traditional network optimization model only considers the economy, which means to get the minimal cost for pipe laying under the hydraulic conditions. Based on the classical optimization model, this paper constructs the multi-objective function integrated reliability and economical targets, whose reliability is to provide enough water and water pressure under the abnormal condition; the economical target is to get the least-cost layout of pipeline network.

Mathematical Formulation
Under the condition that the pipe network layout, water pressure of the water source, water requirement of nodes, minimum water pressure requirement and optional standard pipe diameter specification are known, the optimal planning of a regional water supply pipe network is to seek a set of optimal pipe diameter combinations which can meet the pressure demand of node flow and the minimum cost of water pipeline network [15] MinW = p 100 + (A/P, I, T) In Equation (3), W is the annual conversion cost of the pipe network, J is the number of pipelines, H 0 is the node free head, Q tot is the total flow of the pipe network or the flow of the pump station, H j is the head loss of the pipe section j. P is the percentage of the cost of maintenance and annual depreciation of the pipe network, which is calculated according to the construction cost of the pipe network. LM is the collection of pipes belong to any pipeline from pump station to control point M, K pipeline is an economical index related to pumping cost, D j and l j are the diameter and length of pipe j respectively, (A/P, I, T) is the capital recovery factor. Its formula is: I(1+I) T /[(1 + I) T −1], Among them, T is the lifespan of the pipe network and I is the expected rate of return. a + bD a j is the cost of pipe construction per length (including the cost of pipes and buried pipes), where a, b and α are the statistical parameters of the cost per length of pipeline.
The objective function of the pipe network optimization is based on the series of constraint equations, and the hydraulic constraints are as follows: Flow node continuity constraints: In Equation (4), Q j is the flow of node j, and q ij represents the flow of pipeline connected with node i, where i and j are the starting and ending node numbers of the segment. Each node in the pipe network should satisfy the continuity equation.
Energy balance constraints: In Equation (5), H j is the free head loss of the pipeline base ring. Energy balance constraints are also called loop constraints. The algebraic sum of head loss is zero in the closed loop.
Node pressure constraints: where H j is the water pressure of the jth node. Diameter constraint: In Equation (7), D j is the standard diameter set and min is the minimum diameter. In the optimization design of the pipe network, the selection of pipe diameter must be within the standard discrete pipe diameter in the market, and be larger than the minimum required pipe diameter.
Flow velocity constraint: If the velocity of the water flow is too slow, residual chlorine will precipitate and the chlorine concentration of the end pipeline will decrease. Therefore, the minimum velocity of water flow is set. If the current velocity is too fast, a water accident will occur. Therefore, the upper limit of the velocity is set.
Water supply constraints: The maximum water consumption of each pipeline network should be equal to the supply quantity of the water resource, and each pipeline should satisfy the constraints of the minimum hydraulic quantity and the maximum capacity of the water supply.

Initialization of Artificial Fish Swarm Algorithm
The modified AFSA algorithm solves the problems of a water supply network, whereby the artificial fish will follow the pre-set number of the pipeline network one by one to choose the proper pipe. The initial state of artificial fish X is {X 1 , X 2 , X 3 , . . . , X i } (I = 1, 2, . . . , n), in which each individual fish expresses the element numbers in the solution of the effective scheduled paths. The artificial fish individual adopts integer coding by each diameter of pipe (such as {2 cm, 4 cm, 6 cm, 8cm, 10 cm, 12 cm, 20 cm}),which will assigned in the fish swarm X i = {X 1 , X 2 , . . . , X n }, such as X i = {1-5-2-4-6-3-7} to represent the required diameter. When the fish is in pipeline i, it will use the fitness function FC = f (X ij ) to calculate the probability that choose the diameter of pipe j, where x i is optimization variable, D ij = X i − X j (i,j = 1, 2, . . . , n) express the distance between fish x i and xj, δ is congestion factor (0 < δ < 1), try number is the maxi-attempt number of artificial fish. Visual is the search scope of artificial fish, N = {X j |d ij < Visual} is the search neighborhood.

Dynamic Swarm Behavior Based on the Isobaric Line of Pipeline Network
In order to display the distribution of hydraulic pressure, it is necessary to draw an isobaric hydraulic chart according to the pressure of each node during the planning of regional water supply network, in which the isobaric line is evenly distributed and the hydraulic gradient of each pipeline within the reasonable range. If the hydraulic pressure line is dense, then the hydraulic gradient is sharp and the pressure of the pipeline is heavy. On the contrary, if the water pressure line is sparse, then the hydraulic gradient is inclined and the pressure of the pipeline is light [16].
Assumed the coordinates of (X 1 ,Y 1 ,H 1 ), (X 2 ,Y 2 ,H 2 ) are the starting point and the end point of the pipeline, where X, Y are coordinate value and H is hydraulic level value, then the hydraulic pressure of the first equivalence point is: where int (X) is the standard function. The hydraulic pressure of the last equivalent point is: The middle equivalent point is the integer between P max and P min . Because the pipeline of the network has a standard calculated flow, the loss pressure of the head is proportional to the length of the pipeline. The coordinates of each isobaric points can be calculated according to the proportionality between the hydraulic pressure of the isobaric points on the pipeline network. The coordinates of the P i equivalent point can be obtained through Equation (12).
Take the above method to search for equivalent points of each root pipeline. The hydraulic isopiestic line of the whole pipe network is drawn, though the line of the equivalent points surround adjacent segments. Dynamically adjust the searching visual and moving step of the modified AFSA according to the Equation (13).

The Information-Oriented Preying Behavior
The constraints of energy, flow velocity and hydraulic pressure of pipeline should be considered in the optimization of water supply network. The hydraulic loss of pressure h ij and closure error of flow node Q ij can be calculated according to the Hazen-Williams equation [17].
where, L is the length of pipeline, C is the Hazen William's coefficient, D is the pipe diameter.
If E i and E j are the pressure of ith and jth node, then: Equation (15) mean the relationship between hydraulic pressure of node and loss of pipeline head, Equation (14) mean the relationship between hydraulic pressure of node and pipeline flow. Equation (17) is as follows: SGN is the symbolic function: The new state of X j is randomly selected from neighborhood within visual. If the fitness of X j is better than that of current state X i , then the modified AFSA changes search direction according to Equation (18), which can improve the optimization convergence of the AFSA. The swarm behavior of the modified AFSA algorithm can be represented as Equation (19): The X i , is the current state the X inext is next state of artificial fish, Rand () is the random number within [0, Step]. If the fitness FC j of X j is better than FC i of X i , then it moves one step in this direction. Otherwise, else that the new state X j is selected randomly.

Clustering Behavior
The modified AFSA algorithm should follow two rules during the clustering behavior: 1) move to the center of the neighboring partner as far as possible; 2) avoid overcrowding.
Rule 1: If X i is the current state of artificial fish, and N f is the partner number within visual scope, then X ck is the center of X i neighborhood, as in Equation (20).
Rule 2: Setting the crowding factor δ = 1 + n f /N. If Y ck /δ > Y i (δ > 1) indicates that the center position X ckß has more food and is not crowded, the fish swarm make cluster to the center according to Equation (21), or else the artificial fish will perform chasing behavior.

Chasing Behavior
X i is the current state of artificial fish, X max is the best state of artificial fish set in the neighborhood. If FC max > FC i and n f /N < δ, then it will chase towards partner X max where they have more the food and are not too crowded, or else adopt preying behavior.

Random Behavior by Competition Mechanism
In order to enhance the searching ability of modified AFSA, the optimal individual X gbest of artificial fish is retained. When the modified AFSA has minimal change in the search process, the artificial fish algorithm will perform mutation operations with the optimal individual X gbest using the Hardy-Cross method [18].
where X i and X j are random selected artificial fish individuals (i j), τ is random number within [0,1]. If the offspring X gbest is better than the parent, then X gbest is replaced by X gbest .

The Termination Conditions of the MAFSA Algorithm
If the maximum iteration number or the optimal solution within the satisfactory bound has been reached, then the MAFSA algorithm terminate and output the optimal solution, otherwise the algorithm return to step 3 and continue the Swarm behavior. The optimization procedure of MAFSA is shown in Figure 1. If the maximum iteration number or the optimal solution within the satisfactory bound has been reached, then the MAFSA algorithm terminate and output the optimal solution, otherwise the algorithm return to step 3 and continue the Swarm behavior. The optimization procedure of MAFSA is shown in Figure 1.

Benchmark Experiment
The benchmark experiment is two-loop network studied by Keedwell and Khu 2005 [19]. The two-loop network consists of a reservoir, seven nodes and eight pipelines, which are fed from a single fixed head reservoir to supply the demands as shown in Figure 2 where node 1 is the reservoir. The

Benchmark Experiment
The benchmark experiment is two-loop network studied by Keedwell and Khu 2005 [19]. The two-loop network consists of a reservoir, seven nodes and eight pipelines, which are fed from a single fixed head reservoir to supply the demands as shown in Figure 2 where node 1 is the reservoir. The hydraulic head requires all the demand nodes at 30 m above the elevation, the source water is 210 m, the equal length of each pipeline is 1000 m, water flow is 1120 m 3 /h. Tables 1 and 2 show the list of all 12 available pipe sizes and their unit costs. The hydraulic calculation method is used for the planning of the pipeline network, and the Hazen William's coefficient is taken as C = 130 for all pipes.

Benchmark Experiment
The benchmark experiment is two-loop network studied by Keedwell and Khu 2005 [19]. The two-loop network consists of a reservoir, seven nodes and eight pipelines, which are fed from a single fixed head reservoir to supply the demands as shown in Figure 2 where node 1 is the reservoir. The hydraulic head requires all the demand nodes at 30 m above the elevation, the source water is 210 m, the equal length of each pipeline is 1000 m, water flow is 1120 m 3 /h. Table 1 and Table 2 show the list of all 12 available pipe sizes and their unit costs. The hydraulic calculation method is used for the planning of the pipeline network, and the Hazen William's coefficient is taken as C = 130 for all pipes.    300  250  75  40  350  300  100  55  400  450  150  80  450  650  200  115  500  850  250 160 600 1250 The parameters of MAFSA are as follows: the artificial fish population is 100 placed in the source of water distribution network, the maxi-iterations number is 200, the visual scope is 0.5, the try number is 5, the congestion factor δ is 0.8. Considering the algorithm's schedule efficiency, the artificial fish swarm is coded as natural number according to the pipe diameter; set the pheromone of every pipe diameter as constant τ = 10.67. If the τ is larger, then the water head loss will become larger, which will increase the cost of pipeline in the design scheme. The modified AFSA are implemented in C++ (Bell Labs, Murray Hill, NJ, USA). All the tests were run on the computer with CPU Intel (R) Core (TM) i7-7500U (Intel, Santa Clara, CA, USA), with 16 gigabytes RAM and using the Xpress Optimizer Version 8.6 with the default options. The results of pipeline network optimization are shown in Table 3. Savic [20] used GA to solve the problem and got the lower cost scheme of 0.420 million, which the hydraulic pressure of each node meets the requirement of 294 kPa. The MAFSA obtained the lowest cost of water distribution network 0.419 million, which all nodes meet the constraint Equations (4)- (9). Compared with the Savic, the modified AFSA can obtain the same results of the pipe network and satisfy the hydraulic pressure of 30 m. Figure 3 shows that the modified AFSA algorithm can obtain the optimal solution in the 75th iteration, and the convergence speed is higher than that of the genetic algorithm [21]. The simulation results show that the modified AFSA algorithm with dynamic intelligent search mode is effective suitable for the design of the water supply network.

Case Study of Water Distribution Network
Since the proposed methodology has been shown to be effective for the pipes-only RWSN planning problems, this paper should focus on applying the proposed methodology to deal with the RWSN problems including pumps, valves and pipes in the Jinghua District of Zhejiang Province, China. To provide flexibility, the optimization problem of the water supply network is the multivariable optimization solved by the MAFSA under multiple loading conditions. The regional water supply network deployment is shown in Figure 4.

Case Study of Water Distribution Network
Since the proposed methodology has been shown to be effective for the pipes-only RWSN planning problems, this paper should focus on applying the proposed methodology to deal with the RWSN problems including pumps, valves and pipes in the Jinghua District of Zhejiang Province, China. To provide flexibility, the optimization problem of the water supply network is the multi-variable optimization solved by the MAFSA under multiple loading conditions. The regional water supply network deployment is shown in Figure 4.
An expanded rehabilitation problem is considered where the variables are the tank sizing, tank siting, pipe rehabilitation decisions and pump operation schedules. In order to verify the stability of the algorithm, we set the parameters of MAFSA and run the program 500 times. The optimal solutions has been obtained and the compared results of experiment are shown in Table 4. The cost of the solution includes the capital costs of pipes and tanks as well as the present value of the energy consumed during a specified period. Optimization tends to reduce costs by reducing the diameter of, or completely eliminating, some pipes, thus leaving the system with insufficient capacity to respond to pipe breaks or demands that exceed design values without violating required performance levels. Results show the modified AFSA can effectively and stably search for the optimal solution.
Since the proposed methodology has been shown to be effective for the pipes-only RWSN planning problems, this paper should focus on applying the proposed methodology to deal with the RWSN problems including pumps, valves and pipes in the Jinghua District of Zhejiang Province, China. To provide flexibility, the optimization problem of the water supply network is the multivariable optimization solved by the MAFSA under multiple loading conditions. The regional water supply network deployment is shown in Figure 4. An expanded rehabilitation problem is considered where the variables are the tank sizing, tank siting, pipe rehabilitation decisions and pump operation schedules. In order to verify the stability of the algorithm, we set the parameters of MAFSA and run the program 500 times. The optimal solutions has been obtained and the compared results of experiment are shown in Table 4. The cost of the solution includes the capital costs of pipes and tanks as well as the present value of the energy consumed during a specified period. Optimization tends to reduce costs by reducing the diameter of, or completely eliminating, some pipes, thus leaving the system with insufficient capacity to respond to pipe breaks or demands that exceed design values without violating required performance levels. Results show the modified AFSA can effectively and stably search for the optimal solution.

Conclusions
The regional water distribution network is a critical infrastructure of urban facilities. Therefore, the planning of the water distribution network must be economical and scientific. This paper researches the multi-objective evolutionary algorithms for planning optimization of a regional water supply network, which formulates the multi-objective model of reliability and economical cost for the regional water supply network according to the hydraulic connectivity. However, the planning of the water supply network is a non-linear and NP-hard optimization problem with many constraining variables. The modified artificial fish swarm algorithm is applied to optimize the planning of the water supply network by dynamic swarm behavior and preying behavior. The experimental results show that the MAFSA can obtain the global optimal solution with high convergence speed compared to other algorithms, which meets the engineering requirement that every demand node in the RWSN is connected to at least one supply source with required flow at adequate pressure.