Cannot warmstart same HiGHS model without rebuilding


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

m = build_knapsack()
@objective(m, Max, profit' * m[:x])
primals = value.(all_variables(m))

@objective(m, Min, profit' * m[:x])
# This line breaks
set_start_value.(all_variables(m), primals)

m2 = build_knapsack()
@objective(m2, Min, profit' * m2[:x])
# This line works
set_start_value.(all_variables(m2), primals)
1 Like

Thanks for reporting. The error looks like a bug. HiGHS doesn’t (currently) support warm starts, so the code should silently ignore warmstarts (rather than erroring).

This is expected behavior. HiGHS doesn’t support warm starts. The second time works because we add starts to the JuMP model, and these are silently ignored when copying to the HiGHS backend.

Warm starts will be supported when the next upstream release of HiGHS is made.

1 Like

Ah I see. I did not pay too much attention to the MIP logs to notice if the initial incumbent did anything different - did not realise the warmstarts were dropped. Thanks!

1 Like