BilevelOptimization.BilevelLPType

A bilevel linear optimization problem of the form:

min cx^T * x + cy^T * y
s.t. G x + H y <= q
     x_j ∈ [xl_j,xu_j]
     x_j ∈ ℤ ∀ j ∈ Jx
     y ∈ arg min {
        d^T * y + x^T * F * y
        s.t. A x + B y <= b
             y_j ∈ [yl_j,yu_j]
        }

Note that integer variables are allowed at the upper level.

BilevelOptimization.build_blp_modelMethod
`build_blp_model(bp::BilevelLP, solver; [comp_method])`

Build a JuMP model (constraints and objective) based on the data from bp and with a solver.

Returns a tuple (m, x, y, λ, s).

An optional keyword comp_method can be passed for handling complementarity constraints, default is SOS1Complementarity.

BilevelOptimization.build_blp_modelMethod
`build_blp_model(m::JuMP.Model, bp::BilevelLP, x, y; [comp_method])`

Adds the lower-level constraints and optimality conditions to an existing JuMP model. This assumes the upper-level feasibility constraints and objective have already been set.

Returns a tuple (m, x, y, λ, s).

An optional keyword comp_method can be passed for handling complementarity constraints, default is SOS1Complementarity.

BilevelOptimization.build_blp_modelMethod
`build_blp_model(m, B, d, x, y, s, F; [comp_method])`

Build the bilevel JuMP model from the data without grouping everything into a BilevelLP. An optional keyword comp_method can be passed for handling complementarity constraints, default is SOS1Complementarity.

BilevelOptimization.add_complementarity_constraintFunction

Add complementarity constraints to the JuMP model m for each pair (s[i],λ[i]) with the corresponding complementarity method.

add_complementarity_constraint(m, cm::ComplementarityMethod, s, λ, y, σ)
BilevelOptimization.add_complementarity_constraintMethod
add_complementarity_constraint(m, bc::BoundComplementarity, s, λ, y, σ)

Implement complementarity constraints using big-M type constraints. This formulation introduces binary variables:

active_constraint[i] == 0 <=> λ[i] == 0
active_constraint[i] == 1 <=> s[i] == 0
variable_bound[j] == 0 <=> σ[j] == 0
variable_bound[j] == 1 <=> y[j] == 0
JuMP.set_lower_boundMethod

Set a lower bound on a lower or higher variable of bp depending on vartype

JuMP.setupperboundMethod

Set an upper bound on a lower or higher variable of bp depending on vartype Since we need the dual for lower-level upper bounds, this case is registered as a constraint.