The Diet Problem

The diet problem is one of the first problems to be formulated as a linear programming problem. There are nn foods and mm nutrients that we need to consider.

Notation

  • ai,ja_{i,j}: amount of nutrient ii in food jj.

  • bib_i: minimum amount of nutrient ii.

  • cjc_j: cost of food jj.

  • xjx_j: amount of food jj to buy.

Formulation

Such problem can be formulated as a linear programming problem in the following way:

minimizecxsubject toAxbx0\begin{align*} \text{minimize} & \quad \mathbf{c}' \mathbf{x} \\ \text{subject to} & \quad \mathbf{A} \mathbf{x} \geq \mathbf{b} \\ & \quad \mathbf{x} \geq \mathbf{0} \end{align*}

The objective function is to minimize the cost of the food, which is given by cx\mathbf{c}' \mathbf{x}.

The constraints are that the amount of nutrients in the food should be greater than or equal to the minimum amount of nutrients required, which is given by Axb\mathbf{A} \mathbf{x} \geq \mathbf{b}. Also, the amount of food should be nonnegative, which is given by x0\mathbf{x} \geq \mathbf{0}.

Example

The costs and nutrition values for the foods are given in the table below:

The minimum and maximum nutrition requirements are given in the table below:

Last updated