Download Mosel user guide
Transcript
forall(a in AREAS) sola(c,a):=getsol(alloc(c,a))
forall(s in SITES) solc(c,s):=getsol(clean(c,s))
end-do
setparam("XPRS_SOLUTIONFILE",1)
! Search for violated constraints
forall(c in CONTR, s in SITES)
if solc(c,s) > sola(c,AREA(s)) then
cut(ncut):= alloc(c,AREA(s)) - clean(c,s)
cutid(ncut):= 1
type(ncut):= CT_GEQ
ncut+=1
end-if
! Add cuts to the problem
if ncut>0 then
returned:=true
! Call this function again
addcuts(cutid, type, cut);
writeln("Cuts added : ", ncut, " (depth ", depth, ", node ", node,
", obj. ", getparam("XPRS_LPOBJVAL"), ")")
end-if
end-if
end-function
The prototype of this function is prescribed by the type of the callback (see the Xpress-Optimizer
Reference Manual and the chapter on mmxprs in the Mosel Language Reference Manual). At
every node this function is called repeatedly, followed by a re-solution of the current LP, as
long as it returns true.
Remark: if one wishes to access the solution values in a callback function, the Xpress-Optimizer
parameter XPRS_SOLUTIONFILE must be set to 0 before getting the solution and after getting
the solutions it must be set back to 1.
11.2 Column generation
The technique of column generation is used for solving linear problems with a huge number of
variables for which it is not possible to generate explicitly all columns of the problem matrix.
Starting with a very restricted set of columns, after each solution of the problem a column
generation algorithm adds one or several columns that improve the current solution. These
columns must have a negative reduced cost (in a minimization problem) and are calculated
based on the dual value of the current solution.
For solving large MIP problems, column generation typically has to be combined with a Branchand-Bound search, leading to a so-called Branch-and-Price algorithm. The example problem
described below is solved by solving a sequence of LPs without starting a tree search.
11.2.1
Example problem
A paper mill produces rolls of paper of a fixed width MAXWIDTH that are subsequently cut into
smaller rolls according to the customer orders. The rolls can be cut into NWIDTHS different
sizes. The orders are given as demands for each width i (DEMANDi ). The objective of the
paper mill is to satisfy the demand with the smallest possible number of paper rolls in order to
minimize the losses.
11.2.2
Model formulation
The objective of minimizing the total number of rolls can be expressed as choosing the best set
of cutting patterns for the current set of demands. Since it may not be obvious how to calculate
More about Integer Programming
64
Mosel User Guide