Skip to content
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

GLPK always called with --mps, which is for fixed MPS format only #402

Open
siddharth-krishna opened this issue Jan 8, 2025 · 3 comments

Comments

@siddharth-krishna
Copy link

As we discovered in open-energy-transition/solver-benchmark#86, many energy models write out MPS files in the "free" MPS format, which requires the --freemps option to be passed to glpsol instead of --mps, which is what linopy uses. This causes GLPK to error on inputs that it could otherwise solve successfully.

@FabianHofmann, would the correct solution here be to add a solver option to the GLPK solver that picks between the free/fixed MPS formats? I'd be happy to create a PR once we figure out the best way forward. 🙏

@FabianHofmann
Copy link
Collaborator

hey @siddharth-krishna, this can well be! I am not super sure about the common use case of both formats, but I'd be happy to change it if you think the format is stable and compatible for most usage

@siddharth-krishna
Copy link
Author

@odow perhaps you have more experience here, would it make sense to change the default option used by linopy to --freemps? Or should we implement a solver option to pick between the two?

@odow
Copy link
Contributor

odow commented Jan 8, 2025

Just always pass --freemps. Pretty much any fixed format MPS file should be parseable as freemps. The only issue might be if there are variable or column names with leading spaces. But JuMP would never write one, and I don't think Linopy would. And anyone that does is cursed.

But also. Don't spend too much time worrying about GLPK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants