Integer variables in MPS files
The CPLEX extensions of MPS file format support integer variables.
If you use the CPLEX mixed
integer optimizer, then you may restrict any or all variables to integer
values. CPLEX accepts
two commonly used ways of extending the MPS file format to include
integer variables: in the COLUMNS
section
or in the BOUNDS
section.
In the first way, integer variables are identified within
the COLUMNS
section of the MPS file by
marker lines. A marker line is placed at the beginning and end of
a range of integer variables. Multiple sets of marker lines are allowed.
Integer marker lines have a field format consisting of Fields 2
through 4.
Field 2: Marker name
Field 3: 'MARKER'
(including
the single quotation marks)
Field 4: Keyword 'INTORG'
and 'INTEND'
to
mark beginning and end respectively (including the single quotation
marks)
Fields 5 and 6 are ignored.
The marker name must differ from the preceding and succeeding column names.
If no bounds are specified for the variables within markers, bounds of 0 (zero) and 1 (one) are assumed.
In the following example, column x4
is
an integer variable and looks like this in the COLUMNS
section of an MPS file, according to this first way of treating integer
variables:
NAME
ROWS
N obj
L c1
L c2
E c3
COLUMNS
x1 obj -1 c1 -1
x1 c2 1
x2 obj -2 c1 1
x2 c2 -3 c3 1
x3 obj -3 c1 1
x3 c2 1
MARK0000 ‘MARKER’ ‘INTORG’
x4 obj -1 c1 10
x4 c3 -3.5
MARK0001 ‘MARKER’ ‘INTEND’
RHS
rhs c1 20 c2 30
BOUNDS
UP BOUND x1 40
LO BOUND x4 2
UP BOUND x4 3
ENDATA
BOUNDS
section
with special bound types in Field 1. The acceptable special bound
types appear in Table 1.
Type | Purpose | Special Considerations |
---|---|---|
BV |
Binary variable | Field 4 must be 1.0 or blank |
LI |
Integer lower bound | Field 4 is the lower bound value and must be an integer |
SC |
Semi-continuous variable | Field 4 is the upper bound and must be specified |
UI |
Integer upper bound | Field 4 is the upper bound value and must be an integer |
To specify a general integer variable with no upper bounds, one must use the first way, that is,
make certain that the variable's column is described within an INTORG/INTEND
marker
pair.
To specify a semi-integer variable, two bound statements must be combined. First, the bound type
SC
must be used for the variable to mark it as semi-continuous and to specify the
upper bound. Then, the variable must be marked integer and the lower bound needs to be specified
using the bound type LI
.
For example, column x4
is
an integer variable declared in the BOUNDS
section of an MPS file, according to this second way of treating integer
variables:
NAME
ROWS
N obj
L c1
L c2
E c3
COLUMNS
x1 obj -1 c1 -1
x1 c2 1
x2 obj -2 c1 1
x2 c2 -3 c3 1
x3 obj -3 c1 1
x3 c2 1
x4 obj -1 c1 10
x4 c3 -3.5
RHS
rhs c1 20 c2 30
BOUNDS
UP BOUND x1 40
LI BOUND x4 2
UI BOUND x4 3
ENDATA