**2. Optimal regime mathematical model**

The quadratic optimization problem which permits the control the total glycemic load of the regime, the lack of positive nutrients, and overdose of negative nutrients in the regime is given by the coming Equations [5, 6, 15]:

$$(D): \begin{cases} \text{Min } g^\uparrow \mathbf{x} + \theta \text{ dist}(A\mathbf{x}, b) + \sigma \text{ dist}(\mathbf{Ex}, f) \\ \text{Subject to }: \\ c\_j^\uparrow \mathbf{x} \ge \rho\_i(\mathbf{C}^\ell \mathbf{x}) \quad , j \in \{car, p\} \\ c\_j^\uparrow \mathbf{x} \le \mathbf{r}\_j(\mathbf{C}^\ell \mathbf{x}), \ j \in \{\sharp f, \mathfrak{g}^\ell\} \\ \mathbf{x} \in [0, 6]^{176} \end{cases} \tag{1}$$

In the problem ð Þ *D* , *ρcar* ¼ 0*:*55, *ρ<sup>p</sup>* ¼ 0*:*18, *τtf* ¼ 0*:*29, and*τsf* ¼ 0*:*078 represent the ratios recommended by WHO [16]; *g* represents the matrix of glycemic load of foods taking into account possible variations; *A* symbolizes the knowledge of foods in terms of positive nutrients; *E* gives the amount of negative nutrients in foods; *f* and b are the daily requirements of positive and negative nutrients, respectively; *C* is the vector of the foods calories extracted from *A*; *ccar*, *cp*, *ctf* , and *csf* are the calories from carbohydrate, potassium, total fat, and satured fat, respectively. Finally, *θ* and *σ* are parameters to control different components of the cost function.

In the Section 4, we will use three optimization swarm algorithms to estimate the optimal diet based on our model for different configurations.
