69#define BRANCHRULE_NAME "multaggr"
70#define BRANCHRULE_DESC "fullstrong branching on fractional and multi-aggregated variables"
71#define BRANCHRULE_PRIORITY 0
72#define BRANCHRULE_MAXDEPTH -1
73#define BRANCHRULE_MAXBOUNDDIST 1.0
76#define DEFAULT_REEVALAGE 0LL
78#define DEFAULT_MAXPROPROUNDS 0
80#define DEFAULT_PROBINGBOUNDS TRUE
88struct SCIP_BranchruleData
109 int firstmultaggrdepth;
116 int nmultaggrconsadd;
127 int totalmultaggrcands;
148 assert(branchruledata->nmultaggrbranch >= 0);
149 assert(branchruledata->size >= 0);
152 if( branchruledata->nmultaggrbranch + 1 > branchruledata->size )
155 assert(newsize >= branchruledata->nmultaggrbranch + 1);
157 branchruledata->size = newsize;
234 SCIPdebugMsg(
scip,
"cannot perform probing in selectVarMultAggrBranching, depth limit reached.\n");
247 for(
i = 0;
i < nfixvars;
i++ )
253 for(
i = 0;
i < nfixvars;
i++ )
261 fixvarssol = fixvarssols[
i];
286 startprobing =
FALSE;
327 SCIPdebugMsg(
scip,
"error solving down node probing LP: status=%d\n", solstatdown);
343 for( j = 0 ; j < ndownvars; j++ )
354 estimateincr =
MIN(pscdown, pscup);
356 estimateprobdown += estimateincr;
389 SCIPdebugMsg(
scip,
"error solving up node probing LP: status=%d\n", solstatup);
398 SCIPdebugMsg(
scip,
" down node objval: %g up node objval: %g\n", downobjval, upobjval);
407 for( k = 0 ; k < nupvars; k++ )
418 estimateincr =
MIN(pscdown, pscup);
419 estimateprobup += estimateincr;
425 if( downinf || upinf )
434 if( downinf && upinf )
436 SCIPdebugMsg(
scip,
"node can be cut off due to strong branching on multi-aggregated variable <%s>\n",
450 SCIPdebugMsg(
scip,
"%s child of multi-aggregated variable <%s> is infeasible\n",
477 down =
MAX(downobjval, lpobjval);
478 up =
MAX(upobjval, lpobjval);
479 downgain = down - lpobjval;
480 upgain = up - lpobjval;
483 if( allcolsinlp && !exactsolve )
486 minbound =
MIN(downobjval, upobjval);
487 *provedbound =
MAX(*provedbound, minbound);
491 if( score > *bestmultaggrscore )
492 *bestmultaggrscore = score;
496 if( score > *bestscore )
499 if( branchruledata->nmultaggrbranch == 0 )
501 branchruledata->rundepth = SCIPgetNRuns(scip);
502 branchruledata->firstmultaggrdepth = SCIPgetFocusDepth(scip);
508 *bestscore =
MAX(score, *bestscore);
510 *bestsol = fixvarssol;
511 *bestdown = downobjval;
513 *bestdownvalid =
TRUE;
515 *estimatedown = estimateprobdown;
516 *estimateup = estimateprobup;
615 branchruledata->lastcand = 0;
617 branchruledata->firstmultaggrdepth = 0;
618 branchruledata->nmultaggrbranch = 0;
619 branchruledata->nfracbranch = 0;
620 branchruledata->nEscore = 0;
621 branchruledata->nmultaggrcutoff = 0;
622 branchruledata->nmultaggrconsadd = 0;
623 branchruledata->nfractcutoff = 0;
624 branchruledata->nfractconsadd = 0;
625 branchruledata->nrun = 0;
626 branchruledata->size = 100;
627 branchruledata->ameanratio = 0.0;
628 branchruledata->noupdate =
FALSE;
629 branchruledata->clckstrongbr =
NULL;
630 branchruledata->clckmultaggrbr =
NULL;
631 branchruledata->nstrongbrcall = 0;
632 branchruledata->nmultaggrbrcall = 0;
633 branchruledata->totalmultaggrcands = 0;
634 branchruledata->totallpcands = 0;
653 assert((branchruledata->skipdown !=
NULL) == (branchruledata->skipup !=
NULL));
660 branchruledata->nmultaggrvars);
662 branchruledata->firstmultaggrdepth,
663 branchruledata->rundepth);
665 branchruledata->nmultaggrbranch, branchruledata->nmultaggrbranch + branchruledata->nfracbranch);
678 if( branchruledata->totallpcands != 0 )
693 if( branchruledata->totalmultaggrcands != 0 )
704 if( branchruledata->nmultaggrbranch != 0 )
706 for( j = 0; j < branchruledata->nmultaggrbranch; j++ )
708 branchruledata->ameanratio += branchruledata->ratioggain[j];
713 branchruledata->ameanratio = branchruledata->ameanratio / branchruledata->nmultaggrbranch;
729 if( branchruledata->skipdown !=
NULL )
733 branchruledata->skipdown =
NULL;
734 branchruledata->skipup =
NULL;
735 branchruledata->skipsize = 0;
796 branchruledata->nmultaggrvars = 0;
802 for(
i = 0;
i < nfixvars;
i++ )
807 branchruledata->nmultaggrvars += 1;
827 if( branchruledata->skipdown ==
NULL )
845 branchruledata->skipup,
nlpcands, npriolpcands,
nlpcands, &branchruledata->lastcand,
846 branchruledata->maxproprounds, branchruledata->probingbounds,
TRUE,
847 &bestcandpos, &bestdown, &bestup, &bestscore, &bestdownvalid, &bestupvalid, &provedbound,
result) );
852 branchruledata->nstrongbrcall += 1;
869 || branchruledata->maxproprounds != 0 )
878 fdown = MAX(bestdown, lpobjval);
879 fup = MAX(bestup, lpobjval);
880 fdowngain = fdown - lpobjval;
881 fupgain = fup - lpobjval;
891 &estimatedown, &estimateup, &bestmultaggrscore,
result) );
894 &estimatedown, &estimateup,
result) );
898 branchruledata->nmultaggrbrcall += 1;
904 if( !(branchruledata->noupdate) )
906 if( SCIPisEQ(scip, bestmultaggrscore, bestscore) )
907 branchruledata->nEscore += 1;
921 if( !(branchruledata->noupdate) )
923 branchruledata->nmultaggrbranch += 1;
927 SCIP_Real gfractbranch;
928 SCIP_Real gmultaggrbranch;
935 down = MAX(bestdown, lpobjval);
936 up = MAX(bestup, lpobjval);
937 downgain = down - lpobjval;
938 upgain = up - lpobjval;
940 SCIP_CALL( ensureArraySize(scip, branchruledata) );
942 gfractbranch= sqrt(MAX(fdowngain,1e-06) * MAX(fupgain,1e-06));
943 gmultaggrbranch = sqrt(MAX(downgain,1e-06) * MAX(upgain,1e-06));
945 nmultaggrbranch = branchruledata->nmultaggrbranch;
947 if( gmultaggrbranch == 0.0 )
949 branchruledata->ratioggain[nmultaggrbranch - 1] = 1;
953 branchruledata->ratioggain[nmultaggrbranch - 1] = gfractbranch / gmultaggrbranch;
1006 if( !(branchruledata->noupdate) )
1007 branchruledata->nfracbranch += 1
1042 branchruledata->nfractcutoff += 1;
1046 branchruledata->nfractconsadd += 1;
1074 branchruledata->lastcand = 0;
1075 branchruledata->skipsize = 0;
1076 branchruledata->skipup =
NULL;
1077 branchruledata->skipdown =
NULL;
1095 "branching/multaggr/reevalage",
1096 "number of intermediate LPs solved to trigger reevaluation of strong branching value for a variable that was already evaluated at the current node",
1099 "branching/multaggr/maxproprounds",
1100 "maximum number of propagation rounds to be performed during multaggr branching before solving the LP (-1: no limit, -2: parameter settings)",
1103 "branching/multaggr/probingbounds",
1104 "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)
SCIP_Bool SCIPisExactSolve(SCIP *scip)
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_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_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
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 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
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
SCIP_Real SCIPsetFeasFloor(SCIP_SET *set, SCIP_Real val)
internal methods for global SCIP settings
SCIP main data structure.
#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
SCIP_Real SCIPvarGetPseudocost(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
internal methods for problem variables