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

MibS_example2.jl #216

Open
shabnamvaziri opened this issue Mar 27, 2024 · 2 comments
Open

MibS_example2.jl #216

shabnamvaziri opened this issue Mar 27, 2024 · 2 comments

Comments

@shabnamvaziri
Copy link

Hi,

In MibS_example2.jl, when I change the variables to be continuous, I encounter the following error:

"Currently MibS works on only MIP-MIP problems and the input model is not MIP-MIP!!"

Stacktrace:
[1] _build_single_model(upper::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, lower::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, lower_to_upper_link::Dict{MathOptInterface.VariableIndex, MathOptInterface.VariableIndex}, lower_only::Dict{MathOptInterface.VariableIndex, MathOptInterface.VariableIndex}, check_MIPMIP::Bool)
@ BilevelJuMP C:\Users\umroot.julia\packages\BilevelJuMP\0Me8v\src\mibs.jl:65
[2] _build_single_model(model::BilevelModel, check_MIPMIP::Bool)
@ BilevelJuMP C:\Users\umroot.julia\packages\BilevelJuMP\0Me8v\src\mibs.jl:11
[3] (::BilevelJuMP.var"#64#65"{Bool, Bool, String, Bool, BilevelModel, typeof(mibs), String})(path::String)
@ BilevelJuMP C:\Users\umroot.julia\packages\BilevelJuMP\0Me8v\src\mibs.jl:280
[4] mktempdir(fn::BilevelJuMP.var"#64#65"{Bool, Bool, String, Bool, BilevelModel, typeof(mibs), String}, parent::String; prefix::String)
@ Base.Filesystem .\file.jl:766
[5] mktempdir(fn::Function, parent::String)
@ Base.Filesystem .\file.jl:762
[6] mktempdir
@ Base.Filesystem .\file.jl:762 [inlined]
[7] #solve_with_MibS#63
@ BilevelJuMP C:\Users\umroot.julia\packages\BilevelJuMP\0Me8v\src\mibs.jl:277 [inlined]
[8] solve_with_MibS(model::BilevelModel, mibs_call::Function)
@ BilevelJuMP C:\Users\umroot.julia\packages\BilevelJuMP\0Me8v\src\mibs.jl:268
[9] top-level scope
@ In[11]:61"

I use Julia 1.10.0 and Mibs Version: 1.1.3. Can you help me how to solve this error? I need to use Mibs for solving bilevel mixed integer model for my thesis.

Thank you

@odow
Copy link
Collaborator

odow commented Mar 27, 2024

As the error says, MibS supports only problems with mixed-integer variables in the lower and upper. It does not support the case where one of the levels contains only continuous variables.

@shabnamvaziri
Copy link
Author

@odow Thanks for your response. In "https://github.com/joaquimg/BilevelJuMP.jl/blob/master/docs/src/examples/MibS_example2.jl" there are 3 variables as follows:
@variable(Upper(model), x, Int)
@variable(Upper(model), z, Bin)

#Lower level variables
@variable(Lower(model), y, Int)
If I change x to be continuous and keep z binary and y integer, I cannot solve the problem. I am not sure if this is because of the installation of Mibs or you face the same error as well.

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