Skip to content
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

Throw better error for unsupported constraint types #211

Open
odow opened this issue Oct 27, 2023 · 1 comment
Open

Throw better error for unsupported constraint types #211

odow opened this issue Oct 27, 2023 · 1 comment

Comments

@odow
Copy link
Collaborator

odow commented Oct 27, 2023

See https://discourse.julialang.org/t/issues-solving-a-bilevel-optimization-with-binary-variables/105460

The unhelpful error is

Constraints of function MathOptInterface.SingleVariable in the Set MathOptInterface.ZeroOne are not implemented

Stacktrace:
[1] error(::String, ::Type, ::String, ::Type, ::String)
@ Base .\error.jl:44
[2] supported_constraints(con_types::Vector{Tuple{DataType, DataType}})
@ Dualization C:\Users\kchuq.julia\packages\Dualization\wDRnB\src\supported.jl:9
[3] dualize(primal_model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, dual_problem::Dualization.DualProblem{Float64, MathOptInterface.Utilities.GenericModel{Float64, Dualization.DualizableModelFunctionConstraints{Float64}}}, dual_names::Dualization.DualNames, variable_parameters::Vector{MathOptInterface.VariableIndex}, ignore_objective::Bool)
@ Dualization C:\Users\kchuq.julia\packages\Dualization\wDRnB\src\dualize.jl:50
[4] #dualize#9
@ C:\Users\kchuq.julia\packages\Dualization\wDRnB\src\dualize.jl:12 [inlined]
[5] dualize
@ C:\Users\kchuq.julia\packages\Dualization\wDRnB\src\dualize.jl:4 [inlined]
[6] build_bilevel(upper::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, lower::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}}, link::Dict{MathOptInterface.VariableIndex, MathOptInterface.VariableIndex}, upper_variables::Vector{MathOptInterface.VariableIndex}, mode::BilevelJuMP.SOS1Mode{Float64}, upper_var_lower_ctr::Dict{MathOptInterface.VariableIndex, MathOptInterface.ConstraintIndex}; copy_names::Bool, pass_start::Bool)
@ BilevelJuMP C:\Users\kchuq.julia\packages\BilevelJuMP\YP5EH\src\moi.jl:287
[7] optimize!(model::BilevelModel; lower_prob::String, upper_prob::String, bilevel_prob::String, solver_prob::String, file_format::MathOptInterface.FileFormats.FileFormat)
@ BilevelJuMP C:\Users\kchuq.julia\packages\BilevelJuMP\YP5EH\src\jump.jl:387
[8] optimize!(model::BilevelModel)
@ BilevelJuMP C:\Users\kchuq.julia\packages\BilevelJuMP\YP5EH\src\jump.jl:351
[9] top-level scope
@ In[70]:1
@joaquimg
Copy link
Owner

Ultimately, this is a Dualization.jl error.
Not sure where is best to fix and how.

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

No branches or pull requests

2 participants