MPS Stream Format


The MPS stream format is line oriented with one record per line. There are two predominate versions of the MPS format. An older format that uses fixed field records and a newer format that uses white-space delimited records. The fixed record format limits row/column names to eight characters and the delimited format allows names of arbitrary length. An MPS reader that reads delimited records can read fixed records with no changes if the row/column names don't contain embedded spaces.

The 'MPSReader' class in OR-Objects reads MPS records using the newer delimited format which allows it to read both MPS versions. The 'MPSWriter' class in OR-Objects writes records in the fixed format if the names contain eight or fewer characters and in the delimited format if they contain more. This produces MPS streams that can be read by older fixed format readers if the name lengths permit.

Record Formats

Table-1 shows the details of the MPS records. The column numbers only apply to fixed format records. Any line with a leading '*' is taken as a comment. The 'MPSReader' class parses comment lines for embedded metadata before discarding the line.
 
Table 1 - Fixed Record Field Formats
Record Description Field-1
2 - 3
Field-2
5-12
Field-3
15-22
Field-4
25-36
Field-5
40-47
Field-6
50-61
Name Record NAME problemName        
Row Section ROWS          
Row Data constraintType rowName        
Column Section COLUMNS          
Column Data   columnName rowName value [rowName value]
Integer Origin Marker  
markerName
'MARKER'
'INTORG'
   
Integer End Marker  
markerName
'MARKER'
'INTEND'
   
Right-Hand-Side Section RHS          
Right-Hand-Side Data   rhsName rowName value [rowName value]
Range Section RANGES          
Range Data   rangeName rowname value [rowName value]
Bound Section BOUNDS          
Bound Data boundType boundName columnName value    
End of Data ENDATA          
Comments and Metadata *          

Name Record

The name record specifies the name of the problem. The name starts in field-2 and extends to the last character on the line. All embedded spaces are included in the name and all leading and trailing spaces are truncated.

Rows Section

Each row data record defines a new constraint row. The field-1 specifies the constraint type and field-2 specifies its name. All rows must be defined before they can be referenced in the other sections that follow.
 
Table 2 - Constraint Type Definitions
 'constraintType' Row Type Definition
 L  Less Than Constraint
 G  Greater Than Constraint
 E  Equal To Constraint
 N Free Row (The first one will become the objective.)

Columns Section

The column data records must be grouped together by column. Each group defines a new decision variable and its coefficients. Field-2 contains the column name and the first record in the group defines the column. Field-3 and field-4 specify a row name and value for a coefficient. Field-5 and field-6 are optional and if present define an additional coeficient. An objective function coefficient is specified by using the row name of the objective function, which is the first row defined with a type 'N'.

The default type for a variable is REAL. The integer origin and integer end column records can be used to designate INTEGER type variables. A block of variables is desinated as INTEGER by putting an integer origin marker record before the first column deifinition in the block and an integer end marker record after the last column.

Right-Hand-Side (RHS) Section

The right-hand-side (rhs) data records define the rhs values for the constraints. The rhs column name is defined by the first record and any additional columns will be ignored. The data records are analagous to those in the columns section.

Ranges Section

The range data records define the range values for the constraints. The range column name is defined by the first record and any additional columns will be ignored. The data records are analagous to those in the columns section. Table-3 shows how the range values are applied to different constraint types.
 
Table 3 - Range Value Usage
'rowType' Range Sign Lower Range Upper Range
E positive rhs rhs + range
E negative rhs + range rhs
G either rhs rhs + |range|
L either rhs - |range| rhs

Bounds section

Each bound data record defines a bound on a decision variable. Some bound types change the type of the decision variable. The bound row name is defined by the first record and any additional rows will be ignored. Field-1 defines the bound type, Field-2 specifies the bound row name, Field-3 identifies the bounded variable and field-4 specifies the bound value.
 
Table 4 - Bound Type Definitions
'boundType' Bound Type Definition
LO Set lower bound.
UP
Set upper bound.
LI
Make integer and set lower bound.
UI
Make integer and set upper bound.
BV
Make boolean.
FX
Fix the value.
FR
Free the variable.
MI
Set lower bound to minus infinity
PL
Set upper bound to plus infinity

Comments and Metadata

Any line with a leading '*' is interpreted as a comment line. When a comment line is parsed for an embedded metadatum definition before being discarded. Metadata is data that is outside the scope of the problem formulation but provides meaningful information about the problem. The metadata can be used by algorithms to set internal parameters or as hints to gain insights into a problem's characteristics.  A metadatum is defined with the keyword 'Metadatum' followed by a key string and value strings. The value string may be enclosed in quotes to include spaces.

Here are some examples of metadata embedded in comments:

* Metadatum  lp.epsilon  1.0E-6
* Metadatum  lp.description  "A problem I need to solve."
* Metadatum  mip.searchAlgorithm   branch-and-bound



Copyright(C)1997-99 by DRA Systems all rights reserved.