Monday, November 21, 2011

MPS Files (2)

As follow up on http://yetanothermathprogrammingconsultant.blogspot.com/2011/10/mps-files.html it is noted that Microsoft Solver Foundation also reads some MPS files incorrectly. E.g. consider the files:

 C:\Users\erwin\Documents>type mip4mps.oml Model[   Decisions[Integers[0, Infinity], x],   Constraints[x <= 5],   Goals[Maximize[x]] ] C:\Users\erwin\Documents>type output.mps NAME          MODEL ROWS L  constrai N  goal_8ef COLUMNS     INTMARK   'MARKER'                 'INTORG'     x         constrai   1             goal_8ef  -1     INTMARK   'MARKER'                 'INTEND' RHS     RHS       constrai   5 BOUNDS ENDATA C:\Users\erwin\Documents>

The MPS file was generated from the OML file. If we inspect the MPS file we see no bounds on x. This means the variable x should be binary.

If we solve the MPS file with Solver Foundation we see:

 C:\Users\erwin\Documents>"\Program Files (x86)\Microsoft Solver Foundation\3.0.2.10889\Bin\MSFCli.exe" +verbose 3 output.mps ===== Processing .\output.mps ===== Solution Quality: Optimal ===Solver Foundation Service Report=== Date: 11/21/2011 10:27:00 PM Version: Microsoft Solver Foundation 3.0.2.10889 Standard Edition Model Name: DefaultModel Capabilities Applied: MILP Solve Time (ms): 367 Total Time (ms): 489 Solve Completion Status: Optimal Solver Selected: Microsoft.SolverFoundation.Solvers.SimplexSolver Algorithm: Primal Arithmetic: Hybrid Variables: 1 -> 1 + 2 Rows: 2 -> 2 Nonzeros: 2 Eliminated Slack Variables: 0 Pricing (exact): SteepestEdge Pricing (double): SteepestEdge Basis: Slack Pivot Count: 1 Phase 1 Pivots: 0 + 0 Phase 2 Pivots: 1 + 0 Factorings: 4 + 1 Degenerate Pivots: 0 (0.00 %) Branches: 0 ===Solution Details=== Goals: goal_8ef: -5 Decisions: x: 5 ===== Finished .\output.mps: 00:00:00.5501834 =====

This is incorrect. The reported value of x=5 indicates x is not read as a binary variable. If we solve the MPS file with CBC we see: