pulp
pulp copied to clipboard
PuLP does not recognize PL bound type in .mps files
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
I ran into exactly the same issue and came up, with the same solution.