54#define BRANCHRULE_NAME "vanillafullstrong"
55#define BRANCHRULE_DESC "vanilla full strong branching"
56#define BRANCHRULE_PRIORITY -2000
57#define BRANCHRULE_MAXDEPTH -1
58#define BRANCHRULE_MAXBOUNDDIST 1.0
60#define DEFAULT_INTEGRALCANDS FALSE
62#define DEFAULT_SCOREALL FALSE
64#define DEFAULT_IDEMPOTENT FALSE
66#define DEFAULT_COLLECTSCORES FALSE
67#define DEFAULT_DONOTBRANCH FALSE
71struct SCIP_BranchruleData
133 *provedbound = lpobjval;
136 *bestdown = lpobjval;
138 *bestdownvalid =
FALSE;
139 *bestupvalid =
FALSE;
143 for(
c = 0;
c < ncands; ++
c )
160 for(
c = 0;
c < ncands ; ++
c )
183 SCIPdebugMsg(
scip,
"applying vanilla strong branching on variable <%s> with solution %g\n",
190 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &
lperror) );
195 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &
lperror) );
203 "(node %" SCIP_LONGINT_FORMAT ") error in strong branching call for variable <%s> with solution %g\n",
209 down =
MAX(down, lpobjval);
210 up =
MAX(up, lpobjval);
211 downgain = down - lpobjval;
212 upgain = up - lpobjval;
216 assert(downinf || !downconflict);
217 assert(upinf || !upconflict);
227 if( !downinf && downvalid )
231 if( !upinf && upvalid )
248 if( score > *bestscore )
253 *bestdownvalid = downvalid;
254 *bestupvalid = upvalid;
258 SCIPdebugMsg(
scip,
" -> cand %d/%d (prio:%d) var <%s> (solval=%g, downgain=%g, upgain=%g, score=%g) -- best: <%s> (%g)\n",
263 if( !integral && !scoreall && downinf && upinf )
283 *provedbound =
MAX(*provedbound, minbound);
350 if( branchruledata->candscores !=
NULL )
354 if( branchruledata->cands !=
NULL )
359 branchruledata->candcapacity = -1;
360 branchruledata->ncands = -1;
361 branchruledata->npriocands = -1;
362 branchruledata->bestcand = -1;
398 if( branchruledata->integralcands )
411 if( ncands > branchruledata->candcapacity )
414 if( branchruledata->candscores !=
NULL)
417 branchruledata->candscores =
NULL;
419 if( branchruledata->cands !=
NULL)
422 branchruledata->cands =
NULL;
428 assert(branchruledata->candcapacity >= ncands);
431 if( branchruledata->cands ==
NULL )
435 if( branchruledata->candscores ==
NULL && branchruledata->collectscores )
441 branchruledata->ncands = ncands;
442 branchruledata->npriocands = npriocands;
444 for(
i = 0;
i < ncands;
i++ )
445 branchruledata->cands[
i] = cands[
i];
448 branchruledata->scoreall, branchruledata->idempotent, branchruledata->candscores,
449 &branchruledata->bestcand, &bestdown, &bestup, &bestscore, &bestdownvalid,
450 &bestupvalid, &provedbound) );
452 if( !branchruledata->donotbranch )
454 assert(0 <= branchruledata->bestcand && branchruledata->bestcand < branchruledata->ncands);
481 if( !branchruledata->idempotent && allcolsinlp && !exactsolve )
488 var = branchruledata->cands[branchruledata->bestcand];
492 SCIPdebugMsg(
scip,
" -> %d candidates, selected candidate %d: variable <%s>[%g,%g] (solval=%g, down=%g, up=%g, score=%g)\n",
498 if( !branchruledata->idempotent && allcolsinlp && !exactsolve )
500 if( downchild !=
NULL && bestdownvalid )
505 if( upchild !=
NULL && bestupvalid )
534 branchruledata->cands =
NULL;
535 branchruledata->candscores =
NULL;
536 branchruledata->candcapacity = -1;
537 branchruledata->ncands = -1;
538 branchruledata->npriocands = -1;
539 branchruledata->bestcand = -1;
556 "branching/vanillafullstrong/integralcands",
557 "should integral variables in the current LP solution be considered as branching candidates?",
560 "branching/vanillafullstrong/idempotent",
561 "should strong branching side-effects be prevented (e.g., domain changes, stat updates etc.)?",
564 "branching/vanillafullstrong/scoreall",
565 "should strong branching scores be computed for all candidates, or can we early stop when a variable has infinite score?",
568 "branching/vanillafullstrong/collectscores",
569 "should strong branching scores be collected?",
572 "branching/vanillafullstrong/donotbranch",
573 "should candidates only be scored, but no branching be performed?",
602 *cands = branchruledata->cands;
604 if( candscores && branchruledata->collectscores )
606 *candscores = branchruledata->candscores;
610 *ncands = branchruledata->ncands;
614 *npriocands = branchruledata->npriocands;
618 *
bestcand = branchruledata->bestcand;
#define BRANCHRULE_PRIORITY
#define BRANCHRULE_MAXDEPTH
#define BRANCHRULE_MAXBOUNDDIST
#define DEFAULT_IDEMPOTENT
SCIP_RETCODE SCIPgetVanillafullstrongData(SCIP *scip, SCIP_VAR ***cands, SCIP_Real **candscores, int *ncands, int *npriocands, int *bestcand)
static SCIP_RETCODE runVanillaStrongBranching(SCIP *scip, SCIP_VAR **cands, int ncands, int npriocands, SCIP_Bool scoreall, SCIP_Bool idempotent, SCIP_Real *scores, int *bestcand, SCIP_Real *bestdown, SCIP_Real *bestup, SCIP_Real *bestscore, SCIP_Bool *bestdownvalid, SCIP_Bool *bestupvalid, SCIP_Real *provedbound)
#define DEFAULT_INTEGRALCANDS
#define DEFAULT_DONOTBRANCH
#define DEFAULT_COLLECTSCORES
vanilla full strong LP branching rule
#define SCIP_LONGINT_FORMAT
SCIP_RETCODE SCIPincludeBranchruleVanillafullstrong(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_Bool SCIPisExactSolve(SCIP *scip)
int SCIPgetNIntVars(SCIP *scip)
int SCIPgetNImplVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule,)
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Bool SCIPallColsInLP(SCIP *scip)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPfreeBlockMemoryNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPgetVarStrongbranchFrac(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Bool idempotent, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
SCIP_RETCODE SCIPgetVarStrongbranchInt(SCIP *scip, SCIP_VAR *var, int itlim, SCIP_Bool idempotent, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror)
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
public methods for branching rules
public methods for message output
public methods for branch and bound tree
public methods for problem variables
public methods for branching rule plugins and branching
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for querying solving statistics
public methods for the branch-and-bound tree
public methods for SCIP variables
#define SCIP_DECL_BRANCHEXECLP(x)
#define SCIP_DECL_BRANCHINIT(x)
#define SCIP_DECL_BRANCHCOPY(x)
#define SCIP_DECL_BRANCHEXIT(x)
#define SCIP_DECL_BRANCHFREE(x)
struct SCIP_Branchrule SCIP_BRANCHRULE
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_Node SCIP_NODE