You are on page 1of 9

Linear Optimization to maximize the protein intake of

a balance diet
S. Candelaria Caraballo and L. E. Gutiérrez Villarreal
University of Puerto Rico - Mayagüez Campus

ABSTRACT
Currently the problem of diet has become an important synonym of physical well-being, and in
this research we have formulated diet as a Linear Programming (LP) problem, which separates
basic foods for different times of the day and establishes the nutrients of each food based on an
amount of intake of one hundred grams per food, taking into account the optimal daily nutritional
values for a person. Reference data for the nutritional values of each food has been provided by
the United States Integrated Food System (Food Data Central), which provides expanded nutrient
profile data and links to related agricultural and experimental research. The most relevant
nutritional value of our research is proteins, therefore, our objective function is to maximize them
in a balanced diet in order to have a gain in muscle mass with the restrictions regarding the
recommended amounts per day of: calories, sugars, fats among others. We solve this problem
using the Lingo tool and describe all the steps involved in solving and formulating the specific
problem.
Key words: Linear programming, proteins, objective function, daily nutritional values, Lingo.

INTRODUCTION
As is known a diet consists in selecting a set of foods that meet a set of daily nutritional
requirements at a minimum cost, therefore, it is a habit and constitutes a way of living. Sometimes,
the term is often used to refer to special regimens for weight loss or to combat certain diseases, but
in this case, we will try to look for an ideal diet that maximizes daily protein intake to produce a
gain in muscle mass.
Diets are not always required in order to seek beauticianism or to reduce mass, it has been a topic
that explicitly influences health conditions and therefore ensure a healthier life, in many cases diets
are used for weight gain which leads to more toned muscles in a healthy and effective way, as is
the case of certain athletes or people who work based on their body such as bodybuilding. The
problem of diet is an issue that has had relevance over time, much more so now since obesity
generates alarming figures due to the sedentaryness and poor exercise of people, which in time
leads to dangerous and harmful health conditions. Currently in countries like the United States
only 18% of all inhabitants are severely obese [1], but if the United States does not collectively
adopt healthier eating habits, more than half of the nation will be obese in 10 years [1]. The first
studies that applied linear programming (PL) to diets were published between 1950 and 1960 [2].
The search for diet solutions began with Jerry Cornfield, who formulated "The Diet Problem" for
the Army during World War II (1941-1945), looking for a low-cost diet that would meet a soldier's
nutritional needs. Economist George Stigler developed optimization techniques to establish the
cheapest diet that offers enough energy, proteins, vitamins and minerals [2]. According to Buttriss,
this diet should be made up of the available list of 77 U.S. foods. Of which the costs and nutrient
composition were measured: "Stigler could not find the exact solution to this problem, which
turned out to be incredibly complex. Stigler's "diet problem" is a typical question of resource
optimization or, in mathematical terms, of minimizing a linear function subject to multiple linear
constraints, also called linear programming [2].
The main goal of our project is to maximize the protein intake of a balanced diet to have a gain in
muscle mass, the limitations of the problem are the age of calories, carbohydrates, cholesterol
among other nutrients, but with the priority that it is maximized through linear programming foods
with more protein.

BIBLIOGRAPHICAL REVIEW
Linear Programing (LP) has been used to optimize diets since the first studies performed in the
decade of 1950. [3] Different constraints have been used to determined diets such as cost, nutrients,
and environmental sustainability. [3] Cristina et al. [4] used LP to optimize a diet by minimizing
the calorie intake while satisfying nutrient constraints and using food items as variables. This
simple method can be adapted to maximize the protein intake on a diet.
There could be different reasons for increasing the consumption of proteins on a diet, but one that
is common, is for gaining weight for bodybuilding. A high protein diet combined with resistance
exercise, facilitates gaining, or retaining muscular mass. [5] To be healthy, a bodybuilder needs a
high intake of proteins, while maintaining a balanced diet. That is why it is important to determined
what food is better to bodybuilding.

METHODOLOGY
LP works with linear objective functions and constraints. The software LINGO is going to be used
to optimize the objective function and Excel is going to be used to store the data. For the scope of
this paper some assumptions were made:
LP works with linear objective functions and constraints [6]. The software LINGO is going to be
used to optimize the objective function and Excel is going to be used to store the input data. For
the scope of this paper some assumptions were made:
1. The bodybuilder is a 29 years old man that weights 74 kg and has a height of 1.8 m.
2. The bodybuilder wants to gain muscle mass.
3. The bodybuilder does moderate exercise but has a sedentary job.
4. Four different types of foods are going to be evaluated for breakfast, lunch and dinner, for
a total of twelve different foods.
5. Each portion of food is equal to 100 g.

The variables that are going to be used are:


1. Tij = Data for the nutritional element i for the food type j.
2. Fj = Number of portions of the food type j that are going to be consumed.
The data for Tij was obtained from the Food Data Central [7]. The data is presented on Table 1.

Table 1. Tij data for breakfast, lunch and dinner.

T Breakfast Lunch Dinner

Food Egg Grilled Milk and Pancakes Chicken lasagna Soft Hotdog Salmon Ham Tomato Pizza
(F1) cheese cereal (F4) Breast (F6) taco (F8) (F9) sandwich pasta salad (12)
(F2) (F3) (F5) with (F10) (F11)
chicken
(F7)
Energy (kcal) 53 360 413 227 143 357 221 244 209 223 186 265
Total fat (g) 0 22.87 10.98 5.15 3.12 1.79 9.58 20 9.3 10.23 9.29 11.5
Saturates (g) 0 11.505 9.114 1.03 0.89 0 3.379 6.67 6.98 3.03 1.79 6.19
Carbohydrate (g) 1.77 24.59 72.05 39.18 2.68 75 21.28 4.44 6.98 21.97 20 30.53
Protein (g) 9.73 14.27 6.47 4.12 24.11 12.5 12.5 8.89 30.23 12.12 5.71 10.18
Cholesterol (mg) 4 51 6 31 71 0 38 67 70 27 7 18
Sugar (g) 0 2.86 45.97 11.34 0.89 3.57 2.37 2.22 0 3.41 2.86 5.31

The objective function is:


max = ∑9𝑗=1 𝑇(5,𝑗) ∗ 𝐹𝑗 ∗ 𝑋𝑗 (1)

The constraints for this problem are the maximum recommended intake for several nutritional
elements.[8] The salt was not taken into consideration because there was not data available for the
food selected. The maximum protein amount was obtained from the protein calculator. [9] Even
though, the goal is to maximize the protein amount, a top was established because the excess of
protein will not help much on the muscular growth and it will take off space on the meal for other
nutrients. [5] In addition, cholesterol data [10] was added to have a more robust diet.
These values are equivalent to the restrictions of our linear programming problem since we must
limit the consumption of certain foods to stay in our feasible zone and recommended by Food Data
Central, because the diet must keep the person healthy and within limits. allowable daily
consumption.
Table 2. Nutritional reference intake

Nutritional element Maximum intake


Energy (kcal) 2500
Total fat (g) 57
Saturates (g) 30
Carbohydrates (g) 300
Protein (g) 155
Cholesterol (mg) 300
Sugar (g) 120

The constraints equations go as fallow:


1. Allowable energy:
max = ∑9𝑗=1 𝑇(1,𝑗) ∗ 𝐹𝑗 ≤ 2500 (2)
2. Allowable total fat:
max = ∑9𝑗=1 𝑇(2,𝑗) ∗ 𝐹𝑗 ≤ 57 (3)
3. Allowable saturates:
max = ∑9𝑗=1 𝑇(3,𝑗) ∗ 𝐹𝑗 ≤ 30 (4)
4. Allowable carbohydrates:
max = ∑9𝑗=1 𝑇(4,𝑗) ∗ 𝐹𝑗 ≤ 300 (5)
5. Allowable protein:
max = ∑9𝑗=1 𝑇(5,𝑗) ∗ 𝐹𝑗 ≤ 155 (6)
6. Allowable cholesterol:
max = ∑9𝑗=1 𝑇(6,𝑗) ∗ 𝐹𝑗 ≤ 300 (7)
7. Allowable sugar:
max = ∑9𝑗=1 𝑇(7,𝑗) ∗ 𝐹𝑗 ≤ 120 (8)

Bynering you our target function with the restrictions set, we use the Lingo software to get the
results, but first we rewrite the problem with lingo programming. Enter all the parameters shown
in Table 1:

F = qutity of the food j.


T = table with data.;

model:
sets:
nutrient/1..7/;
food/1..12/: F;
n_f(nutrient,food): T;
endsets
data:
T = @OLE('file:///C:\Users\Owner\Desktop\Final_proyect_food_data.xlsx');

enddata
!Objetive;
max = @sum(food(j): T(5,j)*F(j));

!Constraints;

!Energy (kcal);
@sum(food(j): T(1,j)*F(j))<= 2500;

!Total fat (g);


@sum(food(j): T(2,j)*F(j))<= 95;

!Saturates (g);
@sum(food(j): T(3,j)*F(j))<= 30;

!Carbohydrates (g);
@sum(food(j): T(4,j)*F(j))<= 300;

!Protein (g);
@sum(food(j): T(5,j)*F(j))<= 180;

!Cholesterol (g);
@sum(food(j): T(6,j)*F(j))<= 400;

!Sugar (g);
@sum(food(j): T(7,j)*F(j))<= 120;

!F are integers;
@for(food(j):@gin(F(j)));

dsdsddsddsscsdvddsdscd
Once the problem has been formulated through the Lingo language, expressing the objective
function and restrictions proceeds to verify the results
RESULTS

The mathematical model set out above of the problem is formulated as a linear program where the
objective function aims to maximize protein consumption subject to the constraints observed in
Table 2. Analyzing the results in the lingo software it is observed that the solution converges after
730 iterations and 274 steps. In addition, it is noted that the solution method used by the software
for solving the problem was Branch and Bound, the problem in which all variables are linear, and
the constraints lead to whole numbers.

Figure 1. Lingo internal solver.

As can be seen in Figure 1, the total number of problem variables are 12 subject to 8 restrictions,
and in the optimal solution when the variables are obtained, the target function is maximized by
calculating a value of 180 which corresponds to the maximum value in grams of protein that the
person must consume, this value corresponds to the result thrown by a protein intake calculator ,
remember that the subject is a 29-year-old man, who has a height in 1.80 meters and has a weight
of 74 kilograms. The results of the calculator can be seen in Figure 2 of the annexes.
In Table 3 you can see the results obtained from the problem formulated by yielding the following
data taken by the variable F (quantity of food j).
Table 3. Solution values of variable F.

Variable Value Reduced Cost


F( 1) 3.000000 -9.730000
F( 2) 0.000000 -14.27000
F( 3) 0.000000 -6.470000
F( 4) 0.000000 -4.120000
F( 5) 2.000000 -24.11000
F( 6) 0.000000 -12.50000
F( 7) 2.000000 -12.50000
F( 8) 0.000000 -8.890000
F( 9) 2.000000 -30.23000
F( 10) 0.000000 -12.12000
F( 11) 3.000000 -5.710000
F( 12) 0.000000 -10.18000

In Table 3 we can see that for a balanced diet and that it meets the recommended requirements for
nutrient intake per day, that maximizes protein intake to 180 grams (which is the main goal for
muscle mass gain) the person should: consume 300 grams of egg at breakfast, 200 grams of
chicken breast plus 200 grams of Soft taco with chicken for lunch and finally for dinner the person
must consume 200 grams of salmon plus 300 grams of Tomato salad pasta. These values comply
with all constraints and maximize the target function to the value shown in Figure 2.

CONCLUSION
The problem of a diet can be implemented as a linear programming problem, in this case the diet
consists of muscle mass gain following the recommended amounts of nutrients per day and
considering a person's age, weight, height and lifestyle. The procedure where variables are food
and restrictions are nutritional requirements formulated using the Lingo tool, in this way we can
provide in a faster way the solution for a problem that makes it easier for people to eat food if their
intention is to gain muscle mass and taking foods that benefit their health and do not go outside
nutritional standards per day.
ANNEXED
Figure 2. Protein Intake Calculator
REFERENCES
1. Lamotte, S. (2019, diciembre 20). La mitad de las personas en Estados Unidos serán
obesas dentro de 10 años (a menos que hagamos esto). Recovered from
https://cnnespanol.cnn.com/2019/12/19/la-mitad-de-personas-en-estados-unidos-seran-
obesas-dentro-de-10-anos-a-menos-que-hagamos-esto/.
2. van Dooren, C. (2018). A review of the use of Linear Programming to optimize diets,
nutritiously, economically and environmentally. Frontiers in nutrition, 5, 48.
3. van Dooren, C. (2018). A Review of the Use of Linear Programming to Optimize Diets,
Nutritiously, Economically and Environmentally. Front. Nutr. 5:48, 1-2. doi:
10.3389/fnut.2018.00048
4. HREŢCANU, C., & HREŢCANU, C. (2010). A LINEAR PROGRAMMING MODEL
FOR A DIET PROBLEM. Food And Environment Safety Of The Suceava
University, 9(1), 57-63. Retrieved from
http://www.fia.usv.ro/fiajournal/index.php/FENS/article/view/394
5. Swan, H. (2018). The Complete Guide to Protein. Retrieved from
https://www.bodybuilding.com/content/the-complete-guide-to-protein.html
6. Taha, H. (2011). Operations Research and Introduction (9th ed., p. 5). New Jersey:
Perason Prentice Hall.
7. FoodData Central. Retrieved 23 May 2020, from https://fdc.nal.usda.gov/
8. Torrens, K. (2019). A balanced diet for men. Retrieved from
https://www.bbcgoodfood.com/howto/guide/balanced-diet-men
9. Contributing Writer. (2019). Calculate Your Recommended Protein Intake. Retrieved
from https://www.bodybuilding.com/fun/calpro.htm
10. Cruickshank, H., & Cafasso, J. (2019). How Much Cholesterol Should I Have Per Day?.
Retrieved 30 May 2020, from https://www.healthline.com/health/high-cholesterol/rda

You might also like