Read MPS file for LP and MILP optimization data
problem = mpsread(mpsfile)
mps file and solve
the problem it describes.
eil33-2.mps file from a public
repository. View the problem type.
gunzip('http://miplib.zib.de/download/eil33-2.mps.gz') problem = mpsread('eil33-2.mps')
problem = f: [4516x1 double] Aineq: [0x4516 double] bineq: [0x1 double] Aeq: [32x4516 double] beq: [32x1 double] lb: [4516x1 double] ub: [4516x1 double] intcon: [4516x1 double] solver: 'intlinprog' options: [1x1 optim.options.Intlinprog]
problem.intcon is not empty,
The problem is an integer linear programming problem.
Change the options to suppress iterative display and to generate a plot as the solver progresses.
options = optimoptions('intlinprog','Display','final','PlotFcn',@optimplotmilp); problem.options = options;
Solve the problem by calling
[x,fval,exitflag,output] = intlinprog(problem);
Optimal solution found. Intlinprog stopped because the objective value is within a gap tolerance of the optimal value, options.RelativeGapTolerance = 0.0001 (the default value). The intcon variables are integer within tolerance, options.IntegerTolerance = 1e-05 (the default value).
mpsfile— Path to MPS file
Path to MPS file, specified as a character vector.
mpsfile should be a file
in the MPS format.
mpsread does not support semicontinuous
constraints or SOS constraints.
mpsread supports “fixed
mpsread does not support extensions
mpsread silently ignores variables
BOUNDS section that do not previously appear
COLUMNS section of the MPS file.
problem— Problem structure
Problem structure, returned as a structure with fields:
|Vector representing objective |
|Vector indicating variables that take integer values (empty for LP, nonempty for MILP)|
|Matrix in linear inequality constraints |
|Vector in linear inequality constraints |
|Matrix in linear equality constraints |
|Vector in linear equality constraints |
|Vector of lower bounds|
|Vector of upper bounds|
Default options, as returned by the command