Procedure GMP::Instance::SetCallbackBranch(GMP, callback)


The procedure GMP::Instance::SetCallbackBranch installs a callback procedure to be called after a branch has been selected but before the branch is carried out during the MIP optimization. In the callback routine, the branch selected by the solver can be changed to a user-selected branch.

     GMP,            ! (input) a generated mathematical program
     callback        ! (input) an AIMMS procedure



An element in AllGeneratedMathematicalPrograms.


A reference to a procedure in the set AllIdentifiers.

Return Value

The procedure returns 1 on success, or 0 otherwise.


  • This callback is not called when the subproblem is infeasible.

  • In the callback procedure at most 2 branches can be specified.

  • The callback procedure should have exactly one argument; a scalar input element parameter into the set AllSolverSessions.

  • The CallbackBranch callback 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.

  • The CallbackBranch callback procedure cannot be used to get the column on which the solver will branch.

  • A CallbackBranch callback procedure will only be called when solving mixed integer programs with CPLEX.