Gurobi not using barrier method

With a little bit of hacking, you can expose Gurobi’s multi-objective support directly:

using JuMP, Gurobi
model = direct_model(Gurobi.Optimizer())
@variable(model, x[1:2] >= 0)
@constraint(model, sum(x) >= 1)
@constraint(model, x[1] + 2x[2] >= 1.5)
@constraint(model, x[2] >= 0.25)
@expression(model, f1, 2x[1] + x[2])
@expression(model, f2, x[1] + 3x[2])
@objective(model, Min, f1)
grb = backend(model)
MOI.set(
    grb, 
    Gurobi.MultiObjectiveFunction(2), 
    moi_function(f2),
)
MOI.set(grb, Gurobi.MultiObjectivePriority(1), 1)
MOI.set(grb, Gurobi.MultiObjectivePriority(2), 2)
optimize!(model)

The second barrier solve is likely more efficient because you’re adding in the objective constraint. Are you adding it exactly or with a small tolerance? You probably want to add @constraint(model, c'x <= opt + 1e-4) or similar.

As far as I know, Gurobi doesn’t warm-start the barrier, but it uses a basis warm-start for simplex. However adding a constraint and modifying the objective simultaneously will invalidate the primal and dual basis.

1 Like