*2.4. Symbiotic Organism Search (SOS)*

The SOS algorithm [56] is an evolutionary metaheuristic algorithm inspired by actual biological interactions in nature, such as mutualism, commensalism, and parasitism. Like other population-based algorithms (e.g., a GA and PSO), the SOS shares the following similar features: (1) Control parameters should be properly settled before operation; (2) it has operators to enhance or improve candidate solutions via the interaction of each solution; (3) it has a selection mechanism to determine the current optimal solution in the solution domain and preserve the current best solution during the process [56,57]. Furthermore, the SOS algorithm requires no algorithm-specific parameters. Only the initial ecosystem (population) size and the maximum number of iterations are needed.

In short, the organisms (solutions) in the ecosystem are guided toward the current best organism in mutualism and commensalism states, while the parasitism state is used to prevent the organisms trapping in a local optimal solution. These three states are repeated until the stopping criterion is achieved. Details about the SOS algorithm are given in the Supplementary Materials.

#### *2.5. Inverse Transient Analysis (ITA)*

The ITA introduced by Pudar and Liggett [58] was developed by minimizing the errors between the measured and calculated system state variables (i.e., pressure or flow rates). Various potential faults with unknown parameters (fault information) are tested in a numerical simulator until the measured state variable traces match the calculated ones [4]. A heuristic algorithm is a useful tool for the numerical simulators of ITA because it can explore global or near-global optimum solutions in the search space in an affordable time [28]. However, the ITA method relies on an accurate transient model of the system. A model consisting of transient and boundary conditions with correct system parameters is needed in ITA for obtaining a reliable transient response in the system [5]. The pressure measurements are theoretically more suitable than the volume measurements (i.e., flow rate) because the response of the pressure is more sensitive than that of the flow rate in the ITA [59]. Transient flow is not easy to precisely measure in practice with a very high sampling rate, when only the pressure can be measured. The objective function *F* in the proposed approach for fault detection is defined as

$$F = \text{Min} \sum\_{j=1}^{m} \sum\_{i=1}^{n} \left( H\_{ij}^{o} - H\_{ij}^{s} \right)^{2},\tag{14}$$

where *m* is the total number of observation points in the network; *n* is the total amount of data at an observation point; and *H<sup>o</sup> ij* and *<sup>H</sup><sup>s</sup> ij* represent the *i*th observed and simulated heads at observation point *j*, respectively. Thus, an ITA model was set up for a pipe network, in which head specifications were computed as a function of unknown variables (fault information), e.g., *Lp*, *LL*, *CdLAL*, *Bp*, *BL*, *CdBAB*, *Dp*, *DL*, *LD*, *aD*, and *AD* (listed and defined in Table 1).
