# Using Optimisation Meta-Heuristics for the Roughness Estimation Problem in River Flow Analysis
## 2 Formulating the Optimisation Problem  
To obtain a framework capable of estimating optimal [PERSON]'s coefficients, we formulate the problem as the minimisation of a 'loss' function whose variables are the three Manning's coefficients for 'left bank', 'central channel' and 'right bank' relative to each one of the \(\varsigma\) available cross-sections for the two rivers under study--see Sections 5.1 and 5.2 for river-specific details. This results into a \(d\)-dimensional optimisation problem having \(d=3\cdot\varsigma\) real-valued design variables \(x_{i}\in\mathbb{R}\), with \(i=1,2,3,\ldots,n\), which are bounded in the range \([0.025,0.2]\). Mathematically, this means that we are looking for multivariate solutions \(\mathbf{x}=[x_{1},x_{2},x_{3},\ldots,x_{d}]\) within a hyper-cubical search space generated by the Cartesian product of the boundaries vectors, i.e., \(\mathbf{x}\in[0.025,0.2]^{d}\).  
Defining this problem analytically is not trivial, and impossible in many circumstances. However, by means of state-of-the-art simulators, it is possible to perform accurate hydrodynamic analyses in a reasonable amount of time, thus quickly estimating rivers' depths with satisfactory accuracy. This information can then be exploited further to compute the 'loss' associated with the solution vectors used to run the simulation. In this study, the latter is performed by running the open-source software 'HEC-RAS', whose working mechanism is described in Section 3. Once the simulation is over, its output is compared with the observed depth and the absolute difference between the two values is computed to return a loss indicator.  
More in detail, the objective functional call consists of the following 3 steps:  
1. a candidate solution \(\mathbf{x}\), having the previously described structure, must be produced and fed to the HEC-RAS simulator;
2. HEC-RAS is set with Manning's coefficients from the candidate solution \(\mathbf{x}\) and a simulation is run to obtain the expected depth of the water at the gauge station deployed along the river--this value is referred here to as \(\mathrm{HR}(\mathbf{x})\);
3. the absolute difference between \(\mathrm{HR}(\mathbf{x})\), i.e., the simulated depth, and \(h_{\mathrm{obs}}\), i.e., the true depth observed at the gauge station, is calculated to obtain the loss score as shown below in Equation (1): \[f(\mathbf{x})=|\mathrm{HR}(\mathbf{x})-h_{\mathrm{obs}}|.\] (1)  
It is important to note that the optimal solution for the formulated problem returns a null loss score. In other words, zero is a lower bound for Equation (1). This shows that the loss function is well-defined (i.e., negative losses cannot occur and the global minima can only return null losses).  
Because of the lack of a closed-form, this problem cannot be solved theoretically. This limits the choices of suitable optimisation methods to meta-heuristic algorithms. Amongst them, we selected 5 state-of-the-art algorithms belonging to different stochastic optimisation paradigms, including evolutionary computing, swarm intelligence and Bayesian optimisation [27; 28; 29; 30; 31]. Given the black-box nature of the problem at hand, these heterogeneous set of algorithms has been purposely chosen to compensate for the absence of information on the so-called 'fitness landscape' of the objective functions--also referred to as fitness function in the field--which prevents us from knowing a-priori which heuristic will perform best.