How to Set Custom Stopping Criteria in CPLEX for Early Termination of MILP Solving?

Hi everyone,

I’m currently using GAMS Studio with the CPLEX solver to solve a Mixed-Integer Linear Programming (MILP) problem, and I’m hoping to get some help with setting up a specific stopping condition during the solving process.

Here’s what I’m trying to do:

  1. First, I relax the 0-1 integer variables of the MILP to continuous variables, turning it into an LP problem.
  2. I then solve the LP problem and get the relaxed solution.
  3. After that, I use a heuristic algorithm to find a feasible solution for the original MILP problem.
  4. If the gap between the feasible solution and the LP relaxed objective is less than 2%, I want to stop the solver and return this feasible solution.
  5. If not, I’d like to continue improving the solution until the condition is met or the optimal solution is found.

What I’ve tried so far:

To implement this, I’ve tried using the Option optcr=0.02 parameter, which sets a cutoff for the optimality gap. However, it seems to only work for global optimization, and CPLEX still continues to solve until it finds the optimal solution, which is not quite what I want.

What I’m hoping to achieve:

Ideally, I would like to tell CPLEX to stop as soon as it finds a feasible solution that meets the gap condition (less than 2% from the LP relaxed solution). I don’t want it to continue solving until the optimal solution is found. Is there a way to set this up in CPLEX or GAMS?

A few questions:

Is it possible to set custom stopping criteria in CPLEX using GAMS Studio that will allow it to stop early when a feasible solution meets certain conditions?

Additional Info:

  • GAMS version: 36
  • Solver: CPLEX20.1.0.1
  • Problem size: quite large

I really appreciate any suggestions or ideas!