67#define BRANCHRULE_NAME "multaggr"
68#define BRANCHRULE_DESC "fullstrong branching on fractional and multi-aggregated variables"
69#define BRANCHRULE_PRIORITY 0
70#define BRANCHRULE_MAXDEPTH -1
71#define BRANCHRULE_MAXBOUNDDIST 1.0
74#define DEFAULT_REEVALAGE 0LL
76#define DEFAULT_MAXPROPROUNDS 0
78#define DEFAULT_PROBINGBOUNDS TRUE
86struct SCIP_BranchruleData
107 int firstmultaggrdepth;
114 int nmultaggrconsadd;
125 int totalmultaggrcands;
146 assert(branchruledata->nmultaggrbranch >= 0);
147 assert(branchruledata->size >= 0);
150 if( branchruledata->nmultaggrbranch + 1 > branchruledata->size )
153 assert(newsize >= branchruledata->nmultaggrbranch + 1);
155 branchruledata->size = newsize;
232 SCIPdebugMsg(
scip,
"cannot perform probing in selectVarMultAggrBranching, depth limit reached.\n");
245 for(
i = 0;
i < nfixvars;
i++ )
251 for(
i = 0;
i < nfixvars;
i++ )
258 fixvarssol = fixvarssols[
i];
283 startprobing =
FALSE;
324 SCIPdebugMsg(
scip,
"error solving down node probing LP: status=%d\n", solstatdown);
340 for( j = 0 ; j < ndownvars; j++ )
351 estimateincr =
MIN(pscdown, pscup);
353 estimateprobdown += estimateincr;
386 SCIPdebugMsg(
scip,
"error solving up node probing LP: status=%d\n", solstatup);
395 SCIPdebugMsg(
scip,
" down node objval: %g up node objval: %g\n", downobjval, upobjval);
404 for( k = 0 ; k < nupvars; k++ )
415 estimateincr =
MIN(pscdown, pscup);
416 estimateprobup += estimateincr;
422 if( downinf || upinf )
431 if( downinf && upinf )
433 SCIPdebugMsg(
scip,
"node can be cut off due to strong branching on multi-aggregated variable <%s>\n",
447 SCIPdebugMsg(
scip,
"%s child of multi-aggregated variable <%s> is infeasible\n",
474 down =
MAX(downobjval, lpobjval);
475 up =
MAX(upobjval, lpobjval);
476 downgain = down - lpobjval;
477 upgain = up - lpobjval;
480 if( allcolsinlp && !exactsolve )
483 minbound =
MIN(downobjval, upobjval);
484 *provedbound =
MAX(*provedbound, minbound);
488 if( score > *bestmultaggrscore )
489 *bestmultaggrscore = score;
493 if( score > *bestscore )
496 if( branchruledata->nmultaggrbranch == 0 )
498 branchruledata->rundepth = SCIPgetNRuns(scip);
499 branchruledata->firstmultaggrdepth = SCIPgetFocusDepth(scip);
505 *bestscore =
MAX(score, *bestscore);
507 *bestsol = fixvarssol;
508 *bestdown = downobjval;
510 *bestdownvalid =
TRUE;
512 *estimatedown = estimateprobdown;
513 *estimateup = estimateprobup;
612 branchruledata->lastcand = 0;
614 branchruledata->firstmultaggrdepth = 0;
615 branchruledata->nmultaggrbranch = 0;
616 branchruledata->nfracbranch = 0;
617 branchruledata->nEscore = 0;
618 branchruledata->nmultaggrcutoff = 0;
619 branchruledata->nmultaggrconsadd = 0;
620 branchruledata->nfractcutoff = 0;
621 branchruledata->nfractconsadd = 0;
622 branchruledata->nrun = 0;
623 branchruledata->size = 100;
624 branchruledata->ameanratio = 0.0;
625 branchruledata->noupdate =
FALSE;
626 branchruledata->clckstrongbr =
NULL;
627 branchruledata->clckmultaggrbr =
NULL;
628 branchruledata->nstrongbrcall = 0;
629 branchruledata->nmultaggrbrcall = 0;
630 branchruledata->totalmultaggrcands = 0;
631 branchruledata->totallpcands = 0;
649 assert((branchruledata->skipdown !=
NULL) == (branchruledata->skipup !=
NULL));
656 branchruledata->nmultaggrvars);
658 branchruledata->firstmultaggrdepth,
659 branchruledata->rundepth);
661 branchruledata->nmultaggrbranch, branchruledata->nmultaggrbranch + branchruledata->nfracbranch);
674 if( branchruledata->totallpcands != 0 )
689 if( branchruledata->totalmultaggrcands != 0 )
700 if( branchruledata->nmultaggrbranch != 0 )
703 for( j = 0; j < branchruledata->nmultaggrbranch; j++ )
705 branchruledata->ameanratio += branchruledata->ratioggain[j];
710 branchruledata->ameanratio = branchruledata->ameanratio / branchruledata->nmultaggrbranch;
726 if( branchruledata->skipdown !=
NULL )
730 branchruledata->skipdown =
NULL;
731 branchruledata->skipup =
NULL;
732 branchruledata->skipsize = 0;
793 branchruledata->nmultaggrvars = 0;
799 for(
i = 0;
i < nfixvars;
i++ )
803 branchruledata->nmultaggrvars += 1;
823 if( branchruledata->skipdown ==
NULL )
841 branchruledata->skipup,
nlpcands, npriolpcands,
nlpcands, &branchruledata->lastcand,
842 branchruledata->maxproprounds, branchruledata->probingbounds,
TRUE,
843 &bestcandpos, &bestdown, &bestup, &bestscore, &bestdownvalid, &bestupvalid, &provedbound,
result) );
848 branchruledata->nstrongbrcall += 1;
865 || branchruledata->maxproprounds != 0 )
874 fdown = MAX(bestdown, lpobjval);
875 fup = MAX(bestup, lpobjval);
876 fdowngain = fdown - lpobjval;
877 fupgain = fup - lpobjval;
887 &estimatedown, &estimateup, &bestmultaggrscore,
result) );
890 &estimatedown, &estimateup,
result) );
894 branchruledata->nmultaggrbrcall += 1;
900 if( !(branchruledata->noupdate) )
902 if( SCIPisEQ(scip, bestmultaggrscore, bestscore) )
903 branchruledata->nEscore += 1;
917 if( !(branchruledata->noupdate) )
919 branchruledata->nmultaggrbranch += 1;
923 SCIP_Real gfractbranch;
924 SCIP_Real gmultaggrbranch;
931 down = MAX(bestdown, lpobjval);
932 up = MAX(bestup, lpobjval);
933 downgain = down - lpobjval;
934 upgain = up - lpobjval;
936 SCIP_CALL( ensureArraySize(scip, branchruledata) );
938 gfractbranch= sqrt(MAX(fdowngain,1e-06) * MAX(fupgain,1e-06));
939 gmultaggrbranch = sqrt(MAX(downgain,1e-06) * MAX(upgain,1e-06));
941 nmultaggrbranch = branchruledata->nmultaggrbranch;
943 if( gmultaggrbranch == 0.0 )
945 branchruledata->ratioggain[nmultaggrbranch - 1] = 1;
949 branchruledata->ratioggain[nmultaggrbranch - 1] = gfractbranch / gmultaggrbranch;
1002 if( !(branchruledata->noupdate) )
1003 branchruledata->nfracbranch += 1
1038 branchruledata->nfractcutoff += 1;
1042 branchruledata->nfractconsadd += 1;
1070 branchruledata->lastcand = 0;
1071 branchruledata->skipsize = 0;
1072 branchruledata->skipup =
NULL;
1073 branchruledata->skipdown =
NULL;
1091 "branching/multaggr/reevalage",
1092 "number of intermediate LPs solved to trigger reevaluation of strong branching value for a variable that was already evaluated at the current node",
1095 "branching/multaggr/maxproprounds",
1096 "maximum number of propagation rounds to be performed during multaggr branching before solving the LP (-1: no limit, -2: parameter settings)",
1099 "branching/multaggr/probingbounds",
1100 "should valid bounds be identified in a probing-like fashion during multaggr branching (only with propagation)?",
#define BRANCHRULE_PRIORITY
#define BRANCHRULE_MAXDEPTH
#define BRANCHRULE_MAXBOUNDDIST
#define DEFAULT_PROBINGBOUNDS
#define DEFAULT_REEVALAGE
#define DEFAULT_MAXPROPROUNDS
full strong LP branching rule
static SCIP_RETCODE selectVarMultAggrBranching(SCIP *scip, SCIP_VAR **bestcand, SCIP_Real *bestscore, SCIP_Real *bestsol, SCIP_Real *bestdown, SCIP_Real *bestup, SCIP_Bool *bestdownvalid, SCIP_Bool *bestupvalid, SCIP_Real *provedbound, SCIP_Real *estimatedown, SCIP_Real *estimateup, SCIP_RESULT *result)
fullstrong branching on fractional and multi-aggregated variables
Constraint handler for linear constraints in their most general form, .
#define SCIP_MAXTREEDEPTH
SCIP_RETCODE SCIPselectVarStrongBranching(SCIP *scip, SCIP_VAR **lpcands, SCIP_Real *lpcandssol, SCIP_Real *lpcandsfrac, SCIP_Bool *skipdown, SCIP_Bool *skipup, int nlpcands, int npriolpcands, int ncomplete, int *start, int maxproprounds, SCIP_Bool probingbounds, SCIP_Bool forcestrongbranch, int *bestcand, SCIP_Real *bestdown, SCIP_Real *bestup, SCIP_Real *bestscore, SCIP_Bool *bestdownvalid, SCIP_Bool *bestupvalid, SCIP_Real *provedbound, SCIP_RESULT *result)
SCIP_RETCODE SCIPincludeBranchruleMultAggr(SCIP *scip)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
int SCIPgetNVars(SCIP *scip)
int SCIPgetNFixedVars(SCIP *scip)
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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 SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
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,)
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
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)
int SCIPgetNLPBranchCands(SCIP *scip)
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_Bool SCIPisExact(SCIP *scip)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Bool SCIPallColsInLP(SCIP *scip)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
int SCIPgetNRuns(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNonimpliedIntegral(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
static SCIP_RETCODE reoptimize(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol, BLOCKPROBLEM **blockproblem, int nblocks, SCIP_Bool limits, SCIP_SOL **newsol, SCIP_Bool *success)
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
public methods for branching rules
public methods for managing constraints
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 constraint handler plugins and constraints
public methods for exact solving
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 the probing mode
public methods for querying solving statistics
public methods for timing
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
struct SCIP_Clock SCIP_CLOCK
struct SCIP_Cons SCIP_CONS
enum SCIP_LPSolStat SCIP_LPSOLSTAT
@ SCIP_LPSOLSTAT_NOTSOLVED
@ SCIP_LPSOLSTAT_TIMELIMIT
@ SCIP_LPSOLSTAT_UNBOUNDEDRAY
@ SCIP_LPSOLSTAT_INFEASIBLE
@ SCIP_LPSOLSTAT_OBJLIMIT
@ SCIP_LPSOLSTAT_ITERLIMIT
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_Node SCIP_NODE
@ SCIP_VARSTATUS_MULTAGGR