Initializing help system before first use

# problem.addChangeBranchObjectCallback

Purpose
Declares a callback function that will be called after the selection of a MIP entity to branch on. This callback allows the user to inspect and replace the Optimizer's choice of how to branch the current node. This callback will also be called in the case when there are no candidates to branch on, that is, when all MIP entities are already satisfied. This callback function will be called in addition to any callbacks already added by problem.addChangeBranchObjectCallback.
Topic areas
Callback, Branching
Synopsis
`problem.addChangeBranchObjectCallback(chgbranchobject, data=None, priority=0)`
`newbranch = chgbranchobject(cbprob, cbdata, branch)`
Arguments

chgbranchobject | The callback function, which takes arguments cbprob, cbdata, branch and newbranch. This function is called every time the Optimizer has selected a candidate entity for branching.
data: Any | A user-defined data to be passed to the callback function, chgbranchobject.
priority: int | An integer that determines the order in which multiple callbacks of this type will be invoked. The callback added with a higher priority will be called before a callback with a lower priority. Set to 0 if not required.
cbprob: problem | The problem passed to the callback function, chgbranchobject.
cbdata: Any | The user defined data passed as data when setting up the callback.
branch: branchobj | The candidate branching data selected by the Optimizer. Will be None if no candidates exist.

Return value

newbranch: branchobj | Optional new branching data to replace the Optimizer's selection. If branch or None is passed back, no change will be applied.

Further information
1. The branching data given by the Optimizer provides a linear description of how the Optimizer intends to branch on the selected candidate. This will often be one of standard MIP entities of the current problem, but can also be e.g. a split disjunction or a structural branch, if those features are turned on.
2. The functions branchobj.getBranches, branchobj.getBounds and branchobj.getRows can be used to inspect the given branching data.
3. Refer to xpress.branchobj on how to create a new branching data to replace the Optimizer's selection. Note that the new branching data should be created with a priority value no higher than the current data to guarantee it will be used for branching.
Related topics
problem.removeChangeBranchObjectCallback, xpress.branchobj.
Parent Topic Xpress problem object methods

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.