Formulating Diet and Blending Problems as LPs

Translate diet-style and blending problems into linear programs: identify decision variables, write the cost objective, and encode nutritional or quality specifications as linear constraints (including linearizing ratio-based specifications).

Step 1 of 157%

Tutorial

The Diet Problem

A diet problem asks for the cheapest combination of foods that meets all nutritional requirements.

The formulation has three ingredients:

  • Decision variables: let xix_i denote the amount of food ii in the diet (e.g., servings, ounces, grams).
  • Objective: minimize total cost,
min i=1ncixi,\min\ \sum_{i=1}^n c_i\, x_i,

where cic_i is the cost per unit of food i.i.

  • Constraints: for each nutrient j,j, the total amount supplied must meet the daily minimum bj:b_j{:}
i=1naijxibj,\sum_{i=1}^n a_{ij}\, x_i \geq b_j,

where aija_{ij} is the amount of nutrient jj contained in one unit of food i.i.

  • Non-negativity: xi0x_i \geq 0 (we cannot consume a negative amount of food).

For example, suppose rice costs \1perpoundandsuppliesper pound and supplies2gofproteinperpound,whilebeanscostg of protein per pound, while beans cost $2perpoundandsupplyper pound and supply5gofproteinperpound.Tomeetag of protein per pound. To meet a 10$g protein minimum at minimum cost, we write

min  x1+2x2s.t.  2x1+5x210 x1,x20.\begin{align*}\min\ &\ x_1 + 2 x_2 \\ \text{s.t.}\ &\ 2 x_1 + 5 x_2 \geq 10 \\ &\ x_1,\, x_2 \geq 0.\end{align*}
navigate · Enter open · Esc close · ⌘K/Ctrl K toggle