Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect MPS import #529

Closed
4 tasks done
drdv opened this issue Mar 12, 2022 · 0 comments · Fixed by #530
Closed
4 tasks done

Incorrect MPS import #529

drdv opened this issue Mar 12, 2022 · 0 comments · Fixed by #530

Comments

@drdv
Copy link
Contributor

drdv commented Mar 12, 2022

Details for the issue

Consider the MPS file (taken from here)

NAME          TESTPROB
ROWS
 N  COST
 L  LIM1
 G  LIM2
 E  MYEQN
COLUMNS
    XONE      COST                 1   LIM1                 1
    XONE      LIM2                 1
    YTWO      COST                 4   LIM1                 1
    YTWO      MYEQN               -1
    ZTHREE    COST                 9   LIM2                 1
    ZTHREE    MYEQN                1
RHS
    RHS1      LIM1                 5   LIM2                10
    RHS1      MYEQN                7
BOUNDS
 UP BND1      XONE                 4
 LO BND1      YTWO                -1
 UP BND1      YTWO                 1
ENDATA

What did you do?

Executed _, problem = pulp.LpProblem.fromMPS('test.mps')

What did you expect to see?

I expected for the LIM2 constraint to be LIM2: XONE + ZTHREE >= 10

What did you see instead?

TESTPROB:
MINIMIZE
1.0*XONE + 4.0*YTWO + 9.0*ZTHREE + 0
SUBJECT TO
LIM1: XONE + YTWO <= 5

LIM2: XONE + ZTHREE >= 0

MYEQN: - YTWO + ZTHREE = 7

VARIABLES
XONE <= 4 Continuous
-1 <= YTWO <= 1 Continuous
ZTHREE Continuous

In my test, all MPS files whose RHS section contains definitions in Fields 5 & 6 are not imported correctly. The following modification of the MPS file is imported correctly (I simply manually moved the LIM2 RHS specification):

NAME          TESTPROB
ROWS
 N  COST
 L  LIM1
 G  LIM2
 E  MYEQN
COLUMNS
    XONE      COST                 1   LIM1                 1
    XONE      LIM2                 1
    YTWO      COST                 4   LIM1                 1
    YTWO      MYEQN               -1
    ZTHREE    COST                 9   LIM2                 1
    ZTHREE    MYEQN                1
RHS
    RHS1      LIM1                 5
    RHS1      LIM2                10
    RHS1      MYEQN                7
BOUNDS
 UP BND1      XONE                 4
 LO BND1      YTWO                -1
 UP BND1      YTWO                 1
ENDATA

I tested with pysmps and it imports both versions of the MPS file correctly.

Useful extra information

What operating system are you using?

Linux: (Fedora)

I'm using python version:

3.10.2

I installed PuLP via:

Did you also

It seems related to #459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant