I’m new using Julia to solve my nonlinear mixed integer bilevel model, so I have a model in JuMP using BilevelJuMP with binary and continuous variables at the lower and upper level and with non-linear [non quadratic] constraints and objectives in the two levels.
a. Is there a way for BilevelJuMP to accept nonlinear objectives and constraints not only in the upper level, but also in the lower? I’ve been using the Ipopt solver, but it doesn’t support discrete variables.
b. For the above case, trying another way to solve, I have linearized my objective and constraints in both levels, making it a linear mixed integer bilevel model. I’m using the CPLEX 20.1 solver in Julia 1.9.3.
model = BilevelModel(CPLEX.Optimizer, mode = BilevelJuMP.SOS1Mode())
I have installed and set the CPLEX_STUDIO_BINARIES environment variable and run Pkg.add(“CPLEX”) without any issue, but when I try to optimize the model, it doesn’t work, I get the following error message: Would you have any suggestions on how to solve the issue?
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
thanks