Time limit for Gurobi LP Solver #736
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asetTimeLimit(uint64_t seconds)
method that sets the time limit parameter of the underlying Gurobi environment.GurobiLpSolver
has asetTimeLimit(uint64_t seconds)
method that sets the parameter in theGurobiEnvironment
.getContinuousValue(...)
,getIntegerValue(...)
,getBinaryValue(...)
andgetObjectiveValue(...)
. 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.