CPLEX cpxcb INCUMBENT

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the CPLEX Manual. See CPLEX.

CPLEX MIP Incumbent callback.

Called from TOMLAB /CPLEX during mixed integer optimization when a new integer solution has been found but before this solution has replaced the current best known integer solution.

This file can be used to perform any desired analysis of the new integer solution and return a status flag to the solver deciding whether to stop or continue the optimization, and also whether to accept or discard the newly found solution.

This callback is enabled by setting callback(14)=1 in the call to cplex.m, or Prob.M I P.callback(14) = 1 if using tomRun('cplex',...).

cpxcb_INCUMBENT is called by the solver with three arguments:

  • x - The new integer solution
  • f - The objective value at x
  • Prob - The TOMLAB problem structure

cpxcb INCUMBENT should return one of the following scalar values:

  • 0 - Continue optimization and accept new integer solution
  • 1 - Continue optimization but discard new integer solution
  • 2 - Stop optimization and accept new integer solution
  • 3 - Stop optimization and discard new integer solution

Any other return value will be interpreted as 0.

If modifying this file, it is recommended to make a copy of it which is placed before the original file in the MATLAB path.