MPS
From OpenOpt
MPS is a well-known file format (Mathematical Programming System). See its wikipedia.org entry for more details.
You can export OpenOpt and FuncDesigner LP/MILP problems into MPS (lpsolve and its Python binding should be properly installed, you may take a look at the instructions mentioned in LP or MILP).
Usage:
success = p.exportToMPS(filename{, optionalParameters})
where p is OpenOpt or FuncDesigner-coded LP/MILP instance to be exported.
Options:
- filename should be a string like 'milp_1' (write into current directory), '/home/dmitrey/milp_1' (use absolute path), '../other_folder/milp2' (relative path) etc. If file name not ends with '.MPS' or '.mps', then '.mps' extension will be appended. Using Python language path separator (\\) is not implemented/checked, so for different OS you'd better use their own path separators or mere write into current directory.
- format =
-
- 'fixed' (default, use fixed MPS format)
- 'free' (use free MPS format)
- Note: free format is less standardized, but fixed format requires variable names to be no longer than 8.
- startIndex = 0 (default) or 1; if you have FuncDesigner model that has a variable of size>1 (named Name), it will be split into variables Name_0, Name_1, ... for startIndex = 0 and Name_1, Name_2, ... for startIndex = 1.
Output:
-
success is
- False if a error occurred (read-only file system, no write access, etc)
- True, otherwise
Examples:
You can solve problems defined in MPS files with a variety of solvers at NEOS server for free; BTW they have Python API along with web, Java API and some others.