Closed matbesancon closed 4 years ago
The issue at present is that bridges handle constraints on a case-by-case basis. This requires bridges to be able to "see" multiple constraints: the complementarity constraint and the variable bounds.
The answer is probably to write a solver wrapper like https://github.com/chkwon/Complementarity.jl/blob/master/src/mpec.jl, which does different reformulations.
model = Model(() -> Complementarity.Optimizer(Gurobi.Optimizer, method = Complementarity.Indicator()))
@variable(model, x)
@constraint(model, [2x, x] in MOI.Complements(1))
optimize!(model)
You could also do the Fisher-Burmeister
model = Model(() -> Complementarity.Optimizer(Ipopt.Optimizer, method = Complementarity.FisherBurmeister()))
@variable(model, x)
@constraint(model, [2x, x] in MOI.Complements(1))
optimize!(model)
I'm settling on the idea of "model transforms", which are solvers which wrap other solvers and provide model-level reformulations. A good example is Dualization.Optimizier
.
You could nest these, so that you get something like:
Model(
() -> JuMP.ConicPresolve(Dualization.Optimizer(SCS.Optimizer()))
)
Take a JuMP model, presolve it, then take the dual, then solve with SCS.
Closing this for now, let's see if we can come up with an alternative solution to bridges for this
In order to leverage MILP solvers for linear complementarity problems, indicator constraints seem rather natural, with a bridge introducing binary variables. Two formulations would be:
I think
zl + zu + zint == 1
will convert the equality into two inequalities at the solver level (when running the simplex), so not sure the number of constraints vary. On the other hand, some solvers do not support activate on zero.