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

Support Gurobi's computeIIS() and convertToFixed() #32

Open
staadecker opened this issue Dec 11, 2024 · 8 comments
Open

Support Gurobi's computeIIS() and convertToFixed() #32

staadecker opened this issue Dec 11, 2024 · 8 comments

Comments

@staadecker
Copy link

staadecker commented Dec 11, 2024

I just shared my progress with the rest of my team and they mentioned that it would be very important to be able to call Gurobi's .computeIIS() method and .convertToFixed(). The former has proven incredibly helpful in many cases and the later is an active part of our current processes. I'm guessing this should be pretty easy to expose in the PyOptInterface API?

@staadecker staadecker changed the title Support computeIIS() Support Gurobi's computeIIS() and convertToFixed() Dec 11, 2024
@staadecker
Copy link
Author

staadecker commented Dec 11, 2024

Alternatively, it might be possible to create a generic .run_solver_function(function_name). Like that users could not only do:

  • .run_solver_function("computeIIS")
  • .run_solver_function("convertToFixed")

But they could also execute other functions like .run_solver_function("optimizeasync") and .run_solver_function("terminate")

@metab0t
Copy link
Owner

metab0t commented Dec 12, 2024

convertToFixed is easy to expose.

computeIIS requires a little more work because I need to implement APIs to query the IIS status for variable (upper/lower bound) and constraints.

@staadecker
Copy link
Author

Great! If we can't access the iis status on the variables that's ok since we'd still be able to write out a .ilp file (containing those variables)

@metab0t
Copy link
Owner

metab0t commented Dec 12, 2024

_converttofixed has been added for Gurobi: db70ec6

I use an underscored name to indicate it is an internal function, and there is no similar function in other solvers. You can call it in Pyoframe.

A more general way would be recording the indices and bounds of integer variables and convert them to continuous one, then provide API to convert it back if needed, like what JuMP.jl does.

@metab0t
Copy link
Owner

metab0t commented Dec 12, 2024

For IIS, I propose to add a model.computeIIS() method and add IISUpperBound, IISLowerBound variable attributes and IIS constraint attribute.

@staadecker Is it OK for you?

@staadecker
Copy link
Author

Yes!

@metab0t
Copy link
Owner

metab0t commented Dec 13, 2024

@staadecker IIS support is implemented in 68b5a04

Documentation will be added later.

@staadecker
Copy link
Author

Let me know when you release the changes in a new version! (Right now I have to compile your library myself and I rather not set up that process in my CI pipeline)

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

2 participants