This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

MPS (.mps)

MPS mathematical file format.
De facto standard for specifying linear programming (LP) problems.
Commonly used as input format by LP solvers.
MPS is an acronym for Mathematical Programming System.
Plain text ASCII format, sometimes compressed as binary.
Stores data in a fixed-width tabular form.
Developed in the 1970s at IBM.
  • Import fully supports the MPS format.
  • Import imports an MPS file, returning an expression representing an optimization problem.
  • Import returns a list of objective functions and constraints in a form suitable as input for NMinimize.
  • Import imports the specified element from an MPS file.
  • Import imports multiple elements.
  • See the reference pages for full general information on Import.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Equations"list of objective functions and constraints
"LinearProgrammingData"vectors and matrices representing a linear program
"ConstraintMatrix"matrix describing the constraints of a linear programming problem
  • Import uses the element by default.
"FreeFormat"Falsewhether data fields are loosely or strictly aligned in the file
"EMPS"Falsewhether the file is compressed
Get a list of Import elements from an MPS file:
Read an MPS file as a list of objective functions and constraints that is an expression suitable for NMinimize:
Use it as input for NMinimize:
Read MPS data in a form suitable as input for LinearProgramming:
Use it as input for LinearProgramming:
Import and plot the constraint matrix of the previous example:
Get a list of Import elements from an MPS file:
In[1]:=
Click for copyable input
Out[1]=
Read an MPS file as a list of objective functions and constraints that is an expression suitable for NMinimize:
In[2]:=
Click for copyable input
Out[2]=
Use it as input for NMinimize:
In[3]:=
Click for copyable input
Out[3]=
 
Read MPS data in a form suitable as input for LinearProgramming:
In[1]:=
Click for copyable input
Out[1]=
Use it as input for LinearProgramming:
In[2]:=
Click for copyable input
Out[2]=
 
Import and plot the constraint matrix of the previous example:
In[1]:=
Click for copyable input
Out[1]=