Hi,
Ran into a bit of a weird issue with trying to use the HiGHS solver for sequential objective optimisation.
When trying to use set_start_value
for warmstarting, it works perfectly fine if the second objective model is separate from the first. If instead I try to re-use the first model and change the objective, JuMP returns the following error:
MathOptInterface.UnsupportedAttribute{MathOptInterface.VariablePrimalStart}: Attribute MathOptInterface.VariablePrimalStart() is not supported by the model.
Note that either way works fine with Gurobi.
See example code below:
using JuMP, HiGHS
profit = [5, 3, 2, 7, 4]
weight = [2, 8, 4, 2, 5]
capacity = 10
function build_knapsack()
model = Model(HiGHS.Optimizer)
@variable(model, x[1:5], Bin)
@constraint(model, weight' * x <= capacity)
return model
end
m = build_knapsack()
@objective(m, Max, profit' * m[:x])
optimize!(m)
primals = value.(all_variables(m))
@objective(m, Min, profit' * m[:x])
# This line breaks
set_start_value.(all_variables(m), primals)
optimize!(m)
m2 = build_knapsack()
@objective(m2, Min, profit' * m2[:x])
# This line works
set_start_value.(all_variables(m2), primals)
optimize!(m2)