VariablePrimalStart() is not supported by the model and LazyBridgeOptimizer

I’m trying to do a MIP-start on a multicommodity capacitated fixed-charge network design problem using JuMP 0.19 and CPLEX 12.8 with the set_start_value function, but I keep getting the following error :
MathOptInterface.UnsupportedAttribute{MathOptInterface.VariablePrimalStart}: Attribute MathOptInterface.VariablePrimalStart() is not supported by the model.

Here is a made up example that produces the error:

using JuMP
using CPLEX

model = Model(with_optimizer(CPLEX.Optimizer))

@variable(model,0<= x[1:10] <= 12)
@variable(model, y[1:5],Bin)
@constraint(model, x[3] == 4y[2])
@constraint(model, con, sum(y->1-y,y)>=3)
@objective(model,Max, sum(x)+15*sum(y))

optimize!(model)#1
for i in y
    set_start_value(i,0)
end
optimize!(model)#2

If I remove #1, the error becomes a warning saying that MathOptInterface.VariablePrimalStart() is not supported by MathOptInterface.Bridges.LazyBridgeOptimizer and that the information will be discarded.

Since I am rather new to Julia, I would like to understand whether the error is caused by a mistake or misunderstanding of the documentation on my part or by a known problem in MOI or JuMP and how I should go about fixing it.
It would also be nice to know why the error sometimes becomes a warning.

Since I am rather new to Julia, I would like to understand whether the error is caused by a mistake or misunderstanding of the documentation on my part or by a known problem in MOI or JuMP and how I should go about fixing it.

The CPLEX wrapper does not support MIP starts yet. I opened an issue Support VariablePrimalStart · Issue #243 · jump-dev/CPLEX.jl · GitHub

Since the transition to MOI, some things are still a little rough around the edges. Part of the problem is that MOI keeps getting new things added to it, and the solver wrappers haven’t always kept up. (I don’t have, or use CPLEX for example, so it isn’t a priority for me.)

We’re in the process of finishing up a new release of MOI, which addresses a number of issues, but it means that all of the solver wrappers will have to updated (yet again). However, we’re taking advantage of this change to re-write the wrappers to simplify them and ensure that they code to the full MOI API (see, e.g., Gurobi and GLPK).

If you’re interested (and have a few days spare), it would be great to re-write the CPLEX wrapper. It might seem daunting at first, but it shouldn’t be too hard, because you can copy-and-paste the Gurobi.jl wrapper, and then it’s mostly some function re-naming. It’s more tedious if anything. Let me know, and we can point you in the right direction.

3 Likes

Unfortunately, I will not be able to help with the Cplex wrapper and the project will have to migrate to C++. Thank you very much for your answer. I hope I will be able to contribute in the future.

I have the same issue here. I try a very simple problem (see the code below). Note that the initial solution is actually one of the optimal solution. However, I got “Warning, invalid warm-start basis discarded”. When I use Cbc, I got the same warning.
I am not sure what I did wrong and how to fix it.

Thank you very much for your help and time

using JuMP
using MathOptInterface
using Gurobi
myModel=Model(with_optimizer(Gurobi.Optimizer))
@variable(myModel, x, Int)
@variable(myModel, y, Int)
@variable(myModel, z>=0)
@variable(myModel, e[1:3], Bin)
@constraint(myModel,con1, 2x+3y<=10)
@constraint(myModel,con2, 3x+2y<=12)
@constraint(myModel,con3, z==2x+4y)
@constraint(myModel,con4, x>=y)
@constraint(myModel, con5, sum(e)==1)
@objective(myModel, Max,z)
@show myModel
vars=all_variables(myModel)
vals=[2,2,12,1,0,0]
set_start_value.(vars,vals)
optimize!(myModel)
@show termination_status(myModel) == MOI.OPTIMAL
@show primal_status(myModel) == MOI.FEASIBLE_POINT
has_values(myModel)
value.(vars)