-
Notifications
You must be signed in to change notification settings - Fork 11
Detect unbounded and infeasible problems #332
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,7 +102,12 @@ If adopted, the Hessian is accessed as an abstract operator and need not be the | |
|
|
||
| - `x::AbstractVector`: a primal initial guess (default: `reg_nlp.model.meta.x0`) | ||
| - `y::AbstractVector`: a dual initial guess (default: `reg_nlp.model.meta.y0`) | ||
| - `atol::T = √eps(T)`: absolute optimality tolerance; | ||
| - `atol::T = eps(T)^(1/3)`: absolute tolerance | ||
| - `diverging_iterates_tol::T = eps(T)^(-1)`: diverging tolerance for the norm of the iterates (the norm should be lower than the tolerance); | ||
| - `diverging_obj_tol::T = -eps(T)^(-1)`: diverging tolerance for the objective function (the objective function should be higher than the tolerance); | ||
| - `cviol_tol::T = eps(T)^(-1)`: tolerance to determine whether the constraints are infeasible | ||
| - `diverging_max_iter::Int = 5`: maximum number of iteration at which `diverging_obj_tol` or `diverging_iterates_tol` is violated; | ||
|
BenjaminPINEAU marked this conversation as resolved.
Outdated
|
||
| - `cviol_max_iter::Int = 5`: maximum number of iteration at which the regularisation parameter is increasing and the constraints are still violated; | ||
| - `ctol::T = atol`: absolute feasibility tolerance; | ||
| - `verbose::Int = 0`: if > 0, display iteration details every `verbose` iteration; | ||
| - `max_iter::Int = 10000`: maximum number of iterations; | ||
|
|
@@ -209,7 +214,12 @@ function SolverCore.solve!( | |
| callback = (args...) -> nothing, | ||
| x::V = reg_nlp.model.meta.x0, | ||
| y::V = reg_nlp.model.meta.y0, | ||
| atol::T = √eps(T), | ||
| atol::T = eps(T)^(1/3), | ||
| diverging_iterates_tol::T = eps(T)^(-1), | ||
| diverging_obj_tol::T = -eps(T)^(-1), | ||
| cviol_tol::T = eps(T)^(-1), | ||
|
BenjaminPINEAU marked this conversation as resolved.
Outdated
|
||
| diverging_max_iter::Int = 5, | ||
| cviol_max_iter::Int = 5, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main question is to find out if the criteria you implemented result in a lot of "false positives", i.e., problems that are falsely detected as (locally) infeasible. |
||
| verbose::Int = 0, | ||
| max_iter::Int = 10000, | ||
| max_time::Float64 = 30.0, | ||
|
|
@@ -225,6 +235,9 @@ function SolverCore.solve!( | |
| ) where {T, V} | ||
| reset!(stats) | ||
|
|
||
| local diverging_iter::Int = zero(Int) | ||
| local cviol_iter::Int = zero(Int) | ||
|
BenjaminPINEAU marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Retrieve workspace | ||
| nlp = reg_nlp.model | ||
| h = reg_nlp.h | ||
|
|
@@ -315,6 +328,8 @@ function SolverCore.solve!( | |
| # objective | ||
| fx = obj(nlp, solver.x) | ||
| hx = @views h(solver.x[selected]) | ||
| improper = (hx == -Inf) | ||
|
|
||
| objx = fx + hx | ||
| set_objective!(stats, objx) | ||
| set_solver_specific!(stats, :smooth_obj, fx) | ||
|
|
@@ -345,19 +360,19 @@ function SolverCore.solve!( | |
| set_time!(stats, time() - start_time) | ||
| set_status!( | ||
| stats, | ||
| SolverCore.get_status( | ||
| nlp, | ||
| get_status( | ||
| reg_nlp; | ||
| elapsed_time = stats.elapsed_time, | ||
| iter = stats.iter, | ||
| optimal = optimal, | ||
| infeasible = false, | ||
| parameter_too_large = false, | ||
| unbounded = false, | ||
| stalled = false, | ||
| exception = false, | ||
| improper = improper, | ||
| diverging_iter = diverging_iter, | ||
| cviol_iter = cviol_iter, | ||
| max_eval = max_eval, | ||
| max_time = max_time, | ||
| max_iter = max_iter, | ||
| diverging_max_iter = diverging_max_iter, | ||
| cviol_max_iter = cviol_max_iter, | ||
| ), | ||
| ) | ||
|
|
||
|
|
@@ -372,6 +387,13 @@ function SolverCore.solve!( | |
| if !done | ||
| if cviol > max(ctol, factor_primal_linear_improvement * cviol_old) | ||
| mu *= factor_penalty_up | ||
| if cviol > cviol_tol | ||
| cviol_iter += 1 | ||
| end | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, my mistake, this has been implemented in |
||
| end | ||
| if (fx + hx < diverging_obj_tol) || (norm(solver.x) > diverging_iterates_tol) | ||
| mu *= factor_penalty_up | ||
| diverging_iter = diverging_iter + 1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| end | ||
| update_μ!(solver.sub_problem.model, mu) | ||
| cviol_old = cviol | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.