A question about BilevelJuMP.jl

using JuMP, BilevelJuMP, Xpress

model = BilevelModel()

@variable(Lower(model), x)
@variable(Upper(model), y)

@objective(Upper(model), Min, 3x + y)
@constraints(Upper(model), begin
    x <= 5
    y <= 8
    y >= 0
end)

@objective(Lower(model), Min, -x)
@constraints(Lower(model), begin
     x +  y <= 8
    4x +  y >= 8
    2x +  y <= 13
    2x - 7y <= 0
end)

optimize!(model, Xpress.Optimizer(), BilevelJuMP.SOS1Mode())

objective_value(model) # = 3 * (3.5 * 8/15) + 8/15
value(x) # = 3.5 * 8/15
value(y) # = 8/15

image
Run the example in the readme file. What is the cause of this error

Please don’t post the same question twice: KKT condition solves the bilevel optimization problem - #7 by abcde.

1 Like