HLPL / VerTeX Modelling Language Documentation

← formulations

# Fixed charge with continuous production
#
# Pays a setup cost to open a line and then produces any continuous amount
# up to its capacity. This is the genuinely mixed case — the setup is
# discrete, the quantity is not — and its optimum is fractional wherever
# demand does not land on a capacity boundary.
#
# Technique: A binary setup gating a continuous level: x ≤ U·y, mixing
#            integer and continuous variables in one model.
#
# On this instance the optimum is 24 (minimisation), confirmed
# independently by integer enumeration plus simplex before publication.
#
# Reference: Balinski, M. L. (1965). Integer programming: methods, uses,
# computation. Management Science 12(3), 253–313. doi:10.1287/mnsc.12.3.253
model m
set I = {1, 2, 3}
const f = {11, 14, 6}, forall i in I
const c = {4, 2, 3}, forall i in I
const u = {7, 5, 4}, forall i in I
const d = 5

var 0 <= x <= infty, forall i in I
bin y, forall i in I

min sum_{i in I}{c_{i} * x_{i}} + sum_{i in I}{f_{i} * y_{i}}

# a line produces a continuous amount, but only if its setup is paid
constr x_{i} <= u_{i} * y_{i}, forall i in I
constr sum_{i in I}{x_{i}} >= d
end

import elytica

Read this through MCP: read with path: "formulations/fixed-charge-continuous", or resource hlpl://formulations/fixed-charge-continuous.