Skip to content

Diet Problem

Definition

The course's diet problem chooses pounds xA,xBx_A,x_B of two feeds to minimize daily feed cost while satisfying calorie, vitamin, and composition requirements:

min⁡0.4xA+0.8xBsubject to800xA+1000xB≥8000,140xA+70xB≥700,2xA−xB≤0,xA,xB≥0.\begin{aligned} \min\quad &0.4x_A+0.8x_B\\ \text{subject to}\quad &800x_A+1000x_B\ge8000,\\ &140x_A+70x_B\ge700,\\ &2x_A-x_B\le0,\\ &x_A,x_B\ge0. \end{aligned}

Interpretation

The diet problem is a minimum-cost mixture model: choose amounts of the ingredients so that the mixture meets every requirement as cheaply as possible. Where the Giapetto model caps the use of resources with ≤\le constraints, the diet problem sets minimum requirements with ≥\ge constraints.

An unbounded feasible region above two lines for calories and vitamins, with two dashed cost lines; the cheapest cost line touches the region at (1.2, 2.4).

The figure uses the simplified model from the Examples. Both requirements keep the feasible points on or above their lines, so the feasible region is unbounded upwards and to the right. The dashed cost lines become cheaper towards the origin, and the cheapest one that still meets the region touches it at the corner (1.2,2.4)(1.2,2.4), with cost 9.69.6.

The unbounded region causes no difficulty for minimization. Both feeds have a positive price and the amounts are nonnegative, so the cost never falls below zero, and moving the cost line towards the origin eventually leaves the region. Maximizing cost over the same region would have no optimum.

The composition restriction shows how a share requirement becomes linear. "At most one third of the feed is A" reads xA≤13(xA+xB)x_A\le\tfrac{1}{3}(x_A+x_B); multiplying by 33 and collecting terms gives 2xA−xB≤02x_A-x_B\le0. The fraction form xA/(xA+xB)≤13x_A/(x_A+x_B)\le\tfrac{1}{3} is not linear and is undefined when no feed is bought, so in linear program formulation the multiplied-out form is the one to use.


Key Results

  • The share constraint follows from xA≤(xA+xB)/3x_A\le(x_A+x_B)/3.
  • Nutrient requirements are lower bounds, so their inequalities point toward greater nutrient intake.
  • The optimal solution is xA=20/7x_A=20/7, xB=40/7x_B=40/7, with cost 40/740/7.

Examples

The figure uses a simplified illustrative diet model, distinct from the course-data formulation above: minimize 2xA+3xB2x_A+3x_B subject to xA+2xB≥6x_A+2x_B\ge6, 3xA+xB≥63x_A+x_B\ge6 and xA,xB≥0x_A,x_B\ge0. The variables still represent pounds of feeds A and B. Sliding the cost line towards the origin gives the illustrated optimum (1.2,2.4)(1.2,2.4) with cost 9.6.

  • The optimal mixture contains exactly one-third feed A.
  • At the course-data optimum (20/7,40/7)(20/7,40/7) the calorie requirement is tight, while vitamin intake is 800≥700800\ge700.

Prerequisites

Sources

Keywords: Feeding pigs

Last updated: 27 October 2026 11:52