-
-
Notifications
You must be signed in to change notification settings - Fork 411
Description
Some solvers, as Gurobi, have a value (GRB_UNDEFINED in Gurobi) that means the variable has not a MIP start set. This is useful not only to specify a partial warm start (which can also be obtained just by not setting a MIP start for some variable), but because this allows to clean an older MIP start (what seems to be impossible right now without throwing the whole model away). One reason to do that cleaning is to be able to set a new partial MIP start. If a MIP start is partial this means that it does not describe a valid solution, and the solver may need to define a value for other variables (that have no MIP start set) to find a valid/feasible solution from it. If the variables it needs to change have already an older MIP start set, then it has not this freedom. The way it is now, calls to set_start_value will accumulate, "dirtying" the state from the model in a way that can only be "cleaned"/reset by a full empty! (basically you need to recreate the whole model just to be able to set a new MIP start). There is no concept of starting a new MIP start.
The solution I propose is just not requiring the value passed to JuMP.set_start_value to be of a Number. As it can be seen here, the method just calls MOI.set, and in Gurobi.jl, for example, MOI.set is defined to take a Union{Float64, Nothing}. Let the error be raised at the wrapper level if something not supported is passed.