*2.1. Sensitivity Matrix for Leak Detection*

Installing sensors in the network to find anomalies requires the identification of strategical points, which should be as sensitive as possible to anomalies. Considering normal operation, the pressure at a node *i* at a time step *t* is denoted *P<sup>N</sup> <sup>j</sup>* . If an anomaly (e.g., a leak) is simulated as an increase of the demand at a given node *i*, the sensitivity at node *j* related to that anomaly at node *i* can be written as

$$s\_{i,j} = \frac{P\_j^N - P\_j^i}{q\_i},\tag{1}$$

where *P<sup>j</sup> <sup>j</sup>* is the pressure at node *j* at time step *t*, under the anomaly occurring at node *i*; *qi* is the leakage flow at node *i*.

The sensitivity matrix is calculated by simulating leaks at all nodes in the network. Row *i* of this matrix expresses the sensitivity of column nodes *j* to leaks *qi* at node *i*.

Several works have been proposed in the literature to model leakage in water networks [30,31]. In general, leakage can be modelled as a nonlinear function of pressure. The software Epanet2.0 [32], used in this research, models a leak through an emitter, and the flow is written as:

*qi* = *β* · *Pi <sup>α</sup>*, (2)

where *β* is the emitter coefficient, and *α* is the emitter exponent. The values of *α* and *β* depend on the leakage geometry, external environment, and other parameters. In this work, based on the the well-known orifice equation, the value of *α* is defined as 0.5. The emitter coefficient is discussed in the case study section.

Given a comprehensive representation of the network, especially focusing on its nodes, we assume that each node can potentially host a sensor, and proceed by quantitatively calculating the degree of interdependence between sensors in pairs. This approach aims to identify those nodes exhibiting great interdependence with the others, and thus, of most strategic value. Placing sensors in those nodes rather than in others would actually increase the control capability of the entire network.

Within this perspective, we propose a MCDM approach based on a modified fuzzy DEMATEL technique, presented later on.

## *2.2. Redundancy Analysis for Optimal Sensor Placement*

For optimal sensor placement, not only the most sensitive nodes should be monitored, as it is also important to maximise the coverage of the sensor network. In general, the more spread-out the sensors are, the higher the coverage. In this sense, a joint analysis of sensitivity and entropy can help improve the final sensor network.

From a physical approach, entropy is a property that measures the order/disorder level in a system. Mathematically, the entropy *H*(*X*) can be calculated as the product of the mass probability function *p*(*x*) of a variable *X* times the logarithm of its inverse:

$$H(X) = \sum\_{\mathbf{x} \in X} p(\mathbf{x}) \cdot \ln \frac{1}{p(\mathbf{x})}.\tag{3}$$

Considering the sensitivity matrix *S* composed by the elements *si*,*<sup>j</sup>* (1), and following the proposal of [7], the function *p*(*x*) is written as:

$$p(\mathbf{x}) = \frac{a\_i}{\sum\_{i=1}^{n} a\_i} \tag{4}$$

where

$$n\_i = \mathbf{m} \mathbf{x} \mathbf{s}\_{i\prime} \tag{5}$$

and s*<sup>i</sup>* is the *i*th row of matrix *S*.

In this sense, the entropy is calculated based on maximal sensitivity for a given leakage level.

Anomalies occurring in the network can be observed by one sensor and not by others. This is an important point for optimal sensor placement to optimise the coverage of the sensor network. The conditional entropy *H*(*Y*|*X*) has been used to measure the redundancy of data and was applied to sensor placement as presented by [33]. The conditional entropy represents the remaining entropy of a variable *Y* given the entropy of another variable *X*.

For sensor placement, in [33], it is shown that the increase of the total entropy leads to a wider coverage of the network. The increase of the total entropy can be reached by maximising the conditional entropy, expressed as:

$$H(Y|X) = \sum\_{\mathbf{x} \in X, \mathbf{y} \in Y} p(\mathbf{x}, \mathbf{y}) \cdot \ln \frac{p(\mathbf{x})}{p(\mathbf{x}, \mathbf{y})} \tag{6}$$

$$H(Y|X) = -\sum\_{\mathbf{x} \in X, y \in Y} p(\mathbf{x}, y) \cdot \ln p(\mathbf{x}, y) + \sum\_{\mathbf{x} \in X, y \in Y} p(\mathbf{x}, y) \cdot \ln p(\mathbf{x}),\tag{7}$$

$$H(Y|X) = H(X,Y) + \sum\_{x \in X} p(x) \cdot \ln p(x) = H(X,Y) - H(X). \tag{8}$$

A new matrix can be written, where the maximal sensitivity is used to calculate the probability function *p*(*x*) (Equation(4)) and then the conditional entropy (Equation (8)). The new matrix of conditional entropy is used to measure the influence of setting a new sensor in the network. Or, in other words, the influence of a monitoring node on the others.
