Skip to content

Detect unbounded and infeasible problems#332

Open
BenjaminPINEAU wants to merge 5 commits intoJuliaSmoothOptimizers:masterfrom
BenjaminPINEAU:diverging_tol
Open

Detect unbounded and infeasible problems#332
BenjaminPINEAU wants to merge 5 commits intoJuliaSmoothOptimizers:masterfrom
BenjaminPINEAU:diverging_tol

Conversation

@BenjaminPINEAU
Copy link
Copy Markdown
Contributor

Allows AL, R2N and R2 to detect unbounded problems (see #331).
Considering the following unbounded problem:

problem = "hs378"
nlp = MathOptNLPModel(OptimizationProblems.PureJuMP.eval(Meta.parse(problem))(), name = problem)
quadratic_model = QuadraticModel(nlp, nlp.meta.x0, name = nlp.meta.name)
nlp_quadra = RegularizedNLPModel(quadratic_model, RootNormLhalf(0.5))

The AL algorithm now return

[ Info:   iter  sub_it       obj     cviol         μ     normy   sub_tol       sub_status  
[ Info:      0       0  -2.1e+01   0.0e+00   1.0e+01   0.0e+00   1.0e-01
[ Info:      1       6  -3.2e+34   1.7e+16   1.0e+01   1.8e+17   1.0e-01        unbounded
[ Info:      2       6  -7.0e+43   5.5e+20   2.0e+01   1.1e+22   2.5e-02        unbounded
[ Info:      3       6  -1.0e+48   2.2e+22   8.0e+01   1.7e+24   6.3e-03        unbounded
[ Info:      4       6  -8.4e+48   1.7e+22   3.2e+02   5.4e+24   1.6e-03        unbounded
[ Info:      5       6  -1.4e+49   5.5e+21   1.3e+03   7.1e+24   3.9e-04        unbounded
[ Info:      6       6  -1.8e+49   3.2e+21   2.6e+03   8.1e+24   1.0e-04        unbounded
[ Info:      7       6  -2.1e+49   1.7e+21   5.1e+03   8.6e+24   1.0e-04        unbounded
"Execution stats: objective function may be unbounded from below"

A problem (or subproblem) is stated as unbounded if $$f+h$$ or $$\lVert x \rVert$$ is higher than a tolerance for a given number of iterations.


This pull request also allowed AL to detect infeasible problem. Considering the following infeasible problem

nlp = ADNLPModel(
    x -> 0.5 * (x[1]^2 + x[2]^2 + x[3]^2),
    x0,
    x -> [x[1] - 1.0,
          x[1] - 2.0],
    zeros(2),
    zeros(2),
    name = "infeasible_linearization"
)
reg_nlp = RegularizedNLPModel(nlp, RootNormLhalf(0.5))

The AL algorithm now return

[ Info:   iter  sub_it       obj     cviol         μ     normy   sub_tol       sub_status  
[ Info:      0       0   0.0e+00   2.0e+00   1.0e+01   0.0e+00   1.0e-01
[ Info:      1       1   1.6e+00   5.8e-01   1.0e+01   7.2e+00   1.0e-01      first_order
[ Info:      2       1   1.7e+00   5.0e-01   1.0e+01   1.4e+01   2.5e-02      first_order
[ Info:      3       1   1.7e+00   5.0e-01   2.0e+01   2.8e+01   6.3e-03      first_order
[ Info:      4       1   1.7e+00   5.0e-01   4.0e+01   5.7e+01   1.6e-03      first_order
[ Info:      5       0   1.7e+00   5.0e-01   8.0e+01   1.1e+02   3.9e-04      first_order
[ Info:      6       1   1.7e+00   5.0e-01   1.6e+02   2.3e+02   9.8e-05      first_order
[ Info:      7       1   1.7e+00   5.0e-01   3.2e+02   4.5e+02   2.4e-05      first_order
[ Info:      8       0   1.7e+00   5.0e-01   6.4e+02   9.1e+02   6.1e-06      first_order
"Execution stats: problem may be infeasible"

The algorithm stops when cviol is hight and the regularization parameter increases for a given number of iterations.

@dpo

Comment thread src/AL_alg.jl Outdated
Comment thread src/AL_alg.jl Outdated
Comment thread src/AL_alg.jl Outdated
Comment thread src/AL_alg.jl
diverging_obj_tol::T = -eps(T)^(-1),
cviol_tol::T = eps(T)^(-1),
diverging_max_iter::Int = 5,
cviol_max_iter::Int = 5,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

Comment thread src/AL_alg.jl Outdated
Comment thread src/AL_alg.jl
mu *= factor_penalty_up
if cviol > cviol_tol
cviol_iter += 1
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cviol_iter should be reset to zero if cviol ≤ cviol_tol. We want the tolerance to be exceeded for a number of consecutive iterations, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, my mistake, this has been implemented in R2 and R2N but not in AL.

Comment thread src/AL_alg.jl
end
if (fx + hx < diverging_obj_tol) || (norm(solver.x) > diverging_iterates_tol)
mu *= factor_penalty_up
diverging_iter = diverging_iter + 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

BenjaminPINEAU and others added 4 commits May 5, 2026 11:30
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
@BenjaminPINEAU
Copy link
Copy Markdown
Contributor Author

@dpo I was also wondering if we could add the criterion $$\lVert s \rVert / \nu$$ to consider a problem as unbounded.
For instance in the following problem

problem = "elec"
nlp = MathOptNLPModel(OptimizationProblems.PureJuMP.eval(Meta.parse(problem))(), name = problem)
quadratic_model = QuadraticModel(nlp, nlp.meta.x0, name = nlp.meta.name)

we can detect that the problem is unbounded much more quickly (considering the number of iteration of the subsolver):

# without the criterion
[ Info:   iter  sub_it       obj     cviol         μ     normy   sub_tol       sub_status  
[ Info:      0       0   6.9e+02   0.0e+00   1.0e+01   0.0e+00   1.0e-01
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0   1000  0.0e+00  0.0e+00  1.1e+03 -4.2e+12  7.4e-04  0.0e+00  1.5e-13  7.5e+15 ↗
[ Info:      1    1000   6.9e+02   2.2e-16   1.0e+01   5.8e-15   1.0e-01         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0   1000  6.9e+02  0.0e+00  1.1e+03  1.0e+00  7.4e-04  0.0e+00  1.5e-13  7.5e+15 ↘
[ Info:      2    1000  -6.6e+307  4.6e+130   1.0e+01  8.0e+131   2.5e-02         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      3    1000  -6.6e+307  4.6e+130   4.0e+01  3.2e+132   6.3e-03         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      4    1000  -6.6e+307  4.6e+130   1.6e+02  1.3e+133   1.6e-03         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      5    1000  -6.6e+307  4.6e+130   6.4e+02  5.1e+133   3.9e-04         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      6    1000  -6.6e+307  4.6e+130   2.6e+03  2.1e+134   9.8e-05         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      7    1000  -6.6e+307  4.6e+130   1.0e+04  8.2e+134   2.4e-05         max_iter
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      0 -6.6e+307  0.0e+00      Inf      NaN  7.4e-04 1.3e+146 1.3e+146  7.5e+15 =
[ Info:      8    1000  -6.6e+307  4.6e+130   4.1e+04  3.3e+135   1.0e-05         max_iter
"Execution stats: objective function may be unbounded from below"
# with the criterion
[ Info:   iter  sub_it       obj     cviol         μ     normy   sub_tol       sub_status  
[ Info:      0       0   6.9e+02   0.0e+00   1.0e+01   0.0e+00   1.0e-01
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0     17  0.0e+00  0.0e+00  1.1e+03 -4.2e+12  7.4e-04  0.0e+00  1.5e-13  7.5e+15 ↗
[ Info:      1     109   6.9e+02   2.2e-16   1.0e+01   5.8e-15   1.0e-01        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0     17  6.9e+02  0.0e+00  1.1e+03  1.0e+00  7.4e-04  0.0e+00  1.5e-13  7.5e+15 ↘
[ Info:      2      80  -5.1e+34   1.3e-06   1.0e+01   2.2e-05   2.5e-02        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -5.1e+34  0.0e+00  2.8e+25  1.0e+00  7.4e-04  3.7e+09  1.9e+10  7.5e+15 ↘
[ Info:      3       6  -1.8e+44   7.6e-02   2.0e+01   2.6e+00   6.3e-03        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -1.8e+44  0.0e+00  1.6e+30  1.0e+00  7.4e-04  2.2e+14  1.1e+15  7.5e+15 ↘
[ Info:      4       6  -6.2e+53   4.5e+03   8.0e+01   6.2e+05   1.6e-03        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -6.2e+53  0.0e+00  9.7e+34  1.0e+00  7.4e-04  1.3e+19  6.8e+19  7.5e+15 ↘
[ Info:      5       6  -2.2e+63   2.7e+08   3.2e+02   1.5e+11   3.9e-04        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -2.2e+63  0.0e+00  5.7e+39  1.0e+00  7.4e-04  7.6e+23  4.0e+24  7.5e+15 ↘
[ Info:      6       6  -7.6e+72   1.6e+13   1.3e+03   3.5e+16   9.8e-05        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -7.6e+72  0.0e+00  3.4e+44  1.0e+00  7.4e-04  4.5e+28  2.4e+29  7.5e+15 ↘
[ Info:      7       6  -2.6e+82   9.2e+17   5.1e+03   8.2e+21   2.4e-05        unbounded
[ Info:  outer  inner     f(x)     h(x)  √(ξ1/ν)        ρ        σ      ‖x‖      ‖s‖      ‖B‖ R2N 
[ Info:      0      6 -2.6e+82  0.0e+00  2.0e+49  1.0e+00  7.4e-04  2.7e+33  1.4e+34  7.5e+15 ↘
[ Info:      8       6  -9.2e+91   5.5e+22   2.0e+04   1.9e+27   1.0e-05        unbounded
"Execution stats: objective function may be unbounded from below"

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.

2 participants