How to read SMPS format in Python with gurobipy?
回答済みHello,
I am attempting to benchmark some stochastic programming problems from the POSTS test set (here). I have seen that Gurobi can read MPS files with gp.read("file.mps"), but SMPS format contains three files: xx.cor, xx.tim, and xx.sto. Trying to read the .cor file via
import gurobipy as gp
m = gp.read("pltexpA7.cor")
print(m.numVars, m.numConstrs)
gives the following error message with gurobipy v.11.0.0:
{
"name": "GurobiError",
"message": "Unknown file type for file 'pltexpA7.cor'",
"stack": "---------------------------------------------------------------------------
GurobiError Traceback (most recent call last)
Cell In[3], line 3
1 import gurobipy as gp
----> 3 m = gp.read(\"pltexpA7.cor\")
5 print(m.numVars, m.numConstrs)File src\\\\gurobipy\\\\gurobi.pxi:3779, in gurobipy.read()
File src\\\\gurobipy\\\\gurobi.pxi:117, in gurobipy.gurobi.read()
GurobiError: Unknown file type for file 'pltexpA7.cor'"
}
Is it possible to read SMPS formatted problems with Gurobi in python?
-
Hi Graham,
Is it possible to read SMPS formatted problems with Gurobi in python?
Gurobi does not support SMPS files. A list of supported file formats can be found in the File Formats section of the docs. In order to read in SMPS files, you would have to write an own parsing tool or use an open-source one if there is any.
Best regards,
Jaromił0
サインインしてコメントを残してください。
コメント
1件のコメント