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

PuLP does not recognize PL bound type in .mps files #635

Closed
vladimirvalenta opened this issue Mar 7, 2023 · 1 comment · Fixed by #746
Closed

PuLP does not recognize PL bound type in .mps files #635

vladimirvalenta opened this issue Mar 7, 2023 · 1 comment · Fixed by #746

Comments

@vladimirvalenta
Copy link

System:
MacBook (INTEL CPU), Ventura 13.2, Python 3.8
PuLP 2.7.0

From Wikipedia :
https://en.wikipedia.org/wiki/MPS_(format)
The optional BOUNDS section specifies lower and upper bounds on individual variables, if they are not given by rows in the matrix. .... Bound type PL is for a free positive from zero to plus infinity, but as this is the normal default, it is seldom used.

About 10% of models in MipLib2017 benchmark contain PL Bound variable lines and PuLP throws an exception when running
var, prob = LpProblem.fromMPS(modelName)

The fix appears to be easy: in mps_lp.py, under readMPSSetBounds add two lines. There is no need to call set_both_bounds because the bounds are <0, infinity> which is the default

   if bound == "FR":
        set_both_bounds(None, None)
        return
    elif bound == "BV":
        set_both_bounds(0, 1)
        return
    # add these two lines
    elif bound == "PL":
        return
@rutger-van-beek-cqm
Copy link
Contributor

I ran into exactly the same issue and came up, with the same solution.

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