HLPL / VerTeX Modelling Language Documentation

← formulations

# Product mix
#
# Chooses how much of each product to make when several products compete for
# the same limited resources. The optimum generally lands on a vertex with
# fractional levels, which is why the variables are continuous rather than
# integer.
#
# Technique: Continuous activity levels limited by shared resource rows;
#            the canonical linear program.
#
# On this instance the optimum is 26.66666666666667 (maximisation), confirmed
# independently by two phase simplex before publication.
#
# Reference: Dantzig, G. B. (1963). Linear Programming and Extensions.
# Princeton University Press. doi:10.1515/9781400884179
model m
set P = {1, 2, 3}
set R = {1, 2, 3}
const p = {5, 5, 2}, forall j in P
const a = {{1, 1, 3},
           {5, 3, 3},
           {3, 1, 5}}, forall i in R, forall j in P
const b = {29, 16, 11}, forall i in R

var 0 <= x <= infty, forall j in P

max sum_{j in P}{p_{j} * x_{j}}

# each resource is consumed within what is available
constr sum_{j in P}{a_{i,j} * x_{j}} <= b_{i}, forall i in R
end

import elytica

Read this through MCP: read with path: "formulations/product-mix", or resource hlpl://formulations/product-mix.