Stop Julia at certain optimiality gap and return decision variables


#1

I have a MILP problem and I am trying to solve it using CPLEX package through JuMP in Julia Language. However, the problem takes a long time to be solved. Is there a way to stop the program and return decision variables when the optimality gap reaches for example 10%. Thank you.


#2

I haven’t used CPLEX, but I believe you can do:

m = Model(solver=CplexSolver(CPX_PARAM_EPGAP=1e-2))

or

setsolver(m, CplexSolver(CPX_PARAM_EPGAP=1e-2))

#3

(the above assumes you are using CPLEX through JuMP, which I just realized you didn’t actually say).


#4

Thank you, it works.


#5

Yes, I am using CPLEX through JuMP.
Sorry for not mentioning it.