**4. Results and Discussions**

In this section, the results of the procedures described in Sections 2.1–2.3 are reported. The first step is the definition of an optimal water network partitioning. In this regard, the clustering phase was applied to produce 5 DMAs. The choice of 5 DMAs was made because the formula *Copt* = *n*0.28 proposed by Giudicianni et al. (2018) [45] to calculate the optimal number of clusters yields *Copt* = 4.3 for this WDN. The number of nodes for each DMA are DMA1 = 20, DMA2 = 35, DMA3 = 39, DMA4 = 41 and DMA5 = 49, with *Nec* = 21. For the dividing, the optimization through NSGAII yielded the Pareto front reported in Figure 1a, showing, as expected, growing values of median(*GRF*) with *Vl* growing. In fact, both variables are growing functions of the service pressure in the WDN. Figure 1b,c report the number *Nfm* of flow meters and the demand satisfaction rate *Ids*, respectively, re-evaluated from the Pareto front and plotted against *Vl*. Globally, Figure 1b highlights that the higher values of *Nfm* tend to be associated with the high values of *Vl*. This is because *Vl* tends to grow when fewer gate valves are closed (and then more numerous flow meters are installed) at the boundary pipes. Finally, Figure 1c shows that *Ids* tend to grow with *Vl* increasing, since both variables are increasing functions of the service pressure.

From the graphs in Figure 1, the solution with the lowest value of *Nfm* (= 8), highest number of closed valves *Ngv* (= 13), which ensures *Ids* = 100%, was finally chosen. An important remark to be made is that among the several advantages of the WNP, the adopted partitioning solution enables also reducing leakage, from 930 m3 (for the un-partitioned layout) to 895 m3 (partitioned solution with 13 gate valves closed and 8 flow meters installed). This corresponds to a 3.7% leakage reduction without negatively affecting *Ids* and *GRF*. In fact, for this solution median(*GRF*) is equal to 0.32, very close to the value of 0.36 for the un-partitioned network. The layout of the partitioned layout is reported in Figure 2. The optimal sensor placement is then carried out. The following assumptions were made for the construction of the set *S* of contamination events considered in the optimization:


**Figure 1.** Dividing phase considering the clustered graph of the Parete WDN (Variant 1). Pareto front of optimal solutions in the trade-off between daily median (*GRF*) index and leakage volume *Vl* (**a**), re-evaluated solutions in terms of number of flow meters *Nfm* (**b**), and of demand satisfaction rate *Ids* (**c**). In all graphs, the selected solution is highlighted with a grey vertical line.

The values reported above for mass injection and duration were sampled from those proposed by Preis and Ostfeld (2008) [55], using the procedure of Tinelli et al. (2017) [51], with the objective to obtain a representative smaller set of significant contamination events. Due to the previous assumptions, the total number *S* of contamination events was 182 × 24 × 1 × 1 = 4368.

The water quality simulations were run for 2 days of WDN operation to make sure that even contaminants injected close to the sources at the last instant of the first day had enough time to leave the network. In the optimization for sensor placement, the partitioned WDN layout was indicated as *Var1* to differentiate it from the original layout (*Var0*). Therefore, according to the three optimization options described in Section 2.2, optimizations were organized as follows:


4. *Var1Opt4*: Optimal sensor placement on the partitioned WDN allowing sensor installation on the nodes hydraulically upstream from the flowmeter fitted boundary pipes and on the most central nodes of each district (23 scenarios).

**Figure 2.** WDN partitioning into 5 DMAs.

Compared to *Var1Opt1*, *Var1Opt2*, *Var1Opt3* and *Var1Opt4* reduce the group of potential sensor locations respectively by 96%, 92% and 87%, resulting in a research space reduction which helps in diminishing the computational burden. The three optimizations were compared with the benchmark *Var0Opt1*, where all the 182 potential sensor locations are explored in the original layout. Table 1 shows the optimization framework, made up of 5 runs. In all of them, NSGAII was applied with a population of 200 individuals and a total number of 200 generations.

**Table 1.** Framework of optimizations for sensor placement in the Parete WDN.


For the optimizations that consider all nodes as potential sensor locations (*Var0Opt1*, *Var1Opt1*), the slow convergence of NSGAII was initially remarked towards interesting solutions for water utilities, which are solutions with a reasonably low number of sensors in comparison with the total number of demanding nodes. This problem was solved by implementing inside NSGAII a heuristic algorithm to correct solutions with numerous sensors, that is *Nsens* > 20. In this heuristic algorithm, for each NSGAII solution violating *Nsens* = 20, a random integer number within the range (1, 20) is generated, representing the target number of sensors for that solution. Then, starting from the initial value of *Nsens*, the least effective sensors in terms of pop are removed one by one to reach the target. Though increasing the computation time for each NSGAII generation by about 30 times, this algorithm proved to solve the issue of slow convergence. This heuristic algorithm was not applied to the optimizations *Var1Opt2*, *Var1Opt3* and *Var1Opt4*. This made the NSGAII optimizations in the two latter applications much lighter from the computational viewpoint.

Figure 3a reports the Pareto fronts obtained in optimization *Var0Opt1*, on the un-partitioned layout, and in optimizations *Var1Opt1*, *Var1Opt2*, *Var1Opt3* and *Var1Opt4*, on the partitioned layout. As expected, these fronts in Figure 3a show decreasing values of pop as *Nsens* increases up to 20. However, for high values of *Nsens*, the additional benefit of a further sensor installed in the network tends to decrease, as already pointed out by Tinelli et al. (2017) [56]. In the present work, *Nsens* = 6 appears to be the threshold of benefit for the installation of an additional sensor, slightly to right of the knee of the Pareto fronts (which lies around *Nsens* = 3).

**Figure 3.** For the original un-partitioned WDN (*Var0Opt1*), reported as benchmark, and for the partitioned WDN (*Var1Opt1, Var1Opt2, Var1Opt3* and *Var1Opt4*), Pareto front of optimal sensor placement solutions in the trade-off between *Nsens* and contaminated population *pop* (**a**), re-evaluated solutions in terms of *Nsens* and detection likelihood *Ps* (**b**), *Nsens* and detection time *Tmean* (**c**), and *Nsens* and redundancy *Red* (**d**).

Another point to highlight is that for the partitioned network, the contaminated population corresponding to the case of zero installed sensors (*pop* = 2458) is lower than the corresponding contaminated population for the un-partitioned WDN (*pop* = 2806) as shown in Table 2.

**Table 2.** Simulation results in terms of exposed population from the four optimizations for sensor placement in the Parete WDN, considering *Nsens* up to 6.


This points out the first advantage of the partitioning: by reducing the average number of possible paths in the network (due to the closure of some pipes), it produces a reduction in the contaminated population by around 12.4%. This is due to the reduction in the spreading of contamination (direct action). Furthermore, the WNP also enhances the results of optimal sensor placement (indirect action). As is shown in Table 2 for *Nsens* ≤ 6, *pop* for the un-partitioned WDN (*Var0Opt1*) is always higher than pop for the *Var1Opt1* for all the number *Nsens* of sensors installed in the network. The minimum value of pop = 462 is for *Var1Opt1*. *Var1Opt2* (sensors allowed only upstream from boundary pipes), *Var1Opt3* (sensors allowed only on topologically central nodes in DMAs) and *Var1Opt4* (sensors allowed upstream from boundary pipes and on topologically central nodes in DMAs) give similar results to *Var1Opt1* up to *Nsens* = 2. For *Nsens* > 2, *Var1Opt2* and *Var1Op3* degenerate while the good performance of *Var1Opt4* persists. This is evidence that constraining sensor installation only upstream from boundary pipes or on topologically central nodes may lead to remarkably sub-optimal solutions. However, the combination of locations upstream from the boundary pipes and of topologically central nodes offers a good set of potential locations in the problem of optimal sensor placements. Figure 3b–d report the results of the reprocessing of the optimal solutions in terms of detection likelihood, detection time, and redundancy as a function of *Nsens*. Along with Figure 3a, they give indications on the effectiveness of the solutions obtained in the NSGAII runs. Globally, the *Var1* solutions obtained on the partitioned graph, especially *Var1Opt1*, *Var1Op2*, and *Var1Opt4*, tend to perform better in terms of *pop*, detection time, and sensor redundancy. Conversely, they feature slightly worse values in terms of detection likelihood. This may be because the optimization was carried out considering pop as objective function, which is slightly contrasted with detection likelihood [56]. In fact, the former variable mainly contributes to the system's early warning capacity whereas the latter contributes to the system safety. As for Figure 3, it must be remarked that the curves in Figure 3a are Pareto fronts while those in the other Figure 3b–d are obtained by reprocessing the optimal solutions in terms of other assessment criteria. Since these curves are not Pareto fronts, they are not strictly monotonous. Figure 4 shows the sensor placement solutions obtained for *Nsens* = 6 with three optimizations (*Var0Opt1*, *Var1Opt1*, and *Var1Opt4*). In this context, it must be noted that the *Var1Opt4* solution has three of the six sensors placed close to flowmeters (the other three sensors are in the most central nodes according to the betweenness centrality). This solution yields managerial and economic benefits, due to the closeness of some sensors to installed flow meters and due to the possibility of sharing some electronical components for data acquisition, sharing, and transmission. Summing up, the *Var1Opt4* solution represents a quasi-optimal solution in the explored trade-off between *pop* and *Nsens*, while offering significant potentials for improved management. Another advantage compared to the *Var0Opt1* and *Var1Opt1* solutions with *Nsens* = 6 is that it was obtained at a much lower computation cost (about 1/30), due to the research space reduction mentioned above for Options 2–4. Overall, the advantages in terms of computational lightness during the optimization as well as the possibility of inspecting

and maintaining sensors in proximity to flow meters make solutions obtained in *Opt4* preferable from the water utilities' viewpoint. The results highlighted that nodes close to flow meters used for the monitoring of DMAs, which must always be easily accessible sites, represent good sensor locations for WDN monitoring from contaminations, when they are inserted into an optimization framework that also includes topologically central nodes inside DMAs. As for the optimal positions of the sensors in *Var1Opt1* (partitioned network and all nodes as potential candidates) and Var1Opt4 (partitioned network and sensor installations restricted to entry points and central nodes in DMAs), it must be remarked that many locations are similar in the two cases (see Figure 4). This corroborates the fact that entry points and central nodes in DMAs are good candidate locations in the present case study.

**Figure 4.** Optimal location of 6 sensors in (**a**) original un-partitioned WDN (*Var0Opt1*), (**b**) partitioned WDN (*Var1Opt1*), and (**c**) partitioned WDN (*Var1Opt4*).
