| Prev | Next | Top | MpsInputFile |
x \in \R^n
to denote the problem variable vector,
b \in \R^m
to denote the problem right hand side vector,
and
A \in \R^{m \times n}
to denote the problem matrix.
Name Record
Rows Record
Columns Record
Rhs Record
Bounds Record
Endata
| Field | Keyword | Op | Name0 | Name1 | Value1 | Name2 | Value2 |
| Columns | 1-* | 2-3 | 5-12 | 15-22 | 25-36 | 40-47 | 50-61 |
It is unspecified if leading and trailing white space has
any significance in the fields Name0, Name1, and
Name2.
For example, the seven characters
"x1 "
may or may not signify the same information as the seven characters
" x1"
.
* is column 1
and any characters in the rest of the line.
NAME Name1
where NAME begins in column 1 and
the string in the Name1
field is the problem name for this input file.
ROWS
where ROW begins in column 1.
Each of the other lines has the following structure:
Op Name0
The string in the Name0 field
in the i-th line below ROWS
specifies the name of the i-th row of the matrix; i.e.,
the name associated with the value
\[
A_{i,1} x_1 + \ldots + A_{i,n} x_n
\]
The character in the Op field
specifies the type of the row and is one of the following values:
| Op | Equation or inequality |
E |
A_{i,1} x_1 + \ldots + A_{i,n} x_n = b_i
|
G |
A_{i,1} x_1 + \ldots + A_{i,n} x_n \geq b_i
|
L |
A_{i,1} x_1 + \ldots + A_{i,n} x_n \leq b_i
|
N |
A_{i,1} x_1 + \ldots + A_{i,n} x_n = z
|
z
is associated with the
first row with the Op field equal to N.
The other rows with the Op field equal to N are ignored.
x_1
, through
x_n
and
the value of the non-zero coefficients in the matrix
A
(zero is the default value for
A_{i,j}
).
The first line of the Columns record contains the text
COLUMNS
where COLUMNS begins in column 1.
Each of the other lines has the structure
Name0 Name1 Value1
or it has the structure
Name0 Name1 Value1 Name2 Value2
The string in the Name0 specifies the name corresponding
to the variable
x_j
for the information on the line.
All of the lines corresponding to one variable
(all the lines with the same value for Name0)
must be grouped together.
The record is called Columns because each variable
corresponds to a column of the matrix
A
.
The string in the Name1 field must be equal
to one of the row names in the Rows
record.
The floating point number in the Value1 field specifies
the value of A_{i,j}
where
i
corresponds to the string in the Name1 field
and
j
corresponds to the string in the Name0 for this line.
If a string is present in the Name2 field it must be equal
to one of the row names in the Rows
record.
In this case,
the floating point number in the Value2 field specifies
the value of A_{i,j}
where
i
corresponds to the string in the Name2 field
and
j
corresponds to the string in the Name0 for this line.
RHS
where RHS begins in column 1.
Each of the other lines has the structure
Name0 Name1 Value1
The string in the Name0 field is a name
for the entire right hand side vector
b \in \R^m
.
It must be the same for all of these lines.
The string in the Name1 field must be equal
to one of the row names in the Rows
record.
It specifies the row index
i
corresponding to the information
on this line.
The floating point number in the Value1 field specifies the value
for this right hand side coefficient
b_i
.
\[
0 \leq x_j < \infty
\]
If these are the only bounds you want,
you need not include a Bounds record.
The first line of the Bounds record contains the text
BOUNDS
where BOUNDS begins in column 1.
Each of the other lines has the structure
Op Name0 Name1 Value1
or the structure
Op Name0 Name1
| Op | Description | |
LO | lower bound |
\ell_j \leq x_j < +\infty
|
UP | upper bound |
0 \leq x_j \leq u_j
|
FX | fixed variable |
x_j = e_j
|
FR | free variable |
-\infty < x_j < +\infty
|
MI | minus infinity |
-\infty < x_j \leq 0
|
PL | plus infinity |
0 \leq x_j < +\infty
|
x
(which column)
is having it's bounds modified by the current line.
The string in the Name1 field must be equal
to one of the variable names in a Name0 field of the
Columns
record.
LO, UP, or FX
the floating point number in the Value1 field defines
\ell_j
,
u_j
,
e_j
respectively.
Otherwise, the Value1 field should be left empty.
ENDATA
where ENDATA begins in column 1.
*Op Name0--- Name1--- Value1------ Name2--- Value2------
*23 56789012 56789012 567890123456 01234567 012345678901
NAME CE-2.1
ROWS
N z
L r1
L r2
L r3
COLUMNS
x1 z 5 r1 2
x1 r2 4 r3 3
*
x2 z 4 r1 3
x2 r2 1 r3 4
*
x3 z 3 r1 1
x3 r2 2 r3 2
RHS
b r1 5
b r2 11
b r3 8
ENDATA
This input file corresponds to the following optimization problem:
Equation 2.1 in Vasek Chvatal's book: Linear Programming
maximize 5*x1 + 4*x2 + 3*x3
subject to 2*x1 + 3*x2 + x3 <= 5
4*x1 + x2 + 2*x3 <= 11
3*x1 + 4*x2 + 2*x3 <= 8
x1 , x2 , x3 >= 0
The solution is x1 = 2, x2 = 0, x3 = 1
The residuals are 0=s1=5-r1, 1=s2=11-r2, 0=s3=8-r3