# Multi-period production planning
#
# Plans production across periods where stock carries forward. Unlike lot
# sizing there is no setup binary, so the whole model stays an LP — the
# balance row is the only thing coupling periods, and it is what turns a
# sequence of independent decisions into one plan.
#
# Technique: Inventory balance links consecutive periods: s_t = s_{t-1} +
# x_t - d_t, with the first period split out.
#
# On this instance the optimum is 50 (minimisation), confirmed
# independently by two phase simplex before publication.
#
# Reference: Johnson, L. A. and Montgomery, D. C. (1974). Operations
# Research in Production Planning, Scheduling, and Inventory Control. Wiley.
model m
set T = {1, 2, 3}
const d = {6, 5, 4}, forall t in T
const c = {3, 4, 3}, forall t in T
const h = 3
const lim = 7
var 0 <= x <= infty, forall t in T
var 0 <= s <= infty, forall t in T
min sum_{t in T}{c_{t} * x_{t}} + h * sum_{t in T}{s_{t}}
# per-period production limit
constr x_{t} <= lim, forall t in T
# first period starts from empty stock
constr s_{1} = x_{1} - d_{1}
# later periods carry stock forward
constr s_{t} = s_{t-1} + x_{t} - d_{t}, forall t in T setminus {1}
end
import elytica
Read this through MCP: read with path: "formulations/multi-period-production", or resource hlpl://formulations/multi-period-production.