Skip to content

Time limit for Gurobi LP Solver #736

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cxlvinchau
Copy link

This PR adds the possibility to specify a time limit when using the Gurobi LP solver. This allows for stopping the solver before an optimal solution is found and retrieving sub-optimal solutions.

The following changes have been made:

  • GurobiEnvironment now has a setTimeLimit(uint64_t seconds) method that sets the time limit parameter of the underlying Gurobi environment.
  • Accordingly, GurobiLpSolver has a setTimeLimit(uint64_t seconds) method that sets the parameter in the GurobiEnvironment.
  • The methods for retrieving sub-optimal solutions have been adapted, i.e. getContinuousValue(...), getIntegerValue(...), getBinaryValue(...) and getObjectiveValue(...). More precisely, the checks for infeasiblity and unboundedness have been removed. If the problem is infeasible, then the check of the solution count will be zero. If the problem is unbouded, Gurobi might still find a solution before it determines that the problem is indeed unbounded. In that case a user might still be interested in a solution.

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

Successfully merging this pull request may close these issues.

1 participant