-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
LpMaximize and writeMPS #697
Comments
So indeed, someone did think of this discrepancy at some point; there's a parameter for deciding which syntax to use: Lines 252 to 256 in c0c391a
It looks like(?) it's undocumented though, so explaining (e.g. in the documentation for LpProblem.writeMPS itself) that that's something to be aware of, what the caveats are and what one might want to use when.
|
Just for background, the original specification for the MPS format goes back decades, literally to the time when punch cards were used for input, and only allowed for minimization (which was just the silent default and could not be specified explicitly one way or the other). All MPS files that strictly adhere to that original specification thus describe minimization problems. Over time, the MPS format has been relaxed in various ways to get rid of restrictions that are now not really useful, including the prohibition on describing maximization problems. The |
Details for the issue
What did you do?
Consider writing the following simple LP to an MPS file:
The resulting file looks as follows:
In particular, the first line,
*SENSE:Maximize
indicates that we are indeed dealing with a maximization problem. I can't seem to be able to figure out where that's specified though. And I tried passing the MPS to HiGHS and MOSEK, both of which assume that we are dealing with a minimization problem instead.Wikipedia mentions the following syntax for specifying that a problem is a maximization problem, and e.g. HiGHS does manage to parse that:
Should I have expected
*SENSE:Maximize
to be something that solvers can parse, so that I can go on to blame the other solvers, should I maybe have realized that MPS isn't good for maximization problems altogether? If this syntax is PuLP-specific, might it make sense to switch to the possibly-supported syntax from Wikipedia?Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
I'm using python version:
I installed PuLP via:
Did you also
The text was updated successfully, but these errors were encountered: