Search code examples
glpk

GLPK/GLPSOL - Missing Data Columns in MIP Solution


Our application, up to this point, works using GLPSOL version 3.1, which, when provided with a MIP problem, outputs a solution that includes the Status (St) and Marginal columns.

We've had to upgrade to a newer version, and now, the same problem results in a solution file lacking those columns, as well as presenting these differences:

Original solution file:

Problem:    _jx1
Rows:       43
Columns:    27 (27 integer, 27 binary)
Non-zeros:  96
Status:     INTEGER OPTIMAL
Objective:  31 (MAXimization)

New solution file:

Problem:    _jx1
Rows:       42
Columns:    27
Non-zeros:  87
Status:     OPTIMAL
Objective:  C0 = 31 (MAXimum)

Additionally, the solver seems to crop out a few data rows.

The closest I've come to solving the issue is running the solver with the --nomips parameter, which gives me the aforementioned data columns, but yields different results.

The issue is that the solution is then fed to a parser, and having to tinker with said parser should be a last-resort option (and, in any case, the lack of data columns means we don't have all the information we need for the parsing).

So my question is twofold:

  1. Why is this happening?
  2. How can I set up the solver so I get the same results as before?

Thanks


Solution

  • 1. This is basically happening because there are no marginal values in mixed integer problems. In version 4.9 the developers changed the MIP solver and I think the new one won't automatically calculate "marginals".

    2. A common method is to calculate the optimal values for the integer variables with a MIP algorithm and then use the marginals of the same problem with the integer variables fixed to the MIP-Solution.

    You can't do this just with glpsol and the command line options. You'll have to implement the functionality on your own in the code. In the GLPK Sourcecode exists the glp_mpl_postsolve function, which is also handling the solution of an problem for post processing the solution. You can probably implement the calculation in a similar way.