- Procedure GMP::Instance::SetCallbackAddLazyConstraint(GMP, callback)
GMP::Instance::SetCallbackAddLazyConstraint installs a
callback procedure for adding lazy constraints during the solution
process of a MIP model.
GMP::Instance::SetCallbackAddLazyConstraint( GMP, ! (input) a generated mathematical program callback ! (input) an AIMMS procedure )
The procedure returns 1 on success, or 0 otherwise.
The callback procedure is called by the solver in these situations
when the solver compares an integer-feasible solution (including an integer-feasible solution provided by a MIP start before any nodes exist) to lazy constraints;
when the LP at a node is unbounded, and a lazy constraint might cut off the primal ray.
GMP::SolverSession::GenerateCutcan be used inside a
CallbackAddLazyConstraintcallback procedure to add (globally or locally valid) lazy constraints during the MIP branch & cut process. Lazy constraints added to the problem are first put into a pool of lazy constraints, so they are not present in the subproblem LP until after the callback is finished.
If lazy constraints have been added, the subproblem is re-solved and evaluated, and, if the LP solution is still integer feasible and not cut off, the lazy constraint callback is called again.
The callback procedure should have exactly one argument; a scalar input element parameter into the set
CallbackAddLazyConstraintcallback procedure should have a return value of
0, if you want the solution process to stop, or
1, if you want the solution process to continue.
To remove the callback the empty element should be used as the callback argument.
CallbackAddLazyConstraintcallback procedure will only be called when solving mixed integer programs with CPLEX or Gurobi.
This procedure can also be used for MIQP and MIQCP problems.