Currently, we support MPS and LP file formats for optimization models.
MPS Format (Recommended)
The MPS format is a widely recognized standard format for representing linear and mixed-integer programming problems. Most tools used for building optimization models can export your models in a .mps file format. We recommend using this format for the most consistent results. Files should be saved with the .mps extension.
LP Format
The LP format is a more human-readable way to represent optimization models. It’s often easier to inspect manually and is also supported by many modeling tools. Files should be saved with the .lp extension.
Note that all files must be encoded as UTF-8
Export Examples from Popular Modeling Tools
Python (Pyomo)
model.write("my_model.mps", io_options={'symbolic_solver_labels': True})
Setting symbolic_solver_labels
to True
ensures that the variable and constraint names in the MPS file are the same as the ones you defined in your Pyomo model. Without this, the variable names are anonymized into x1
, x2
, etc.
You can also submit your models directly from Pyomo using the rosepy Python library. See this article on the rosepy Python SDK for more information.
Python (PuLP)
model.writeMPS("my_model.mps")
Julia (JuMP)
write_to_file(model, "my_model.mps")
Comments
0 comments
Please sign in to leave a comment.