*2.2. Formulation*

In this work, a novel multi-objective constrained formulation of the MPP focused on school cafeterias is proposed. Due to the above, only lunch is planned for *n* days, including a starter, a main course and a dessert per day. The different courses are selected from a database containing their cost and nutritional facts. Courses in the database are grouped into three different categories: starters, main courses and desserts. The particular objective functions are, on the one hand, the cost of the whole plan, which has to be minimised, and on the other hand, the level of repetition of specific courses and food groups that the plan consists of, which has to be minimised as well. The motivation behind the second objective function is to promote a varied plan from a nutritional point of view.

Additionally, the set of daily and global constraints applied in [3] are also taken into account in this new formulation. Those constraints are modelled on the recommendations on intakes of macro-nutrients and micro-nutrients following the guidelines given in the White Book on Child Nutrition. Furthermore, other reference documents regarding school diets and allergens were also consulted, specifically, those endorsed by the Spanish Government Ministry of Education, Culture and Sports and the Ministry of Health, Social Services and Equality (These consensus documents are available at http://www.aecosan.msssi.gob.es/AECOSAN/docs/documentos/nutricion/educanaos/ documento\_consenso.pdf and https://www.aepnaa.org/).

As we said, the cost is an objective to be minimised and is calculated as the sum of the costs of the courses included in the plan. Note that the cost of each course is calculated as the sum of the costs of all the ingredients required to prepare that course. Formally, the cost is defined as follows:

$$C = \sum\_{j=1}^{n} \left( c\_{fc\_j} + c\_{sc\_j} + c\_{ds\_j} \right) \tag{1}$$

where *C* is the total cost of the menu plan and *c f cj* , *cscj* , *cdsj* represent the cost of the starter, main course and dessert, respectively, for day *j*, and *n* is the number of days for which the menu plan is being designed.

An assorted menu plan is particularly important when it is intended for children. As a result of this, the level of repetition of courses and food groups was defined as the second objective function to

be minimised. The level of repetition represents the percentage of courses and food groups repeated throughout the meal plan. The following equation defines how it is calculated:

$$L\_{Rcp} = \sum\_{j=1}^{n} \left( v\_{MC\_j} + \frac{p\_{fc}}{d\_{fc\_j}} + \frac{p\_{sc}}{d\_{sc\_j}} + \frac{p\_{ds}}{d\_{ds\_j}} + v\_{FG\_j} \right) \tag{2}$$

where *LRep* is the level of repetition, *vMCj* represents the compatibility, in terms of food groups, among courses *f cj*,*scj*, *dsj* for day *j*; *p* is a penalty constant for every kind of course and *d* stands for the number of days since a specific course was repeated. Finally, *vFGj* is the penalty value for repeating particular food groups in the last five days.

Equation (3) allows the value of *vMCj* to be calculated, where |*G*| is the number of food groups, *xg* ∈ {0, 1, 2, 3} is the number of times a particular food group is contained in the three courses (starter, main course and dessert) of the menu for day *j* and *pg* is the corresponding penalty value for repeating the food group *g*. The food groups considered in this work are as follows: meat, cereal, fruit, dairy, legume, shellfish, pasta, fish, vegetable and other.

$$\upsilon\_{MC\_j} = \sum\_{\mathcal{S}=1}^{|G|} \left( \mathbf{x}\_{\mathcal{S}\_j} \cdot p\_{\mathcal{S}} \right) \tag{3}$$

$$w\_{FG\_j} = \sum\_{i=1}^{\min(j-1, T)} \left( (\sum\_{\mathcal{S}=1}^{|G|} x\_{\mathcal{S}i} \cdot p\_{\mathcal{S}}) + (y\_i \cdot p\_{|G|+i}) \right) \tag{4}$$

Equation (4) is used to compute *vFGj* , where *T* = 5 days is the number of previous days considered, |*G*| is the number of food groups, *xgi* ∈ {0, 1} indicates whether the food group *g* is repeated on day *j* − *i* (*xgi* = 1) or not (*xgi* = 0) with respect to day *j*, *yi* ∈ {0, 1} indicates whether any food group was repeated *i* day(s) before the current day *j* (*yi* = 1) or not (*yi* = 0), and *pg* and *p*|*G*|+*<sup>i</sup>* are the corresponding penalty values.

The types of penalties and their values used to compute *vMCj* and *vFGj* are shown in Table 1. Furthermore, penalties are determined by the repetition of food groups (*p*1–*p*10), the repetition of the same food group from one to five days prior to the current day (*p*11–*p*15), and the repetition of specific courses (*p*16 = *pf c*, *p*17 = *psc*, and *p*18 = *pds*). In the case of penalties for repeating food groups (*p*1–*p*10), if the penalty value of a given food group is very large in comparison to the remaining food group penalty values, then a plan with a lower number of courses belonging to that food group will be provided. For instance, we have given preference to those courses consisting primarily of vegetables (*p*10 = 0.1) over courses composed primarily of meat (*p*2 = 3).

Additionally, as stated earlier, in order to consider a menu plan as feasible, it must fulfil some constraints related to a set of nutritional requirements, such as having each nutrient intake be within a given range. Besides, the set of constraints of this MPP formulation is modelled by two sub-sets of constraints: global constraints and daily constraints. For instance, energy (kcal), fats and proteins are evaluated both daily and globally. At this point, we note that, since only lunch is considered in the meal plans, the recommended nutritional intakes were adapted. For each nutrient *h* considered, *rh* denotes the recommended amount to ingest every day at lunch. Based on the recommended amount, a range of acceptable intake is generated for each nutrient. Table 2 defines a set *R* of pairs (*rmin*,*rmax*) with the minimum and maximum amount allowed for each nutrient *h*, respectively (The set of micro-nutrients is as follows: Folic acid, Phosphorus, Magnesium, Selenium, Sodium, Vitamins A, B1, B2, B6, B12, C, D, E, Iodine, Zinc).


**Table 1.** Types of penalties defined to calculate the level of repetition objective.

**Table 2.** Minimum and maximum ranges for nutrient intakes


Formally, an individual *S* would be considered feasible if and only if it satisfies the following set of global constraints:

$$n \lor h \in HG : n \times r\_{\text{min}\_h} \times r\_h \le \text{in}(S, h) \le n \times r\_{\text{max}\_h} \times r\_h \tag{5}$$

where *in*(*<sup>S</sup>*, *h*) is the global intake of nutrient *h* in the plan *S*, and *HG* denotes the set of nutrients considered for the global constraints.

In the case of energy, fats and proteins, their intakes for every single day *d*, i.e., *in*(*<sup>S</sup>*, *h*, *d*) are also checked to be in the established daily ranges:

$$\forall h \in HD: r\_{\min\_h} \times r\_h \le \text{in}(S, h, d) \le r\_{\max\_h} \times r\_h \tag{6}$$

where *HD* is the set of nutrients considered for the daily constraints.

In order to properly compare solutions, a definition of an infeasibility degree *id* is required. As previously defined in [3], the infeasibility degree of a solution *S* is calculated as shown in Equation (7). Note that an individual *S* that satisfies Equations (5) and (6) would have an infeasibility degree *id*(*S*) = 0, and it would be considered a feasible solution.

$$id(S) = \text{gid}(S) + dd(S) \tag{7}$$

*Mathematics* **2020**, *8*, 1960

The infeasibility degree *id* is calculated as the sum of the global infeasibility degree *gid*(*S*) and the daily infeasibility degree *did*(*S*). Equations (8) and (9) show the calculation of *gid*(*S*) and *did*(*S*), respectively.

$$\begin{split} \text{gid}(S) &= \sum\_{h \in HG} \left( \max\left( \left( S, h \right), r\_{\text{max}\_h} \right) - r\_{\text{max}\_h} \right)^2 \times 10^6 + \\ &\sum\_{h \in HG} \left( r\_{\text{min}\_h} - \min\left( \left( m(S, h), r\_{\text{min}\_h} \right) \right)^2 \times 10^6 \\ \text{did}(S) &= \sum\_{h \in HD} \sum\_{d=1}^n \left( \max\left( \left( S, h, d \right), r\_{\text{max}\_h} \right) - r\_{\text{max}\_h} \right)^2 + \\ &\sum\_{h \in HD} \sum\_{d=1}^n \left( r\_{\text{min}\_h} - \min\left( \left( S, h, d \right), r\_{\text{min}\_h} \right) \right)^2 \end{split} \tag{9}$$
