The selection of monitoring locations within drinking water distribution networks (DWD Ns) is of primary importance to guarantee consumers safety. In order to estimate the monitoring performances of diffe rent potential layouts (i.e., configurations of monitoring locations) and select the best option , a simulation -based validation is required. While few methodologies to guide events ’ selection for this validation have been developed, most of the m fail to properly capture the most impactful events and the heterogeneity in DWDNs operating conditions, not considering the inherent uncertainty in water demands within the DWDNs. In this study we extend a previously developed methodology to target the monitoring layout validation towards the most impactful events, and including water demand uncertainty. The de veloped methodology was tested on a literature benchmark DWDN, highlighting how optimal performances against generic events do not guarantee consumers’ protection against the most impactful ones. Furthermore, using two real- world DWDN s, it was shown how ne glecting water demand uncertainty leads to an overestimation of the detection likelihood of monitoring layouts. Finally, the effect of increasing minimum detection concentration of a generic harmful compound was assessed. Higher minimum detection concentra tions resulted in lower detection probabilities, especially in case of larger DWDNs, while their effect on the average minimum detection time depended on the DWDN characteristics. Keywords: Drinking water distribution networks ; monitoring; water alteration events; water demand variability; scenario analysis 1. Introduction The drinking water distribution networks (DWD Ns) play a key role in ensuring consumers’ safety , being located between the outlet of the treatment plants and the consumers’ hom es and potentially being subjected to contaminations (Robertson et al., 2003) . The importance of DWDNs monitoring has been increasingly recognized with water utilities expanding monitoring programs into the networks , using both manual grab sampling programs (da Luz and Kumpel, 2020; World Health Organization, 2017) and with the installation of on- line sensors (Zulkifli et al., 2018) to catch water quality alterations due to backflows, cross- connections and other intrusions in DWDNs (USEPA, 2002) . However, monitoring such infrastructures is not trivial. Due to the DWDN s size, it is nor practical or feasible to monitor all possible locations. In addition, due to the high degree of interconnection, water and eventual contaminants might reach the consu mers from multiple pathways, confounding the potential contamination source (Gong et al., 2023) . Finally, DWDNs operating conditions , such as pressure, flow rate and direction , depend on the behavior of drinking water consumers and are both highly dynamic (Brentan et al., 2017) and characterized by an intrinsic degree of uncertainty (Shastri and Diwekar, 2006) . Therefore, simulation -based and graph- based strategies have been developed to identi fy monitoring layouts , i.e., configurations of monitoring locations, that maximize the coverage against water quality alteration events , while minimizing the number of monitoring locations. While the former set of techniques rel ies on hydraulic DWDN models and optimization algorithms, the latter group of methods is less computationally demanding and requir es only details regard ing the DWDN morphology (Hu et al., 2018) . In any case, in order to select best layout among different potential alternatives , a set of water alteration events needs to be simulated to estimate the performance of each monitoring layout , for example evaluating the likelihood of detecting a water quality alterations and, especially in case of sensors are used, the time required to do so (Rathi et a l., 2015; Rathi and Gupta, 2015) . A critical aspect in the validation process lies in the high computational requirements given by the number of operating conditions and water quality alterations that need to be simulated to cover all possible scenarios (Krause et al., 2008; Mu et al., 2021) . To reduce such burde n, previous studies have selected subsets of events either randomly (Rathi and Gupta, 2015) or following specified heuristics (Tinelli et al., 2017). However, such procedure s are likely to miss rare and highly impactful events, leading to erroneous estimations of consumers ’ protection (Perelman and Ostfeld, 2010) . For this reason, Weickgenannt e t al. ( 2010) introduced a method, named Importance -Based Events Sampling (IBES), which guides the selection of validation events by assigning a simulation probability to each event based on a first estimation of its hydraulic importance. Notably, monitoring performances of a monitoring layout can change when focusing on highly impactful events , rather than generic ones. In light of this , it is not known whether monitoring layouts providing optimal performances for generic events will also result optimal to detect highly impactful events. This also extends to the comparison of the performance between simulation- based and graph- based layout identification strategies. In fact, even though comparable performances have been found between simulation -based layout identification strategies and graph- based ones (Giudicianni et al., 2020) , it is not known whether this is also true for highly impactful events , representing an important knowledge gap for water utility managers . In addition, even though calibrated models are used in the validation of monitoring layouts, such models might be not fully representative of the actual conditions within DWDNs. In fact, demand patterns can change in response to specific events and holidays , and also with seasons and weekdays (Alvisi et al., 2021; Brentan et al., 2017) . Such variability can result in changes in the flow direction (Shastri and Diwekar, 2006) , changing the water sources within the DWDN (Gabrielli et al., 2023) . Hence , not taking into account this inherent stochasticity might provide inaccurate evaluation of the monitoring performances of a selected layout . Finally , as the type of potential water quality alte rations are not known in advance, validation procedures should be general enough to be adapted to the simulation of different contaminants without aggravating the computational burden. Methodologies dedicated to specific contaminants have been developed (Ohar et al., 2015) , but most studies focus on monitoring layouts able to detect any non- zero concentrations ( e.g., Giud icianni et al., 2020; Zhao et al., 2016) or a single fixed value (Zheng et al., 2018) , providing either unrealistic estimates of events detection or neglecting the differences between different contaminants. This is not optimal for water utilities. In fact, th e possibility to estimate and compare the performances of monitoring layouts with different minimum detection levels with limited computational effort would enable water utilities to not only select the best option for a given contamination scenario, but also to evaluate the differences that could be expected for the detection of specific contaminants or using different monitoring technologies. For these reasons, this study extends the IBES method to account for the stochasticity of water demands and provides a conceptual model to estimate monitoring performances in case of different contaminants and/or sensitivity of the analytical methods. The eIBES (extended IBES) method was then used (i) on a literature benchmark DWDN to estimate the difference in performances due to the focus on important events , and on two real -world case studies to evaluate (ii) the effect of the inclusion of water demand uncertainty and (iii) the effect of increasing minimum detection concentration on monitoring layouts performances. 2. Materials and methods 2.1 Development of the extended Importance -Based Events Sampling Method The IBES method proposed by Weickgenannt et al. ( 2010) focuses on the most impactful events by conducting a preliminary hydraulic simulation. From this simulation, the cumulated water volume flowing through node n j from time ti to time ti+Δt, where Δt represents a specified time window, is estimated, representing the hydraulic importance value to each couple ( ti,nj). These values are then converted to probability values by means of normalization with respect to the total sum of matrix entries and used to weight the probability of simulating the couples (ti,nj), representing pollution events’ starting location and time. In such a way, while more emphasis is given to highly impacting events, also smaller ones are simulated, ensuring the protection of all consumers. To take into account the inherent stochasticity of consumer water demands without the need of external data, the eIBES method exploits the periodic signal of the water demand patterns , commonly included in calibrated hydraulic models , to introduce the water demand uncertainty by a set of synthetic patterns. In order to generate the synthetic patterns, the original deterministic patterns were split in three additive components by the means of a decomposition in seasonal and trend patterns using Loess regression (STL decomposition ; Cleveland et al., 1990) : average daily patterns, trend and random variability. The random component was used to fit a Gaussian distribution to generalize the stochastic noise present in water demands. Random extraction of values from this distribution were summed to the other two components to generate Q novel synthetic patterns, considerable as alternat ive stochastic realizations o f the original deterministic pattern. As a DWDN hydraulic model usually comes with a set of P demand patterns, each assigned to a district of nodes, such procedure was applied to all the demand patterns, resulting in a total am ount of Q P demand patterns due to the combination of the different patterns. A set of S demand scenarios was randomly selected out of all the QP generated, and each of them was used to perform a DWDN hydraulic simulation, computing the corresponding S importance sampling matrix. Then, the 95th percentile of the ( ti,nj) couple s were estimated and normalized by their sum, obtaining the percentages used to guide the random selection of N validation events, as in Weickgenannt et al. ( 2010) . During validation, when a ( ti,nj) couple was selected to be simulated, the corresponding simulation was conducted with the demand patterns which resulted in the importance closest to the 95th percentile. Doing so ensures the original aim to select a validation set composed predominantly of highly impacting events , without neglecting lesser impacting ones, and also considering the possible variability in water demands. 2.2 Adapting validation results for different water alteration scenarios In order to estimate the monitoring layouts performances considering different water alteration scenarios, a proportion- based strategy was devised. C X,DWDN and CX,intr are the concentration s of pollutant X, respectively, in baseline DWDN conditions and in the intrudi ng water , and W% is a percentage ratio between the volume of intruding and distributed water at the intrusion node. Then, the pollutant concentration at the contaminated node can be calculated as a weighted average: CX,node = (C X,intrW% + CreprX,DWDN )/(1 + W %) Eq. 1 where C reprX,DWDN consist s of a representative C X,DWDN value (i.e., the mean) (Teunis et al., 2010) . Considering a variability around CreprX,DWDN , either due to the measurement uncertainty and/or the concentration variability within the DWDN, one can assume the minimum detectable concentration as a significant deviation from standard water quality conditions: CX,min.det. = CreprX,DWDN + z97.5 * σ(C X,DWDN ) Eq. 2 where z 97.5 represents the 97.5th percentile of a standard Gaussian distribution percentile. Ultimately, a proportion factor between the expected concentration at the intrusion node and the minimum detectable concentration can be calculated as : R = C X,node / CX,min.det. Eq. 3 This value is, then, exploited to define an equivalent minimum detection concentration to be fixed as new detection limit in the estimation of the performances of the monitoring layouts without performing new simulations: CX,min.det.equiv. = C simulated / R Eq. 4 2.3 Case studies 2.3.1 Literature b enchmark case study A literature benchmark DWDN (Ostfeld et al., 200 8) was analyzed to compare the effect of importance -based sampling on the monitoring performance of monitoring layouts. T he DWDN is composed of 126 nodes, 168 pipes, one water source and presents a daily dynamic water demand. Different monitoring layouts composed of five monitoring locations were included in the validation. Such layouts were obtained both from literature studies em ploying state -of-the- art simulation -based methods (Ostfeld et al., 2008; Zhao et al., 2016) , and using several graph- based techniques obtained varying edges weights, graph clustering algorithms and centrality measures, similar to p revious studies (Di Nardo et al., 2017; Giudic ianni et al., 2020) and as explained in details in Section S1 in the Supplementary Information (SI). The combination of the selected edges weights, cluster algorithms and centrality measures resulted in a total of 160 layouts for a given number of locations. NetworkX v2.3 (Hagberg et al., 2008) and python- igraph v0.8.2 (Csardi and Nepusz, 2006) were used for the monitoring layouts estimation. As only a daily water demand pattern is present within this DWDN model, precluding a successful STL decomposition, an uncertainty comparable t o the ones of real -world DWDNs was applied (data not shown, see section 2.3.2 for details about real -world case studies ) to generate the synthetic water demand patterns. After the generation of the synthetic water demand patterns, an eIBES validation was performed simulating 100 different events using WNTR v0.4.0 (Klise et al., 2017) . Similarly to previous studies (Giudicianni et al., 2020; Ostfeld et al., 2008; Tinelli et al., 2017; Weickgenannt et al., 2010) , the selected water quality alteration events were simulated considering the presence of a conservative (i.e., not degrading) pollutant introduced at a fixed concentration for a time window of 16 h at the outlet of the contam inated node. The duration of each quality simulation was set equal to 72 h with a discretization time step of 5 min. The simulated events were used to estimate monitoring layouts performances and comparing them with literature values . 2.3.2 Real -world case studies Two real -world DWDNs supplying mid- to-large towns were used to assess the effect of the stochastic generation of synthetic water demand patterns on DWDN hydraulics and to estimate the difference in monitoring layout performances. The details of the hydraulic models provided by the managing water utility are presented in Table 1. Table 1. Main features of the tested real-world case studies. DWDN C DWDN R Size mid-scale large -scale Nodes 982 10,329 Drinking Water Treatment Plants ( DWTPs ) 2 10 Pipes 730 8,215 Pumps 4 0 Valves 273 2,393 Demand patterns 3 9 A set of 200 synthetic demand patterns was generated for each of the original patterns, which were then randomly combined to define a set of 100 demand scenarios used to estimate the 95th percentile hydraulic importances in each case study. Hydraulic importances were estimated considering a ti me window Δt of 16 hours and a temporal resolution of 5 min. These importances were then used to sample 250 and 2500 events for respectively DWDN C and R (i.e., approximately 25% of the total nodes) , in order to achieve a set of simulations covering the mo st of the DWDN both with respect to the location of the water quality alteration and its starting time. Such events were simulated either with the use of synthetic patterns following the eIBES methodology (Section 2.1) or with the standard pattern present in the model , in order to check the difference in the results associated to the inclusion of demands uncertainty. Water quality simulation setting were kept equal to the ones used for the benchmark DWDN. Such set of simulations was then used to validate th e performances of several monitoring layouts identified through graph- based strategies (see section S1 in SI) and composed of a number of monitoring locations between three and seven. The performance of the monitoring layouts was tested both considering an ideal situation (i.e., detecting any concentration different from zero) and also with three scenarios with increasing equivalent minimum detection concentrations ( C X,min.det.equiv. ). The features of each scenario are summarized in Table 2 assuming a 1% percentage ratio between the volume of intruding and distributed water at the intrusion node (Teunis et al., 2010) and using DWDN baseline and intruding concentrations either derived from data provided by the managing water utility or from literature (Besmer et al., 2017; Gabrielli et al., 2021; Henze et al., 2008) . Table 2. Main features of the contamination scenarios. Cmin. eq. values have been estimated considering Csimulated = 1 g/L. Scenario I Scenario II Scenario III Pollutant Bacteria cells [cells/μl] Total organic carbon [mg/l] Ammonium [mg/l] CX,intr 147,000 100 20 CreprX,DWDN 73 0.2 0.05 σ(CX,DWDN ) 51 0.1 0.05 CX,node 1,542 1.20 0.25 CX,min. det. 172.96 0.40 0.15 CX,min.det.eq iv. 112.15 330.55 593.19 2.3.3 Monitoring layouts performance evaluation For each simulated event, pollutant s concentrations were computed at every couple ( ti,nj) and then used to estimate the value of two different performance metrics for each monitoring layout (Rathi et al., 2015) : - Average detection likelihood (detLik) [ -]: the percentage of detected events by a certain layout compared to all the simulated ones, considering an event as detected by the layout if at least one monitoring location observes a concentration above C X,min.det.eqiv. . - Average minimum detection time (de tTime) [min]: the arithmetic mean of the minimum time needed by the monitoring layout to detect the water quality alteration in at least one node belonging to the monitoring layout . In addition, to provide further opportunity for comparison with literature , the average consumed volume of contaminated water prior to detection (consVol) [m3] was estimated for the benchmark DWDN. 3. Results and discussion 3.2 Effect of events selection using importance sampling As detecting all the possible water quality alteration events with a limited number of monitoring locations is not feasible, priority should be given to the detection of the potentially most impactful ones (Pere lman and Ostfeld, 2010; Weickgenannt et al., 2010) . However, most studies have validated the proposed monitoring layouts using either all or a uniform subset of the events considered possible (i.e., traditional validation) (Rathi and Gupta, 2015; Tinelli et al., 2017) , biasing the results of their evaluations toward the large number of smaller events simulated. The change in performances between a traditional or a eIBES validation was evaluated by re -estimating the performances of state -of-the-art simulation -based monitoring location strategies, obtained on the benchmark DWDN using layouts composed of five monitoring locations obtained from Ostfeld et al. (2008) and Zhao et al. ( 2016) . Results deriving from events simulated through eIBES were , then, compared to the original publications and among the different layouts (Figure 1). As eIBES tends to select water quality alteration events with higher hydraulic importance, a clear difference can be seen in the performances estimated using the two different methods . Indeed, “more important” events affect larger areas of the DWDN, leading to higher detLik values. Simultaneously, thanks to their spread, such events are characterized by a greater effect on drinking water ’s consumer s (i.e. higher eIBES validation consVo l), even though they are detected more rapidly (i.e. lower traditional validation detTime) than the generic event simulated using a traditional validation. Noteworthy, this fact has operational implications . As the former performance metric is more related to the direct effect on human health of drinking water consumers than the latter, this result stresses the importance to validate monitoring layouts with respect to the potentially most impactful events. However, within e IBES results a high correlation is present between detTime and consVol (Spearman correlation; ρ = 0.9, p- value < 0.001), remarking the importance of, not only, a timely detection of the water quality alterations, but also of their management (Ostfeld et al., 2008) . Figur e 1. Performances of the monitoring layouts in Ostfeld et al. (2008) and Zhao et al. (2016) from the original literature study (marked as “Literature”) and eIBES. No detTime values were provided by the layouts in Zhao et al. (2016). Markers indicate the performance obtained by the monitoring layouts through a literature or an eIBES validation, while horizontal lines highlight the difference between the two results, being colored as the validation obtaining higher values. As it can be noted in Figure 1, the performance differences between the two validation sets varied greatly between the tested monitoring layouts, leading to different relative performances between them. In fact, the monitoring layouts presented by Zhao et al. ( 2016) provide strictly better performances than the ones provided by Ostfeld et al. (2008) with a traditional validation (Zhao et al., 2016) , the opposite result was found when considering the impactful events selected by the eIBES validation, as shown in Figure 2: monitoring layouts from Ostfeld et al. (2008) present in general lower detTime and higher detLik than the ones provided by Zhao et al. (2016) , indicating their Pareto -dominance. Furthermore, even within each single study, the relative performance of the different layouts differs between the traditional and the eIBES validation. In fact, li mited (Spearman correlation; ρ < 0.57) or non-significant (p-values > 0.05) correlations were found between the different performance metrics (detLik, consVol, minTime) obtained using the traditional validation and the eIBES one. Such lack of correlation can lead the Pareto -optimal layouts previously identified within each study to become Pareto - dominated, as two of the solutions provided by Zhao et al. ( 2016) and highlighted in Figure 2. In addition, in contrast with the previous traditional validation by Perelman and Ostfeld (2013) , the performances of several graph -based strategies presents lower detTime and similar detLik values than most simulation -based layouts. In details, while Perelman and Ostfeld (2013) reported the layouts of Krause et al. (2006) and Preis and Ostfeld ( 2006) as achieving more favorable performances than the graph- based methods tested, using the eIBES validation, the se layouts resulted in higher detTime values than a large fraction of the graph -based ones (Figure 2). In addition, the detLik value achieved by Preis and Ostfeld ( 2006) resulted lower than most other graph- based layouts. These results indicate how the optimization of the monitoring performances with respect to all the possible events does not necessarily result in enhanced protection against the highly impactful events. With respect to the “important” events, graph -based and current simulation - based strategies offer similar performances, supporting the application of gr aph-based methods to select monitoring layouts with only limited information, confirming the conclusion of Giudicianni et al. (2020) . However, it needs to be noted that monitoring layouts with more favorable performance s are likely to be expected using simulation- based methods developed specifically towards the detection of the “ most important” events. Figure 2. Detection likelihood (detLik) and average minimum detection time (detTime) of literature simulation - based and graph- based layouts. The density curves on the top and left of the main plot illustrate the probability density of the detTime and detLik for each group of layouts considered. Asterisks indicate the two monitoring layouts from Zhao et al. (2016) which result Pareto -dominated by the other layouts from the same stu dy, while the