-
Notifications
You must be signed in to change notification settings - Fork 38
Description
It seems that MPB statuses needs to be reworked. See e.g.:
- MISOCP solves returning status "Unknown" (different from #100) MOSEK/Mosek.jl#101
- save optimization data for
stat !=: Optimalnlp problems jump-dev/JuMP.jl#938 - getsolution() returns infeasible solution for an unbounded problem jump-dev/Gurobi.jl#80
- Test that getsolution is feasible when problem is Unbounded #144
Following @erling-d-andersen's comment, it would help to separate the statuses in
- Feasibility/Optimality of
getsolution - Feasibility/Optimality of
getdual - Feasibility/Boundedness of the primal
- Feasibility/Boundedness of the dual
- Optimizer status : why he has stopped
I do not claim to have a perfect solution for a new status mechanism, I am just hoping to open the discussion with a reasonable start.
Optimizer status
Afther calling optimize!, status would return:
| Name | Reason of stopping |
|---|---|
| Success | Found something to share (e.g. infeasibility ray) |
| NumericalError | Encountered numerical difficulties |
| Stall | Stopped because no more progress could be made but the time limit/iteration limit was not reached |
| UserLimit | Stopped because of time limit/iteration limit was reached |
| Out Of Memory | More space needs to be allocated than what is available |
| Error | Other reason than listed above |
Questions:
- Should the status be a symbol of a subtype of
abstract AbstractOptimizerStatus? If it is a subtype thenUserLimitcould contain a string message giving more precision that would be printed if we callshowon it orUserLimitcould be an abstract type that is subtyped by each solver. What would you prefer ?
Problem Status
We could split the primal (resp. dual) status in 2:
| Yes | No | Unknown | |
|---|---|---|---|
| Feasible | |||
| Bounded |
In view of this, we could define:
isprimalfeasible(m):trueif it is sure that the primal is feasible,falseif it is sure it is infeasible,- throws an error otherwise,
knowsprimalfeasibility(m):true:isprimalfeasiblewould returnfalse:isprimalfeasiblewould throw an error
and likewise isprimalbounded, knowsprimalboundedness, isdualfeasible; knowsdualfeasible, isdualbounded, knowsdualboundedness.
These functions would only reflect the knowledge acquired by the last optimize! called !
Questions:
- What if someone wants to save the problem status to be used later ? We could add a function
problemstatuswhich would return a object of typeProblemStatuswhich can answer to the same 8 functionis.../knows.... - Does Unbounded also means Feasible or simply that an unbounded ray has been found (See Test that getsolution is feasible when problem is Unbounded #144 ) ?
- Does Bounded also means Feasible ? I would say no to that. Typically it means that the dual is feasible. By the way the boundedness of the primal might seem redundant with the feasibility of the dual. However, it might happen that the primal is bounded and the dual is infeasible in case of (infinite) strong duality failure (I do not have any example to give but I don't see what prevents it to happen).
Solution Status
primalsolutionavailable(m)the solver allows to retrieve values for primal variables, i.e.getsolutionwould not throw an error.dualsolutionavailablethe solver allows to retrieve values for variable and constraint dual variables, i.e.getdual, ... would not throw an error.
issolutionfeasible(m) (resp. issolutionoptimal(m)) would true if we are sure that the solution that would be returned by getsolution(m) is feasible (resp. optimal), otherwise, it returns false.
false would not mean that we are sure that it is not feasible (resp. not optimal), it would just mean that we do not know whether it is optimal/feasible.
Questions:
- What if we want to store the solution status to query it later ? We could define
solutionstatus(m)that would returnSolutionStatuswhich could reply toissolutionfeasibleandissolutionoptimal.