-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add switch for global vs local solvers (status codes) #19
Comments
Currently, the implicit assumption (given in the default values for the keyword arguments That is, the termination codes that appear in the current tests are:
For a global solver, I would expect But for the primal result codes, it's a little bit more complicated. Currently, the tests use:
So, maybe we need more than one dimension of characterizing the solver? The signature of the test functions themselves could be changed in a way that there is one keyword argument to signal whether we expect the problem to be feasible vs infeasible, rather than giving the codes for termination and primal result explictly. |
I also wonder whether we should make a distinction between convex and non-convex problems. |
A quick sketch before I start a proper PR: # We only distinguish between feasible and infeasible problems now.
@enum ProblemTypeCode FEASIBLE_PROBLEM INFEASIBLE_PROBLEM
# Optimizers can decide either local or global optimality.
@enum SolverCapabilityCode LOCAL GLOBAL
"""
OptimizerCapability
A value of the enum OptimizerCapabilityCode.
"""
struct OptimizerCapability <: JuMP.MOI.AbstractOptimizerAttribute end
# Optimizers have (assumed) local capabilities, unless specified explicitly.
JuMP.MOI.get(optimizer::AbstractOptimizer, ::OptimizerCapability) = LOCAL
TERMINATION_TARGET = Dict(
(FEASIBLE_PROBLEM, GLOBAL) => JuMP.MOI.OPTIMAL,
(FEASIBLE_PROBLEM, LOCAL) => JuMP.MOI.LOCALLY_SOLVED,
(INFEASIBLE_PROBLEM, GLOBAL) => JuMP.MOI.INFEASIBLE,
(INFEASIBLE_PROBLEM, LOCAL) => JuMP.MOI.LOCALLY_INFEASIBLE,
)
PRIMAL_TARGET = Dict(
(FEASIBLE_PROBLEM, GLOBAL) => JuMP.MOI.FEASIBLE_POINT,
(FEASIBLE_PROBLEM, LOCAL) => JuMP.MOI.FEASIBLE_POINT,
# not really a property of local/global?!
(INFEASIBLE_PROBLEM, GLOBAL) => JuMP.MOI.NO_SOLUTION,
(INFEASIBLE_PROBLEM, LOCAL) => JuMP.MOI.INFEASIBLE_POINT,
) That way, we would need to change all test case functions, removing the current keywork arguments for the status codes, but adding a It also means that any given optimizer (type) can only have either So, it might be better to just pass down the value for the capabiliy, together with the solver tolerances. |
Note that the tests already support over-riding the statuses: It's just a matter of hooking it up here: |
I don't quite follow your suggestions.
Sure, but I can't simply override the statuses of all test cases (using the same values). So, the correct target status is a function of both the optimizer and the problem in the test case. |
Good point. So maybe a |
Hm, yeah. I don't see a way of making the change I propose without also changing the signature of all of the test functions (to include a |
As discussed in #17, we could add a switch to specify that the given solver is able to find a global optimum and decide infeasibility globally (e.g. BARON, KNITRO, SCIP) or will only give results that are valid locally (e.g. IPOPT).
The text was updated successfully, but these errors were encountered: