# Diet / blending
#
# Mixes ingredients at least cost while meeting minimum nutrient levels. The
# `>=` rows make this the covering counterpart of product mix, and the blend
# is naturally fractional.
#
# Technique: Minimise cost subject to lower bounds on each nutrient — a
# covering LP with `>=` rows.
#
# On this instance the optimum is 16.5625 (minimisation), confirmed
# independently by two phase simplex before publication.
#
# Reference: Stigler, G. J. (1945). The cost of subsistence. Journal of Farm
# Economics 27(2), 303–314. doi:10.2307/1231810
model m
set F = {1, 2, 3, 4}
set N = {1, 2}
const c = {5, 5, 6, 5}, forall j in F
const a = {{2, 5, 4, 2},
{2, 2, 3, 4}}, forall i in N, forall j in F
const r = {13, 9}, forall i in N
var 0 <= x <= infty, forall j in F
min sum_{j in F}{c_{j} * x_{j}}
# every nutrient requirement must be met or exceeded
constr sum_{j in F}{a_{i,j} * x_{j}} >= r_{i}, forall i in N
end
import elytica
Read this through MCP: read with path: "formulations/diet-blending", or resource hlpl://formulations/diet-blending.