branch_ryanfoster.c
Go to the documentation of this file.
22 * This file implements the Ryan/Foster branching rule. For more details see \ref BINPACKING_BRANCHING page.
27 * standard variable branching has the disadvantage that the zero branch is more or less useless because
28 * we only forbid one packing out of exponential many. On the other hand, the branch fixing a packing reduces the problem since
33 * In Computer scheduling of public transport: Urban passenger vehicle and crew scheduling, A. Wren editor, North-Holland 1981, 269-280.
45 * To select a pair of items, we have to know for each packing the items which are contained. Since every packing is a
46 * variable and each item is a set covering constraint, we have to know for each variable in which set covering
47 * constraints it appears (this means, has a coefficient of 1.0). Since \SCIP is constraint based, it is in general
48 * not possible to get this information directly. To overcome this issue, we use the functionality to add
50 * variable. This variable data contains the constraints in which this variable appears (see vardata_binpacking.c for more details).
52 * information which items belong to which packing. Therefore, we can use the Ryan/Foster idea to select a pair of
57 * After having selected a pair of items to branch on, the question now is how to realize such a branching with \SCIP.
59 * constraint based, it is really easy to do that. We implement a constraint handler which handles the
61 * decisions. Furthermore, it also ensures that all packing which are not feasible at a particular node are
62 * locally fixed to zero. For more details, we refer to the \ref cons_samediff.c "source code of the constraint handler".
66 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
128 SCIPdebugMsg(scip, "start branching at node %"SCIP_LONGINT_FORMAT", depth %d\n", SCIPgetNNodes(scip), SCIPgetDepth(scip));
157 /* get variable data which contains the information to which constraints/items the variable belongs */
198 /* there is no variable with (fractional) LP value > 0 that contains exactly one of the items */
230 SCIP_CALL( SCIPcreateConsSamediff(scip, &consdiffer, "differ", id1, id2, DIFFER, childdiffer, TRUE) );
264 SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY, BRANCHRULE_MAXDEPTH,
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip_branch.c:384
Definition: type_result.h:33
Ryan/Foster branching rule.
Definition: struct_scip.h:58
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip_mem.h:132
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
Definition: scip_prob.c:3599
Definition: struct_var.h:198
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Definition: branch_ryanfoster.c:253
Constraint handler stores the local branching decision data.
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)
Definition: cons_samediff.c:552
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:903
Variable data containing the ids of constraints in which the variable appears.
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
Definition: scip_branch.c:105
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:516
int * SCIPvardataGetConsids(SCIP_VARDATA *vardata)
Definition: vardata_binpacking.c:124
Definition: struct_tree.h:133
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip_branch.c:238
Definition: struct_cons.h:37
Definition: type_retcode.h:33
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: scip_branch.c:959
Definition: struct_branch.h:69
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip_prob.c:3376
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:431
Definition: cons_samediff.h:37
Problem data for binpacking problem.
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:447
Definition: cons_samediff.h:38
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1187
int SCIPvardataGetNConsids(SCIP_VARDATA *vardata)
Definition: vardata_binpacking.c:116
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1970
Definition: type_result.h:45
static SCIP_DECL_BRANCHEXECLP(branchExeclpRyanFoster)
Definition: branch_ryanfoster.c:96
Definition: objbenders.h:33