An Approach to Diet Cost Optimization for Different Age Groups Using Linear Programming

Abstract

Linear Programming optimization is used in this paper to find minimum cost and quantity of food items for selection of proper diet containing sufficient nutrition elements over a week for three different age groups. For this purpose, first a linear programming optimization model is selected and then three data files defining the various food items with their corresponding cost and nutrition elements appropriate to three distinct age groups are constructed. Finally, the model files and the data files are solved to obtain output cost and amount of food items to be purchased. The optimal solution demonstrates distinct cost and amount of food for different age groups. It also shows different level of complexity while obtaining objective values for different age groups.

Keywords

Share and Cite:

Sultana, J., Hasan, Md.M., Tanni, S.I., Ruman, U. and Islam, S. (2022) An Approach to Diet Cost Optimization for Different Age Groups Using Linear Programming. Open Access Library Journal, 9, 1-11. doi: 10.4236/oalib.1107905. 1. Introduction

A mathematical optimization model is a decision tool to quantitatively express a problem and find the optimal solution for best interest. Linear Programming (LP) optimization is a process where desired solution is obtained from a set of linear equations or inequalities. To solve a problem using LP optimization, first, a model is constructed and then several set of variables are defined. The model consists of one objective function and a set of constraint functions to optimize the objective function. The defined variables formulate a number of linear equations following the model and finally these equations are solved to find the target solution. Many software tools are available to aide in this process to save time and labor.

Since the development and application of Linear Programming (LP) during Second World War to plan and correlate military expenditures and outcomes, it has been substantiated and implemented in more and more applications throughout the years  . Presently Linear programming is being extensively used in industrial and scientific research fields. It has become an effective tool to analyze cost benefit relations in industries, maximize yield in agriculture, design routes in commercial aviation, predict traffic density in telecommunication and many other areas. It has also contributed in development of sophisticated techniques like game theory which found its application from determining national policy to analyze human behaviors  . In this research work, Linear Programming is used to determine cost and quantity of food of a balanced diet.

Nutrients help people perform their day to day activities properly and fight any disease that might harm them. For children, nutrients contribute to their physical and mental developments. For elderly peoples, it compensates for the lack of bodily functions efficiency  . Absence of a balance diet with adequate nutrition hampers physiological processes and can lead to sickness  . Proper nutrition is a key factor in leading a healthy life. Nutrition requirement varies according to age, gender, race and many other factors. Food intake of a person also varies depending on available food resources, culture, community etc. around the globe. Besides all these, financial ability of a person determines his ability to purchase sufficient food for a balanced diet. Considering all these factors, proper diet selection for a particular person can be overwhelming. Since its inception, LP has been extensively used for solving diet problems.

Section 2 describes the general Linear Programming Optimization theory. In Section 3, LP is proposed to solve the real life diet problem. Section 4 solves the presented problem using AMPL and discusses the results. Finally, the paper ends with a conclusion in Section 5.

2. Formulation of LPs

To select the optimum plan a quantitative technique named linear programming can be used. Three basic criteria are needed to build up an optimization problem  .

1) Objective function which describes the behavior of the measure of effectiveness that needs to be maximized or minimized.

2) Decision variables and parameters that are directly controlled variables by decision maker are called decision variables while the uncontrolled inputs are called parameters.

3) Constraints functions that build the relation between decision variables and parameters to finally optimize the objective function.

A linear programming problem (LP) can be generalized mathematically in the following form:

Optimize,

$Z={d}_{1}{x}_{1}+{d}_{2}{x}_{2}+\cdots \text{+}{d}_{n}{x}_{n}$ (1)

Subject to:

${p}_{11}{x}_{1}+{p}_{12}{x}_{2}+\cdots +{p}_{1n}{x}_{n}\left(\le ,=,\ge \right){r}_{1}$

${p}_{21}{x}_{1}+{p}_{22}{x}_{2}+\cdots +{p}_{2n}{x}_{n}\left(\le ,=,\ge \right){r}_{2}$ (2)

${p}_{m1}{x}_{1}+{p}_{m2}{x}_{2}+\cdots +{p}_{mn}{x}_{n}\left(\le ,=,\ge \right){r}_{m}$

${x}_{j}\ge 0,\text{\hspace{0.17em}}\text{where}\text{\hspace{0.17em}}j=1,2\cdots n$

where each of the linear equations or inequalities in Equation (1) determines a constraint to the solution. Here only one of the three symbols holds for each of the equations depending on the constraint.

3. Diet Optimization Using LP

To lead a healthy life, a person must have a balanced diet. Dietary requirement of a person depends on age, gender, body weight, race and also any underlying medical condition if there is any. Though a nutritionist can determine the dietary requirements of a person it is not an easy task to select food items that should contain all the necessary nutrients in adequate amount. It might require careful selection and extensive calculation to determine appropriate diet for a person. With the help of Linear Programming and software to solve the optimization problem, this laborious and time consuming task can easily be accomplished. For this first, an appropriate software tool is selected which in this case is AMPL. Then appropriate model befitting the software tool needs to be constructed and then data correlating food and nutrition can be provided to obtain the target result.

In this research work, LP optimization is used to find cost for purchasing of food containing sufficient 20 nutrition elements over a week for three different age groups. This also determines the amount of 30 food items to be purchased. For this, first a model is developed and then three data files defining the 30 food items with their corresponding cost and 20 nutrition elements appropriate for three distinct age groups are constructed. Finally the model files and the data files are solved using AMPL in the next section to obtain output cost and amount of food items to be purchased.

3.1. Model Description

The adopted model for diet optimization  is as follows:

set NUTR;

set FOOD;

param cost {FOOD} > 0;

param f_min {FOOD} >=0;

param f_max {j in FOOD} >= f_min [j];

param n_min {NUTR} >=0;

param n_max {i in NUTR} >= n_min[i];

param amt {NUTR,FOOD} >= 0;

var Buy {j in FOOD} >= f_min[j],<=f_max[j];

minimize Total_Cost: sum {j in FOOD} cost[j]*Buy[j];

subject to Diet {i in NUTR}:

n_min[i] <= sum {j in FOOD} amt[i,j] * Buy[j] <=n_max[i];

Following the general LP structure, cost of the food items that contain appropriate nutrition for a particular person over a week is set as the objective function. The expression for this in the model is

Total_Cost: sum {j in FOOD} cost[j]*Buy[j];

where cost is the unit price of foods and Buy is the amount of food one should buy.

The variable Buy is limited by the constraint function

Buy {j in FOOD} >= f_min[j],<=f_max[j];

where f_min and f_max are respectively the minimum and maximum amount of particular foods that a person should consume over a week.

The amount of nutrients a person should consume over a week is given by the expression:

n_min {NUTR} >=0; and

n_max {i in NUTR} >= n_min[i];

And food selection for the objective function is determined by the expression:

n_min[i] <= sum {j in FOOD} amt[i,j] * Buy[j] <=n_max[i];

Combining all these expressions we get the model for diet selection using LP. The food and nutrients information are passed through the variables FOOD and NUTR respectively.

3.2. Data Preparation

This sub-section provides with data to be input in the discussed model. The input data needs to be prepared in such way that the solver tool can interpret and use the data in the model to perform calculations. Here, dietary requirement of only three age groups―Children (age below 14), Adults (age between 14 to 50) and Elderly (age above 50) is considered. Some data are collected from bangla booklet “Nutrition in Bangladeshi Foods” by BIRTAN  and others from Internet (http://en.wikipedia.org/wiki/nutrition). The required quantities of nutrients for each level are collected on the basis of per week. The prices of the foods have been collected from the local market and then converted from Bangladeshi Take to U.S. Dollar. The provided data should not be relied upon for meeting nutritional requirements rather only be considered as mere numbers to demonstrate the model. Nutrients limits are different for different age groups. The amounts of nutrients per unit of food are given in Table 1. Table 2 contains Cost and minimum & maximum consumption of particular food. Table 3 represents maximum and minimum amount of nutrients for different age groups.

Table 1. Chart containing nutrients per unit of food.

Table 2. Cost and minimum & maximum consumption of particular food.

Table 3. Maximum and minimum amount of nutrients for different age groups.

As AMPL is used to construct and solve the linear equations to obtain the solution, some sample of constructed linear programs in AMPL interface are given in the followings:

ampl: expand;

minimize Total_Cost:

subject to Diet['ENERGY']:

subject to Diet['FIBER']:

subject to Diet['ZN']:

3.3. Optimal Solution Using AMPL

AMPL, acronym for “A Mathematical Programming Language”, developed by Robert Fourier, David Gay and Brian Kemighan in Bell Laboratories  is an algebraic modeling language for solving and analyzing high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems). It is also a very powerful algebraic modeling language for linear and nonlinear optimization problems, in both discrete and continuous variables. It is ideal for rapid prototyping and development of models, while its speed and generality provide the resources required by repeated production runs  .

First the model and data are prepared in text files. Then these are incorporated in the AMPL interface using proper commands. Finally the linear program is solved and displayed in the interface. Such process for solving the objective function for children age group is as follows:

sw: ampl

ampl: model diet_mod.txt;

ampl: data children_dat.txt;

ampl: solve;

MINOS 5.51: optimal solution found.

17 iterations, objective 108.825

BEEF 4 EGG 2 LIMES 2 PEPPER 3

BREAD 2 FISH 3 LITCHIS 4 PUMPKIN 4

CALFLOWER 4 GINGER 4 MILK 1 RICE 1

CHEESE 3 GRAVELEAVES 3 MUSHROOMS 3 TOMATOES 2

CHICKEN 3.5 GUAVA 1 NODDLES 2 TURKEY 3

CHILI 2 ICE.CREAM 4 OIL 2 WATERMELON 5

COFFEE 3 LETTUCE 3 ORANGE 3

CREACKERS 3 LIMEJUICE 3 PEANUTS 4

;.

Using AMPL, the optimal solution of the objective function for different age groups can be demonstrated. Quantities of food items to be purchased for children age group are shown in Table 4. Table 5 and Table 6 show the quantities of food items to be purchased for adult and elderly age groups respectively.

Table 4. Quantities of food items to be purchased for children age group.

Table 5. Quantities of food items to be purchased for adult age group.

Table 6. Quantities of food items to be purchased for elderly age group.

The optimal solution of the objective function for children age group is found 108.825 after 17 iterations (Table 4).

The optimal solution of the objective function for adult age group is found 110.1682683 after 37 iterations (Table 5).

The optimal solution of the objective function for elderly age group is found 109.9573062 after 31 iterations (Table 6).

4. Discussion

From the obtained result in previous section, it is evident that cost of proper diet is different for different age group. Different nutritional requirements in age groups caused differences in quantity of several food items. For example, children and adults require 3 units of cheese while the elderly people need 3.383 units. Again children need 4 units of peanuts while the adults and elderly peoples require 4.369 and 4.023 units of peanuts respectively. These differences also resulted in different levels of computational complexities which are reflected in the number of iterations.

5. Conclusion

Linear Programming is used to optimize a general yet important issue. In this paper, a structured approach to accommodate balanced diet containing sufficient nutrients in low cost is made using LP optimization tool. It suggests that the required minimum cost varies for different nutritional requirement. It also demonstrates that, varying nutrient requirement leads to change in food intake. The change in complexity of calculations is evident from the varying number of iterations with different constraints. Finally, it can be implemented in a larger scope by adapting distinct physiological nutritional requirements in broader spectrum and including all the necessary nutrients as well as large variety of food choice.

Conflicts of Interest

The authors declare no conflicts of interest.

  Kantorovich, L.V. (1940) On One Effective Method of Solving Some Classes of Extreme Problems. Academy of Sciences, 28, 211-214.  Dantzig, G.B. (1947) Maximization of a Linear Function of Variables Subject to Linear Inequalities. In: Koopmans, T.C., Ed., Activity Analysis of Production and Allocation, Wiley & Chapman-Hall, New York, London, 339-347.  Dewey, K.G. and Brown, K.H. (2003) Update on Technical Issues Concerning Complementary Feeding of Young Children in Developing Countries and Implications for Intervention Programs. Food and Nutrition Bulletin, 24, 5-28. https://doi.org/10.1177/156482650302400102  Saunders, J. and Smith, T. (2010) Malnutrition: Causes and Consequences. Clinical Medicine Journal, 10, 624-627. https://doi.org/10.7861/clinmedicine.10-6-624  Winston, W.L. and Goldberg, J.B. (2004) Operations Research: Applications and Algorithms. 4th Edition, Thomson Brooks/Cole.  Fourer, R., Gay, D.M. and Kernighan, B.W. (2003) AMPL: A Modeling Language for Mathematical Programming. 2nd Edition, Thomson/Brooks/Cole.  http://www.birtan.gov.bd/  Gay, D.M. (2015) The AMPL Modeling Language: An Aid to Formulating and Solving Optimization Problems. Numerical Analysis and Optimization, Springer, Cham, 95-116. https://doi.org/10.1007/978-3-319-17689-5_5  https://www.ampl.com     customer@scirp.org +86 18163351462(WhatsApp) 1655362766  Paper Publishing WeChat 