International Journal of Engineering

Extensive research have been conducted to optimize the water distribution networks, but none has simultaneously considered the economic-mechanical and hydraulic properties of the networks. Moreover, the entropy difference in the various networks has not been exactly calculated. Therefore, the present study suggests a modified entropy function for computing the information entropy of the water distribution networks to calculate the demand nods and entropy difference amongst the various networks considering the mechanical and hydraulic properties of the network. This modification is carried out by defining a coefficient in entropy function as the output amount in every node by the exponent of all the power wasted in the network. Furthermore, the most optimum diameter and the most economic state are obtained simultaneously using the ant colony algorithm (ACO). Thus, considering all the three mechanical, hydraulic, and economic properties of the network while keeping simplicity, a more realistic method will be offered using these two metaheuristic methods. The efficiency of the proposed method was evaluated in some of the sample water networks using the modified function doi : 10.5829/ije.2023.36.05b.14


INTRODUCTION 1
Water distribution system is a network of source nods, links, demand notes, and other hydraulic components like pumps, pipes, and tanks. Water distribution systems substantially serve the water supply on the surface and a sufficient amount of water pressure to all the users and fire extinction purposes. Quantifying the reliability of the water distribution networks, as a vital system [1,2], also, repair and maintenance of water system [3]. In recent decades, the basis of reliability of water distribution networks has been defined based on receiving a sufficient source of demand and pressure required by the consumer [4]. Various researchers have proposed in several scales of reliability for water distribution networks, and some of them include an alternative scale.
Some reseaerchers have suggested that entropy as a general performance index is possible for the water distribution systems [5]. This method possesses several advantages in contrast to the other performance indices and reliability; as an example, its calculation is very fast and simpler than the other scales; it needs the least amount of data, and it can be directly embedded in the designs' optimization frameworks [6]. and it can be a scale for system redundancy [7].
The redundancy of water distribution networks is especially important because when links fail to provide the required services, additional links will be replaced [7]. Closely interrelated with reliability, redundancy is a mostly neglected aspect of the system's general performance. Past earthquakes show that a redundancy index can dramatically increase network reliability. In other words, networks with more redundancies are more reliable against failure [8]. Therefore, redundancy can be considered an alternative scale for calculating the reliability of the water distribution networks.
It seems that Awumah et al. [5,7] were the first researchers who suggested using Shannon's entropy [9]. As an alternative scale for computing the reliability of the water distribution networks. Later on, Tanyimobh and Templeman [10] used a multiple probability space model and conditional probability. Khinchin, [11] proposed a more appropriate definition of entropy function for water distribution networks. They, also, created a nonrepetitive algorithm for finding the maximum entropy of the current distribution in the single-source networks. In their study, the network's topology, current direction in every link, and supply-demand in every node were considered; while, some of the other parameters like length, diameter, and coarseness of the link were ignored. A nearly extreme number of current distributions is possible unless the network is found in the tree branch type. This non-repetitive algorithm was formulated using the path entropy concept [12]. Using the concept of the super-source, they also endeavored to expand the singlesource algorithm for covering multi-source networks, and it has been proved not to be consistent with the research conducted by Walters [13]. In another study, Yasin-Kassab et al. [14] presented a non-iterative algorithm based on a single source algorithm to calculate the current distribution entropy in multi-source networks. Later, the relationship between entropy and reliability of water distribution networks was investigated by Tanyimboh and Templeman [6]. Their study showed that the higher the entropy of water distribution networks, the greater the reliability.
Hosseini and Emamjomeh [15] used a simple water distribution network to examine the meaning of network entropy. Their research examined the relationship between the total power wasted by the water distribution network and the numerical value of the entropy of the network. Ang and Jowitt [16] used a simple ring network with its link diameter ranging from zero to infinite and endeavored to calculate entropy. The related network entropy and the wasted energy for the water distribution network were investigated in other work [5]. Also, Hosseini and Emamjomeh [17] in 2014 were able to obtain acceptable results by modifying some of the hydraulic and mechanical parameters. They offered an alternative method for calculating the entropy of the water distribution systems, and expressed this new concept of network entropy. The path entropy method (PEM) provided a simpler concept of network entropy and maximum water distribution network entropy. PEM's formula was presented based on the various paths for a water molecule's movement from an extraordinary source towards a super sink. Further explanations about PEM will be given herein later on. Ang and Jowitt [18] discussed about observations on energy loss and network entropy in water distribution networks.
In defining the entropy function, Templeman and Tanyimboh [19] defined the networks with an amount of redundancy can have an alot can considerably increase the reliability of the system disregarded the differences between the branching-tree networks featuring different plans as well as the number of the identical demandsupply nodes, all of which with identical PEM diagrams. Hosseini and Emamjomeh [17] proposed a new weight ratio based on each penalty number equal to the amount of damage in case of failure in order to overcome the problem. The order of the demand nodes in the network was considered in entropy calculations by considering a new coefficient in the entropy function.
The highest redundancy indices for water distribution networks are based on hydraulic or mechanical characteristics of the network, meaning that none of them considers both of the properties in its calculations. However, the network risk is intensively influenced by both of these properties. Thus, the present study aims at investigating the deficiencies of the prior definitions of water distribution network's entropy and suggesting a novel scale based on weighted entropy for the evaluation of the reliability of water distribution networks in terms of the system's mechanical and hydraulic properties Finally, economic optimization is performed using the method of meta-exploration algorithm of the ant community.

ENTROPY FUNCTION FOR WATER DISTRIBUTION NETWORKS
The formulation of the entropy function relies more on Shannon's [9] uncertainty scale, and this is a fundamental principle in information theory. Tanyimboh and Templeman [10] were the first one to develop a suitable entropy function using the multiple probability and conditional probability space model [11]. Flow direction has a significant effect on maximum entropy, which has not been considered in previous studies. In addition, the length, diameter and coarseness of the joints are not directly applied in their formulation. There will be a large number of possible current patterns except in branch networks. The entropy function of the network developed by Tanyimboh and Templeman [10] is calculated according to the following formula: S is the entropy, k is Boltzmann constant, is assumed to be 1, N is the total number of nodes, and S0 is the entropy of the external input current.
In this relationship, I is the system of all the source nodes, and P0i is calculated according to the following relation: where, q01 is the external current flowing into the i-th source node, and T0 is the amount of the total supply or total demand. The second term in the entropy function is composed of the weighted entropy sum for each of the nodes (Sn), and the weight of each (Pn) is defined in the form of the ratio of the total inflowing current for every node to the total inflowing current for the entire network as shown beneath: where, Tn is the total current flowing out of node n. The important point in the definition of the out-flowing current is that the outflow incorporates all the needs in the related node. The weighted entropy of each of the nodes (Sn) is calculated from the following relation: Where, Tn is the total outflow from the node n. Another important point in defining the outflow is that it encompasses any demand in the node. In Equation (1), the entropy of the outflow from every node (Sn) is given according to the following relation: where, NDn is a system of all the currents flowing out of the node n: where, qnj is the current flowing from node n to node j. The entropy function in Equation (1) displays that the entropy of a water distribution network is comprised of two parts. The entropy of the externally inflowing current (S0), as the first component, is uncertain. Figure 1 shows a sample network with two sources and four demand nodes as well as details of entropy calculations.

PATH ENTROPY METHOD FOR CALCULATING THE ENTROPY OF WATER DISTRIBUTION NETWORK
As stated in the theoretical foundations of entropy section, Information entropy measures the degree of uncertainty in a situation or system. That is, the entropy of a water distribution network should be defined according to the number of paths available for a water molecule to move from the source point to the point of consumption. Based on this perspective, there is offered Figure 1. A sample network with two sources and four demand nodes as well as the entropy calculations' details [19] another alternative method by Ang and Jowitt [16] for calculating the entropy of a network, and it is called the entropy method. The PEM diagram in the first step involves determining the number of paths of the source node according to the paths of the consumption node and drawing a PEM diagram with all its nodes and links. In the second step, the flow through each link by examining the flow rate in all network links.
Calculating the entropy of a PEM network is relatively simpler compared to the network entropy equation proposed by Tanyimboh and Templeman [12]. The true power of PEM is its ability to provide new insights into the meanings of network entropy, such as the entropy of branched tree networks and the maximum current entropy of a single-source network with a specified flow direction ( Figure 2). Figure 3 shows the sample network PEM shown in Figure 4 as well as its entropy calculations.

OF ENTROPY FUNCTION
As mentioned by Walters [13], all of the branching-tree networks at least have identical entropy values. Ang and Jowitt [16] showed this reality using the path entropy method. Figure 5 shows all of the various plans of the branching-tree networks related to the sample network displayed in Figure 4.
As shown in Figure 5, there is only one path from the source node to the demand node in all cases. Therefore, from the perspective of information, all of them essentially have identical entropies.
For the tree sample network in Figure 6, it has been shown that various diagrams can be applied for displaying each PEM plans. However, in the definition by Templeman and Tanyimboh [10], there is no difference between the tree networks featuring different configurations.
Examining the networks shown in Figure 5, it is clear that some of them are more sensitive to damage to one of their links. For example, if the 3-1 link in networks (d), (c) and (e) in Figure 5 is damaged due to earthquake hazards, the loss rates will be 30, 10 and 5 liters per second, respectively. Therefore, the amount of service losses in a network, in addition to the series or parallel mode of the network, also depends on the connection of different consumption nodes to the source node.  Various states of the demand-supply connections in the branching-tree networks are shown in Figure 6 [16,17] As shown in Figure 7, according to the four modes shown, the fourth pattern has the most redundancy because each demand node has a separate path to the source and the failure of each link does not affect the other nodes. Conversely, the first model is the most vulnerable water distribution network because each sphere depends on the previous node.
Hosseini and Emamjomeh [17] defined a penalty value (TP) for every link in order to add the effects of the connection states and orders that actually determine the sensitivity of a network. Based on these penalty values, the new weight ratio (P′n) was introduced, as explained in the following words. They defined the amount of every link's penalty as being equal to the amount of damage imposed onto the network in case of cessation in repairing (7).
Where the numerator is the outflow discharge rate, and the denominator is the penalty functions for all of the network's links. Where TP is the sum of the penalty factors for all of the network's links, they used this weight ratio instead of the prior ratio, i.e., P′n, in Equation (1).  The amount of entropy (S') for all of the branchingtree networks shown in Figure 5 based on the modifications by Hosseini and Emamjomeh [15] can be seen in Table 1, according to which only network (i) has an entropy value similar to what has been suggested by Tanyimboh and Templeman [10] because each demand node in this network is separately connected to the source. The amount of entropy in the networks featuring more node connections to the source is notably reduced with the new weight ratio. Therefore, Hosseini and Emamjomeh [15] could define a new weight index (P′n) in entropy function to modify the effect of the order of connection in the network's demand nodes as well as the difference between the various branching-tree networks. Considering the results shown in Table 1, in the case of using the entropy functions modified by Hosseini and Emamjomeh [15], the same entropy amount is calculated for branching-tree networks (d) and (e). However, it can be observed through a more exact analysis of these two networks that in case of the detachment in link 2-1 in network (d), the amount of the scattered water would be 20 l/s. Therefore, the needs of the second consumer would not be met. If the same link fails in a network (e), the amount of the scattered water would be 25 l/s. Therefore, the needs of the second and the fourth consumers would not be satisfied. Thus, network (d), in contrast to a network (e), features higher reliability and, in case of considering entropy as the reliability scale, it has to be larger in a network (d) as compared to a network (e). Resultantly, the modifications by Hosseini and Emamjomeh [17] cannot determine the real differences in the reliability rates of various networks with the identical mechanical specifications, to wit length, diameter and coarseness coefficient. In addition, the reliability of the various networks with diverse mechanical properties cannot be measured with this modified version. As a specimen, if the length, diameter, or substance is changed in one of the branching-tree networks, the effect of this change on the entropy amount cannot be measured using this entropy function. In the next section, a new ratio will be offered in entropy functions so as to be able to consider both the mechanical specifications and hydraulic properties of the network in entropy calculations. Additionally, the connection order of the network's demand nodes and the differences in the various networks will be investigated with more precision.

IDENTIFICATION OF THE FLAWS IN THE PREVIOUS DEFINITIONS OF ENTROPY FUNCTION AND OFFERING A NEW FUNCTION
As it was concluded in the previous section, the entropy function offered by Tanimboh and Templeman [19] has two substantial flaws even with all the changes that have been brought about therein. Firstly, not both the mechanical and hydraulic properties of the network have been considered in this function; especially, only the rate of the flow through the links has been taken into account in entropy calculations. Besides, the mechanical parameters like length, diameter, and coarseness of the link have been ignored in entropy calculations, whereas it is evident that the above mentioned parameters have many effects on the amount of entropy as a scale of the network's reliability. Secondly, considering all the changes made in the entropy function, they could not show the numerical difference between the branchingtree networks of different types with identical numbers of sources and demand nodes. In the current research paper, the wasted power has been utilized for considering the mechanical characteristics of the network, such as length, diameter, and coarseness of the links, along with the hydraulic specifications. Moreover, after linking to EPANET Software, the best diameter and the best entropy were obtained with the result being the most optimum economic state, and based on the amount of the wasted power calculated for each link, a new P″n ratio was defined for every network node. The equation took the following form: In the above relation, Tn, like the relation proposed by Tanimboh and Templeman [19] is equal to the amount of water that flows out of node n, and Tpw is the total power wasted in the network, and it is equal to the sum of power wasted in all of the network's pipes, and it is expressed in the following form: Pwi is the power wasted in every pipe, and nl is the total number of the network's pipes. The power wasted in every pipe is calculated from the following relation.

= ℎ
In the above relation, is the water density in kg/m 3 , g is the earth gravity's acceleration in m/s 2 , hi is the amount of head loss in every pipe in m, and Qi is the flow rate in the i-th pipe in m 3 (11) where Li is the length of the i-th pipe in m; Di is the diameter of the pipe i-th in m; Ci is the coarseness coefficient of the i-th pipe, and Ki is the resistance coefficient of i-th pipe in s/m 2 . Replacing the relation (11) in relation (10) gives the amount of the power wasted in i-th pipe in watts (w) as shown underneath: = 2.85 (12) Following the calculation of the new weight coefficient ( " ) for every node, it was substituted for the previous weight coefficient ( ) in the entropy proposed by Tanimboh and Templeman [19]. With the new coefficient, the modified entropy function takes the following form: If, in the relation (12), the amount of ρ is set equal to a, can be written in the following form: In fact, the denominator of the new weight coefficient's fraction is in the form of ∑ 1 =1 2.85 while the denominator of the coefficient's fraction defined by Hosseini and Emamjomeh [17] is in the form of ∑ 1 1 =1 . It means that the denominator of the new coefficient's fraction is a nonlinear function of the discharge rate.
The other notable point about the proposed coefficient is the amount of diameter for the calculation of the power wasted in every link. The diameter influences the amount of current passing through the links. Put differently, the amount of current passing through the links changes with the change in diameter, and this creates new conditions in terms of the network's hydraulic status, which necessitates any specific entropy state. Due to the same reason, in the various states of the current in a network, the diameters of all the links are assumed to be fixed for the calculation of the power wasted in the links. As for the diameter of the networks' links, this number can be the diameter of the network's links or the largest diameter in the network or even unity. Thus, in the forthcoming sections that try investigating the reliability of a network in various flow states, a fixed value would be considered for the diameter.
The amount of entropy in tree networks shown in Figure 5 has been offered in Table 2 based on the modification made by Hosseini and Emamjomeh (s') [17] and the modification made herein ( ̅ ). In the calculation of the wasted power, the length of the peripheral pipes is equal to 1000m, the diameter of all the pipes is equal to 400mm, and the coarseness coefficient of all the pipes is equal to 130. For instance, the details of calculating the entropy of branching-tree networks (b) shown in Figures  3 and 4 are as explained below: Considering Table 2, it is observed that the amount of entropy is larger in the network (d) in comparison to the amount of entropy in the network (e) with the modifications made in this research, and this is consistent with what was expected.

INVESTIGATING THE BEHAVIOR OF THE ENTROPY FUNCTION PROPOSED IN PARALLEL NETWORK
A parallel network with two links, as shown in Figure 8, has been used for the investigation of the behavior of the function proposed for the parallel networks. In this network, the inflow rate, the lengths of the links, the diameters of the links, and the coarseness coefficient of the links are respectively 30 l/s, 1000m, 400mm, and 130. If the flow speed of the first link is set at x, the speed of the second link's flow would be x-30. Based on the function proposed herein, the changes in the entropy of the parallel network in regard to x have been shown in Figure 9, and, as seen therein, the amount of entropy is larger for the two closer links. Specifically, the maximum entropy occurs when the amounts of flows through two links are exactly identical. Put another way, the maximum amount of entropy would be equal to x=15, and the entropy function's diagram would be symmetrical in regard to this amount. These changes are exactly based on our expectations about the entropy's behavior.

INVESTIGATING THE BEHAVIOR OF THE ENTROPY FUNCTION SUGGESTED FOR THE RING NETWORK
A network with one supply node and three demand nodes, as shown in Figure 10, will be used for the   Figure 10. The sample ring network with a source node and three demand nodes [20] evaluation of the entropy function. In order to evaluate the entropy function suggested by Ang and Jowitt [18], this network was used in the ring networks used by Tanimboh and Templeman [19]. The heights of the source node and demand nodes were respectively 100m and 99m. The length, diameter, and coarseness coefficient of all the links are identical, i.e., equal to 890m, 400mm, and 130. Figure 11 shows three various states of flow directions. Table 3 displays the entropy amounts calculated using Taniymboh and Templeman's method (s) and Hosseini and Emamjomeh's [15] modified method (S') and the entropy method proposed in this research (S"). Considering Figure 11, it can be concluded that the reliability of network (a) is larger than the network (b) and reliability of network (b) is larger than that of the network (c). in fact, the breakage in link 2-1 in networks (a), (b) and (c) respectively causes wastage of water for 10, 22.5 and27.5 liters per second. Moreover, the maximum difference between the flow rates in the network's links   Figure 11 using three discussed functions in the state (a) is 10 l/s, while this difference in (b) and (c) states is respectively 20 l/s and 25 l/s. Based on these two realities, the network is expected to have a larger entropy in the state (a) as compared to the state (b), and it is also expected to be larger in the state (b) than in state (c). However, table (3) shows that although the amount of entropy in the network (a) is larger than the amount of entropy in networks (b) and (c), the amounts of entropy in networks (b) and (c) are identical using the first method. And based on the modified function proposed by Hosseini and Emamjomeh [17], the amount of entropy in the network (b) is larger than the amount of entropy in the network (c), and the amount of entropy in a network (c) is larger than the amount of entropy in the network (a). In the end, it is worth mentioning that the amounts of entropy calculated by the method proposed herein, as seen in Table 3, are consistent with our expectations. In other words, the amount of entropy in the network (a) is larger than the amount of entropy in the network (b), and the amount of entropy in the network (b) is larger than the amount of entropy in the network (c).

OPTIMIZATION OF RELIABILITY AND ECONOMIC OPTIMIZATION OF THE SAMPLE NETWORK USING THE ANT COLONY METHOD AND THIS STUDY'S PROPOSED ENTROPY FUNCTION
One of the most important issues about the entropy of the water distribution networks is the relationship between the amount of entropy and the reliability of the network. In the study performed by Tanyimboh and Templeman [6], use was made of various hydraulic networks with different numbers of links and various rings, and it was proved that this relationship is strong. Resultantly, they concluded that the networks with higher entropy feature higher reliability. In this section, the relationship between the proposed entropy function and the network's reliability as well as the controlling of the network's parameters in hydraulic, mechanical, and economic matters will be investigated via linking to MATLAB program and EPANET Software. In this study, the following network was used for the same purpose; it has also been used by Tanyimboh and Templeman [6] for comparing their own entropy function with others in this network.
The configurations presented in Figure 12 have been divided in terms of their links to five groups, including a network with 17 links and configurations with 13, 14, 15, and 16 links. In this section, the goal is to find a network with the minimum cost, maximum entropy, and lowest loss. Thus, after hydraulic analysis of the 64 states in EPANET Software for every network, the rate of the flow passing through the links, the flow speed in the links, and the amount of the head loss in every link was extracted and, using this information, the wasted power of each link and the total wasted power of the network was calculated. Having this information and clarifying the direction of the flow in the links, the entropy can be calculated for every network with three investigated functions (the entropy function proposed by Tanimboh and Templeman [19] the one modified by Hosseini and Emamjomeh [17], and the one modified in this research paper). The entropy function has been calculated for 64 states and, using the comprehensive ant algorithm prepared in MATLAB Software and linked to EPANET software; the lowest diameter was set in such a way that the hydraulic specifications of the network are satisfied.
The amounts of the input information for every network and the amount of the entropy were investigated based on the three discussed methods of S, S' and S" as well as by the utilization of the comprehensive ant colony algorithm which was presented herein; resultantly, the best network states were obtained in economic terms and in regard of the network parameters' satisfaction. Figure 12. Sample water distribution network with one source node and 11 demand nodes [6] After the specification of the amounts of the networks' entropy, finding the optimum network becomes feasible.
In this section and in the first stage and from amongst each group of the networks and considering the number of the links, the network the entropy of which is largest according to the entropy function modified herein with its total head loss being the lowest in that network is introduced as the optimum network. To do so, the networks with an identical number of links are organized firstly based on the maximum loss in the network; then, the loss and entropy amounts are normalized to the maximum amount, and the loss and networks' entropy diagrams are delineated in a system. Based on these diagrams, the network with the lowest loss and highest entropy is selected as the best network.
The reliability of the network's general structure has been displayed in Figure 12. As it is seen, this network has one source node and 11 demand nodes with various demand rates. The lengths of all the links and their coarseness coefficients are respectively 1000m and 130. The heights of the source node and demand nodes are respectively 100m and zero. Diverse plans can be designed for this network. As it is shown in Figure 13, use was made of six various plans in this research. Using the entropy function proposed by Tanimboh and Templeman [19], these networks have been designed in such a way that the rate of flow discharge in various links should have maximum entropy with the least cost. Table  4 gives the related diameters and the speed rates of the links for the patterns shown in Figure 13 [6]. One of the formulations for the calculation of the network's reliability is the function proposed by Tanyimboh and Templeman [6], Therefore, the final formula of the single-source water distribution network can be expressed as follows: In the above formula, R is the network's reliability, P(0) is the possibility of having no access to the link, P(m) is the possibility of having no access to the only link m, and P(m, n) is the probability with which m and n might be inaccessible. Similarly, T(0), T(m), and T(m, n) are the total flows that are available in enough pressure and without any link with only link m being unavailable and with m and n links being respectively unavailable. In the end, M is the abbreviation for the number of links, whereas T indicates the total demand [6]. The reliability rates of the plans shown for four superior designs as specified in the optimizing software along with their entropy amounts have been presented in Table 5 based on the entropy function proposed by Tanyimboh and Templeman [6] (S) and the function proposed herein ( ̅ ).  As it is seen, the decrease in the reliability rates of various arrangements causes reductions in the amounts of the network's entropy in general based on the entropy function proposed by Tanimboh and Templeman [19] and the function proposed in this research paper. Therefore, the entropy function proposed herein is exactly directly associated like in the entropy function proposed by Tanimboh and Templeman [19] with the network's reliability, but, in addition to the advantages of the function proposed by Tanimboh and Templeman [19], the entropy function proposed herein and written simultaneously in MATLAB and EPANET and enabling the optimization of the diameters by ACO algorithm can consider both the best mechanical and the hydraulic states of the network, and this leads to the most optimum economic state.

COMPREHENSIVE ANT COLONY SYSTEM (ACS) USED IN THIS STUDY
In order to provide a higher possibility of more control over the creation of a balance between the explorations and productions, Dorigo and Gambardella suggested a comprehensive ant colony system by Bulm and Roli [20].
In the above formula, q is a value within the range of (0, 1). q0 is the factor of the exploration's productivity (0≤ 0 ≤ 1). If q> 0 , the defined probability function would be in match with the probability function defined for AS. And, if q> 0 , the path with the highest amount of [ ( )] × [ ] , would be chosen with a probability of unity and the probability of choosing the other paths in the branched routes in the decision point i would be zero, or it can be stated in summary that the path with the maximum amount of [ ( )] × [ ] , will be chosen in every decision point i. As it is observed in the above relation, exploration and production are both included in both of the cases. If q> 0 , the exploration phenomenon would be included and if q> 0 , the production phenomenon would be included.
In this algorithm, the commands' synchronization is carried out in both online and offline forms. Online synchronization in this method is in such a way that the commands of this path are immediately synchronized when an answer is constructed in a single iteration, and this iteration would be applied for the next ants. This is conducted in the form of the following formula: (1 Furthermore, offline synchronization is also carried out in this method in addition to online synchronization, as well. For offline commands' synchronization, we will have the following according to the formula given below: It means that when all of the ants constructed their answers in one iteration, the best answer constructed in this iteration would be applied for the synchronization of the paths' commands in the next iteration.

CONCLUSION
Considering the various water distribution networks studied herein and the numerical results offered in this study, it can be concluded that the metaheuristic method is a good scale for analyzing the reliability according to the mechanical, hydraulic, and economic aspects of the water distribution networks. The entropy in the water distribution networks can be a proper scale for evaluating the reliability of the networks exposed to natural or artificial dangers. The more the number of the network's specifications for calculating the entropy, the more real the scale for the calculation of the reliability. After investigating the extant methods suggested by several researchers for the calculation of the entropy of water distribution networks and their modification by various researchers, it was figured out there are two essential flaws. Firstly, all of them have just considered the flow rate of the links, whereas they have fallen short of considering the network's mechanical specifications like length and coarseness coefficient of the links. Secondly, despite the changes recommended for these functions, they cannot show the numerical difference between the various tree networks having the identical number of source and demand nodes as well as the different kinds of flow directions in a given network. In order to overcome these two flaws and improve the evaluation of the reliability in these networks, the present study made some modifications to the proposed entropy function. This modification enabled the evaluation of the water distribution network's reliability via considering the mechanical specifications (the head loss in the network) for a number of the networks, and it was made clear that the proposed function, though being simple, can take into account the order of the connection between the source and demand nodes as well as the difference between the various water distribution networks and also the effects of the both Numerical results show that in each network group, according to the number of links, the most optimal design has the highest entropy, and using the optimizer program (ACO), the most optimal diameter can be obtained as shown in Table 7. Brought. In this study, the most optimal entropy state is simultaneously placed in the optimizer software designed by the Ant Society Algorithm (ACO) and at the same time all hydraulic, mechanical and economic characteristics are controlled and the most optimal state is extracted, so we can answer. It is more economical and reliable to use entropy exploration methods and comprehensive ant algorithm in water distribution networks. In general, the goal is to optimize both in terms of reliability and at the same time to be economically viable design, which in this study using two meta-exploration methods (entropy and ant community algorithm) this has been achieved.