*Appendix A.2. Minimization Method*

In Reference [32], the minimization problem was solved by optimizing *Ti* one node after each other (for all nodes of the grid *Di*). For each node, the coordinates *x* and *y* were updated alternatively using a 1-D constrained non-linear optimization function. We use a different approach and optimize all the nodes at the same time. The solution does not depend on the order in which the nodes are optimized. However, the number of variables to optimize (2 · (2*<sup>i</sup>* + <sup>1</sup>)<sup>2</sup> for grid *Di*) increases exponentially with *<sup>i</sup>*. Constrained optimization algorithms become computationally expensive for such large numbers of independent variables. Thus, for computation efficiency, we used an iterative barrier approach ([34,35]).

In the barrier approach, the inequality constraints are added to the cost function *J* as penalization terms:

$$J\_p(T\_i) = J(T\_i) + \beta \sum\_h \mathbb{C}\_h(T\_i) \tag{A1}$$

where *Ch* are constraint functions and *β* is the barrier coefficient. The constraints that cannot be written as bounds are converted into constraint functions *Ch* , such that *Ch*(*Ti*) > 0 if the constraint is violated and *Ch*(*Ti*) = 0 if it is respected.

This new minimization problem does not have inequality constraints, only bounds from our first requirement. Here, we minimized the penalized cost function *Jp* using the limited-memory quasi-Newton method for bound-constrained problems (L-BFGS-B) method (with the Python function scipy.optimize.minimize).

As mentioned above, the barrier approach is iterative. First, the cost function *Jp* is minimized using the L-BFGS-B method with *β* = 1. If all the constraints are respected, the procedure stops. Otherwise, the iterations continue with *β* = 10 · *β*. The iterations continue until all the constraints are respected or until one of the stopping criteria is reached. We set two stopping criteria: (1) the decrease of the cost function *P* is smaller than < 10−<sup>5</sup> and (2) the root mean square difference of the grids *Di* before and after is smaller < 10<sup>−</sup>5.
