This notebook provides the implementation of the production problem described in the book AMPL: A Modeling Language for Mathematical Programming
by Robert Fourer, David M. Gay, and Brian W. Kernighan.
Example: production model
It is usual to adopt mathematical notation as a general and concise way of expressing problems based on variables, constraints, and objectives. We can write a compact description of the general form of a production problem, which we call a model, using algebraic notation for the objective and the constraints.
Model implementation
The general formulation above can be written with AMPL as follows:
Data
Due to the model and data separation, the abstract formulation works for any correct data input we provide to AMPL. A possible instance of the production problem is the following:
Solve the problem
We can load the generated model and data files, and solve them by using a linear solver as CBC. Finally, the solution (values for X) is displayed.
CBC 2.10.5: CBC 2.10.5 optimal, objective 192000
1 iterations
"option abs_boundtol 9.094947017729282e-13;"
or "option rel_boundtol 1.5158245029548803e-16;"
will change deduced dual values.
X [*] :=
bands 6000
coils 1400
;