I am keen to learn how to feed an initial solution to a solver. I use the following example and I got the above warning when I used CPLEX, Cbc, Gurobi, GLPK. Could any one point me in the right direction to solve this issue or is there any solver that accepts an initial solution?
Many thanks in advance.
using JuMP
using MathOptInterface
using Gurobi
using CPLEX
using GLPK
using Cbc
function solveModel(solver)
myModel=Model(with_optimizer(solver.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)
vars=all_variables(myModel)
vals=[2,2,12,1,0,0]
set_start_value.(vars,vals)
optimize!(myModel)
@show termination_status(myModel) == MathOptInterface.OPTIMAL
@show primal_status(myModel) == MathOptInterface.FEASIBLE_POINT
has_values(myModel)
sol=value.(vars)
return myModel, sol
end