How to write a simple MPS file to submit to NEOS servers

265 views Asked by At

I'm trying to find an open source lp solver that is fast enough to my problem. I'm trying to build a MPS file so I can submit it to NEOS servers and compare the performance of different solvers.

My problem involves, at its most difficult cases, something around 150 integer variables but I'm starting with a simple case to help me figure out how the MPS file format works.

This is the problem:

minimize  : 330.3 * M1 + 1132.88 * M2 + 955.86 * M3
subject to:
         20 <= 60 * M2 <= 20.9
         20 <= 34 * M3 <= 20.9
         M1 + M2 + M3 = 1

and I wrote the following MPS file:

NAME problema1
ROWS
 L  K
 L  N
 E  ONE
 N  CUSTO
COLUMNS
    M1        ONE       1              CUSTO     330.3
    M2        K         60
    M2        ONE       1              CUSTO     1132.88
    M3        N         34
    M3        ONE       1              CUSTO     955.86
RHS
    KLESS     K         20.9
    NLESS     N         20.9
    ONEREST   ONE       1
RANGES
    RANGE1    K         0.9
    RANGE2    N         0.9
ENDATA

Using the linear solvers available at NEOS (https://neos-server.org/neos/solvers/index.html), just Gurobi can solve it. The others find the problem is infeasible (which it's not).

I'm pretty confident that this is a problem with my MPS file, but I just can't figure it out what it is. What am I doing wrong?

1

There are 1 answers

5
Erwin Kalvelagen On BEST ANSWER

Indeed your MPS file has a problem. The lines in the RHS section should have one name e.g.

RHS
    RHS1      K         20.9
    RHS1      N         20.9
    RHS1      ONE       1

Basically the solver picks one RHS set. Similar for the RANGES section. I am not sure what you intended using the lines in the RANGES section.