XPRSaddcbsepnode
XPRSaddcbsepnode |
Purpose
This function is deprecated and may be removed in future releases. Please use branching objects instead. Declares a separate
callback function to specify how to branch on a
node in the branch and bound tree using a global object. A node can be branched by applying either
cuts or
bounds to each node. These are stored in the
cut pool. This callback function will be called in addition to any callbacks already added by XPRSaddcbsepnode.
Synopsis
int XPRS_CC XPRSaddcbsepnode(XPRSprob prob, int (XPRS_CC *f_sepnode)(XPRSprob my_prob, void *my_object, int ibr, int iglsel, int ifup, double curval), void *object, int priority);
Arguments
prob
|
The current problem.
|
f_sepnode
|
The callback function, which takes six arguments,
my_prob,
my_object,
ibr,
iglsel,
ifup and
curval, and has an integer return value.
|
my_prob
|
The problem passed to the callback function,
f_sepnode.
|
my_object
|
The user-defined object passed as
object when setting up the callback with
XPRSaddcbsepnode.
|
ibr
|
The branch number.
|
iglsel
|
The global entity number.
|
ifup
|
The direction of branch on the global entity (same as
ibr).
|
curval
|
Current value of the global entity.
|
object
|
A user-defined object to be passed to the callback function,
f_sepnode .
|
priority
|
An integer that determines the order in which 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.
|
Example
This example solves a MIP, using a separation callback function to branch on fractional integer variables. It assumes the presence of an estimation callback function (not shown), defined by
XPRSaddcbestimate, to identify a fractional integer variable.
XPRSaddcbsepnode(prob,nodeSep,NULL,0); XPRSmipoptimize(prob,"");
where the function
nodeSep may be defined as follows:
int nodeSep(XPRSprob my_prob, void *my_object, int ibr, int iglsel, int ifup, double curval) { XPRScut index; double dbd; if( ifup ) { dbd = floor(xval); XPRSstorebounds(my_prob, 1, &iglsel, "U", &dbd, &index); } else { dbd = ceil(xval); XPRSstorebounds(my_prob, 1, &iglsel, "L", &dbd, &index); } XPRSsetbranchbounds(prob, index); return 0; }
Further information
1. The return value of the
f_sepnode callback function is currently ignored.
2. Consider using the more flexible
branching objects, as described for the
XPRS_bo_create function.
3. The user separate routine is called
nbr times where
nbr is returned by the estimate callback function,
XPRSaddcbestimate. This allows multi-way branching to be performed.
4. The bounds and/or cuts to be applied at a node must be specified in the user separate routine by calling
XPRSsetbranchbounds and/or
XPRSsetbranchcuts.
Related topics
XPRSremovecbsepnode,
XPRSsetbranchbounds,
XPRSsetbranchcuts,
XPRSaddcbestimate,
XPRSstorebounds,
XPRSstorecuts.