32 #define BRANCHRULE_NAME "relpscost" 33 #define BRANCHRULE_DESC "reliability branching on pseudo cost values" 34 #define BRANCHRULE_PRIORITY 10000 35 #define BRANCHRULE_MAXDEPTH -1 36 #define BRANCHRULE_MAXBOUNDDIST 1.0 38 #define DEFAULT_CONFLICTWEIGHT 0.01 39 #define DEFAULT_CONFLENGTHWEIGHT 0.0 40 #define DEFAULT_INFERENCEWEIGHT 0.0001 41 #define DEFAULT_CUTOFFWEIGHT 0.0001 42 #define DEFAULT_PSCOSTWEIGHT 1.0 43 #define DEFAULT_NLSCOREWEIGHT 0.1 44 #define DEFAULT_MINRELIABLE 1.0 45 #define DEFAULT_MAXRELIABLE 5.0 46 #define DEFAULT_SBITERQUOT 0.5 47 #define DEFAULT_SBITEROFS 100000 48 #define DEFAULT_MAXLOOKAHEAD 9 49 #define DEFAULT_INITCAND 100 50 #define DEFAULT_INITITER 0 51 #define DEFAULT_MAXBDCHGS 5 52 #define DEFAULT_MAXPROPROUNDS -2 54 #define DEFAULT_PROBINGBOUNDS TRUE 56 #define DEFAULT_USERELERRORFORRELIABILITY FALSE 57 #define DEFAULT_LOWERRORTOL 0.05 58 #define DEFAULT_HIGHERRORTOL 1.0 59 #define DEFAULT_USEHYPTESTFORRELIABILITY FALSE 60 #define DEFAULT_USEDYNAMICCONFIDENCE FALSE 61 #define DEFAULT_STORESEMIINITCOSTS FALSE 62 #define DEFAULT_USESBLOCALINFO FALSE 63 #define DEFAULT_CONFIDENCELEVEL 2 64 #define DEFAULT_SKIPBADINITCANDS TRUE 66 #define DEFAULT_STARTRANDSEED 5 67 #define DEFAULT_RANDINITORDER FALSE 68 #define DEFAULT_USESMALLWEIGHTSITLIM FALSE 69 #define DEFAULT_DYNAMICWEIGHTS TRUE 71 struct SCIP_BranchruleData
125 assert(scip !=
NULL);
128 assert(probindex !=
NULL);
133 if( *probindex == -1 )
139 assert(repvar !=
NULL);
165 assert(scip !=
NULL);
166 assert(nlcount !=
NULL);
167 assert(nlcountmax !=
NULL);
170 assert(nlcountsize >= nvars);
185 if( andconshdlr !=
NULL )
205 for( v = 0; v < nandvars; v++ )
214 nlcount[probindex]++;
220 nlcount[probindex]++;
226 for( i = 0; i < nvars; i++ )
228 if( *nlcountmax < nlcount[i] )
229 *nlcountmax = nlcount[i];
243 assert(scip !=
NULL);
244 assert(branchruledata !=
NULL);
250 if( branchruledata->nlscoreweight > 0.0 )
252 if( branchruledata->nlcount ==
NULL )
255 branchruledata->nlcountsize = nvars;
259 else if( branchruledata->nlcountsize < nvars )
263 BMSclearMemoryArray(&(branchruledata->nlcount[branchruledata->nlcountsize]), nvars - branchruledata->nlcountsize);
264 branchruledata->nlcountsize = nvars;
266 assert(branchruledata->nlcount !=
NULL);
267 assert(branchruledata->nlcountsize == nvars);
268 assert(branchruledata->nlcountmax >= 1);
273 branchruledata->nlcountsize = 0;
274 branchruledata->nlcountmax = 1;
290 if( nlcountmax >= 1 && nlcount !=
NULL )
294 assert(scip !=
NULL);
295 assert(probindex >= 0);
298 nlscore = nlcount[probindex] / (
SCIP_Real)nlcountmax;
300 assert(nlscore >= 0.0);
301 assert(nlscore <= 1.0);
330 assert(branchruledata !=
NULL);
331 assert(0.0 < frac && frac < 1.0);
333 if( branchruledata->dynamicweights )
340 score = dynamicfactor * (branchruledata->conflictweight * (1.0 - 1.0/(1.0+conflictscore/avgconflictscore))
341 + branchruledata->conflengthweight * (1.0 - 1.0/(1.0+conflengthscore/avgconflengthscore))
342 + branchruledata->inferenceweight * (1.0 - 1.0/(1.0+inferencescore/avginferencescore))
343 + branchruledata->cutoffweight * (1.0 - 1.0/(1.0+cutoffscore/avgcutoffscore)))
344 + branchruledata->pscostweight / dynamicfactor * (1.0 - 1.0/(1.0+pscostscore/avgpscostscore))
345 + branchruledata->nlscoreweight * nlscore;
367 assert(bdchginds !=
NULL);
368 assert(bdchgtypes !=
NULL);
369 assert(bdchgbounds !=
NULL);
370 assert(nbdchgs !=
NULL);
375 assert(*bdchginds !=
NULL);
376 assert(*bdchgtypes !=
NULL);
377 assert(*bdchgbounds !=
NULL);
379 (*bdchginds)[*nbdchgs] = ind;
380 (*bdchgtypes)[*nbdchgs] = type;
381 (*bdchgbounds)[*nbdchgs] =
bound;
397 assert(bdchginds !=
NULL);
398 assert(bdchgtypes !=
NULL);
399 assert(bdchgbounds !=
NULL);
400 assert(nbdchgs !=
NULL);
428 assert(vars !=
NULL);
433 assert(branchrule !=
NULL);
437 assert(branchruledata !=
NULL);
440 SCIPdebugMsg(scip,
"applying %d bound changes\n", nbdchgs);
442 for( i = 0; i < nbdchgs; ++i )
462 assert(tightened || (branchruledata->maxproprounds != 0));
477 assert(tightened || (branchruledata->maxproprounds != 0));
521 assert(branchruledata !=
NULL);
535 bestisstrongbranch =
FALSE;
538 bestsbdownvalid =
FALSE;
539 bestsbupvalid =
FALSE;
540 bestsbdowncutoff =
FALSE;
541 bestsbupcutoff =
FALSE;
542 provedbound = lpobjval;
544 if( nbranchcands == 1 )
592 int bestuninitsbcand;
606 avgconflictscore =
MAX(avgconflictscore, 0.1);
608 avgconflengthscore =
MAX(avgconflengthscore, 0.1);
610 avginferencescore =
MAX(avginferencescore, 0.1);
612 avgcutoffscore =
MAX(avgcutoffscore, 0.1);
614 avgpscostscore =
MAX(avgpscostscore, 0.1);
619 initstrongbranching =
FALSE;
622 propagate = (branchruledata->maxproprounds != 0);
625 probingbounds = propagate && branchruledata->probingbounds;
630 maxninitcands =
MIN(nbranchcands, branchruledata->initcand);
640 if( nsblpiterations > maxnsblpiterations )
657 maxbdchgs = branchruledata->maxbdchgs;
658 if( maxbdchgs == -1 )
662 prio = (maxnsblpiterations - nsblpiterations)/(nsblpiterations + 1.0);
663 prio =
MIN(prio, 1.0);
664 prio =
MAX(prio, (nlpiterationsquot - nsblpiterations)/(nsblpiterations + 1.0));
665 reliable = (1.0-prio) * branchruledata->minreliable + prio * branchruledata->maxreliable;
668 relerrorthreshold = (1.0 - prio) * branchruledata->higherrortol + prio * branchruledata->lowerrortol;
672 if( branchruledata->usedynamicconfidence )
677 else if( prio >= 0.7 )
679 else if( prio >= 0.5 )
681 else if( prio >= 0.3 )
695 if( branchruledata->usehyptestforreliability )
697 for( c = 0; c < nbranchcands; ++c )
727 downgain =
MAX(down - lastlpobjval, 0.0);
728 upgain =
MAX(up - lastlpobjval, 0.0);
731 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> already performed (down=%g (%+g), up=%g (%+g), pscostscore=%g)\n",
732 SCIPvarGetName(branchcands[c]), down, downgain, up, upgain, pscostscore);
735 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
736 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
744 fracscore =
MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
748 || (
SCIPisSumGE(scip, fracscore, bestpsfracscore) && domainscore > bestpsdomainscore) )
752 bestpsfracscore = fracscore;
753 bestpsdomainscore = domainscore;
759 for( c = 0; c < nbranchcands; ++c )
770 assert(branchcands[c] !=
NULL);
796 downgain =
MAX(down - lastlpobjval, 0.0);
797 upgain =
MAX(up - lastlpobjval, 0.0);
800 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> already performed (down=%g (%+g), up=%g (%+g), pscostscore=%g)\n",
801 SCIPvarGetName(branchcands[c]), down, downgain, up, upgain, pscostscore);
803 else if( maxninitcands > 0 )
812 size =
MIN(downsize, upsize);
816 assert(!branchruledata->usehyptestforreliability || bestpscand >= 0);
818 if( size < reliable )
820 else if( branchruledata->userelerrorforreliability && branchruledata->usehyptestforreliability )
830 else if( branchruledata->userelerrorforreliability &&
834 else if( branchruledata->usehyptestforreliability &&
847 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
848 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
855 if( branchruledata->randinitorder )
859 for( j = ninitcands; j > 0 && score > initcandscores[j-1]; --j )
861 initcands[j] = initcands[j-1];
862 initcandscores[j] = initcandscores[j-1];
865 initcandscores[j] = score;
867 ninitcands =
MIN(ninitcands, maxninitcands);
870 else if( !branchruledata->usehyptestforreliability )
878 fracscore =
MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
882 || (
SCIPisSumGE(scip, fracscore, bestpsfracscore) && domainscore > bestpsdomainscore) )
886 bestpsfracscore = fracscore;
887 bestpsdomainscore = domainscore;
894 if( branchruledata->usehyptestforreliability && ninitcands == 1 )
897 SCIPdebugMsg(scip,
"Only one single candidate for initialization-->Skipping strong branching\n");
904 inititer = branchruledata->inititer;
922 nlpiterations = 1000;
927 inititer = (int)(2*nlpiterations / nlps);
928 inititer = (int)((
SCIP_Real)inititer * (1.0 + 20.0/nodenum));
929 inititer =
MAX(inititer, 10);
930 inititer =
MIN(inititer, 500);
933 SCIPdebugMsg(scip,
"strong branching (reliable=%g, %d/%d cands, %d uninit, maxcands=%d, maxlookahead=%g, maxbdchgs=%d, inititer=%d, iterations:%" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
", basic:%u)\n",
934 reliable, ninitcands, nbranchcands, nuninitcands, maxninitcands, maxlookahead, maxbdchgs, inititer,
942 bestuninitsbcand = -1;
944 for( i = 0; i < ninitcands && lookahead < maxlookahead && nbdchgs + nbdconflicts < maxbdchgs
965 if( branchruledata->skipbadinitcands )
971 if( bestsbscore > bestpsscore && bestsbscore > bestuninitsbscore && bestsbupvalid && bestsbdownvalid )
973 assert(bestsbcand != -1);
988 else if( bestpscand != -1 && bestpsscore > bestuninitsbscore )
997 else if( bestuninitsbcand != -1 )
1009 if( bestuninitsbcand == -1 )
1011 bestuninitsbcand = c;
1012 bestuninitsbscore = initcandscores[i];
1017 SCIPdebugMsg(scip,
"init pseudo cost (%g/%g) of <%s> at %g (score:%g) with strong branching (%d iterations) -- %" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
" iterations\n",
1020 SCIPvarGetName(branchcands[c]), branchcandssol[c], initcandscores[i],
1024 if( !initstrongbranching )
1026 initstrongbranching =
TRUE;
1042 branchruledata->maxproprounds, &down, &up, &downvalid, &upvalid, &ndomredsdown, &ndomredsup, &downinf, &upinf,
1043 &downconflict, &upconflict, &lperror, newlbs, newubs) );
1049 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
1051 ndomredsdown = ndomredsup = 0;
1060 "(node %" SCIP_LONGINT_FORMAT
") error in strong branching call for variable <%s> with solution %g\n",
1075 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> lead to a new incumbent\n",
1091 else if( bestsbcand != -1 && allcolsinlp )
1095 bestsbdowncutoff =
TRUE;
1097 SCIPdebugMsg(scip,
" -> valid dual bound for down child of best candidate <%s> is higher than new cutoff bound (valid=%u, bestsbdown=%g, cutoff=%g)\n",
1100 SCIPdebugMsg(scip,
" -> increase lower bound of best candidate <%s> to %g\n",
1109 bestsbupcutoff =
TRUE;
1111 SCIPdebugMsg(scip,
" -> valid dual bound for up child of best candidate <%s> is higher than new cutoff bound (valid=%u, bestsbup=%g, cutoff=%g)\n",
1114 SCIPdebugMsg(scip,
" -> decrease upper bound of best candidate <%s> to %g\n",
1124 down =
MAX(down, lpobjval);
1125 up =
MAX(up, lpobjval);
1126 downgain = down - lpobjval;
1127 upgain = up - lpobjval;
1130 assert(downinf || !downconflict);
1131 assert(upinf || !upconflict);
1138 #ifdef WITH_LPSOLSTAT
1141 && (!upinf || branchruledata->storesemiinitcosts) )
1146 if( branchruledata->usesmallweightsitlim )
1155 #ifdef WITH_LPSOLSTAT
1158 && (!downinf || branchruledata->storesemiinitcosts) )
1163 if( branchruledata->usesmallweightsitlim )
1172 if( allcolsinlp && !exactsolve && downvalid && upvalid )
1176 minbound =
MIN(down, up);
1177 provedbound =
MAX(provedbound, minbound);
1185 assert(newlbs !=
NULL);
1186 assert(newubs !=
NULL);
1188 for( v = 0; v < nvars; ++v )
1192 SCIPdebugMsg(scip,
"better lower bound for variable <%s>: %.9g -> %.9g (by strongbranching on <%s>)\n",
1200 SCIPdebugMsg(scip,
"better upper bound for variable <%s>: %.9g -> %.9g (by strongbranching on <%s>)\n",
1211 if( downinf || upinf )
1213 assert(allcolsinlp || propagate);
1214 assert(!exactsolve);
1220 if( allowaddcons && downinf == downconflict && upinf == upconflict )
1222 SCIPdebugMsg(scip,
" -> variable <%s> is infeasible in %s: conflict constraint added\n",
1224 downinf && upinf ?
"both directions" : (downinf ?
"downward branch" :
"upward branch"));
1227 if( (downinf && upinf) || (nbdchgs + nbdconflicts >= maxbdchgs) )
1230 else if( downinf && upinf )
1233 SCIPdebugMsg(scip,
" -> variable <%s> is infeasible in both directions (conflict: %u/%u)\n",
1241 SCIPdebugMsg(scip,
" -> variable <%s> is infeasible in %s branch (conflict: %u/%u)\n",
1242 SCIPvarGetName(branchcands[c]), downinf ?
"downward" :
"upward", downconflict, upconflict);
1246 if( nbdchgs + nbdconflicts >= maxbdchgs )
1273 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
1274 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
1281 fracscore =
MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
1285 || (
SCIPisSumGE(scip, fracscore, bestsbfracscore) && domainscore > bestsbdomainscore) )
1288 bestsbscore = score;
1291 bestsbdownvalid = downvalid;
1292 bestsbupvalid = upvalid;
1293 bestsbdowncutoff =
FALSE;
1294 bestsbupcutoff =
FALSE;
1295 bestsbfracscore = fracscore;
1296 bestsbdomainscore = domainscore;
1305 SCIPdebugMsg(scip,
" -> variable <%s> (solval=%g, down=%g (%+g,valid=%u), up=%g (%+g,valid=%u), score=%g/ %g/%g %g/%g -> %g)\n",
1306 SCIPvarGetName(branchcands[c]), branchcandssol[c], down, downgain, downvalid, up, upgain, upvalid,
1307 pscostscore, conflictscore, conflengthscore, inferencescore, cutoffscore, score);
1311 if( bestsbcand >= 0 )
1313 SCIPdebugMsg(scip,
" -> best: <%s> (%g / %g / %g), lookahead=%g/%g\n",
1314 SCIPvarGetName(branchcands[bestsbcand]), bestsbscore, bestsbfracscore, bestsbdomainscore,
1315 lookahead, maxlookahead);
1319 if( initstrongbranching )
1323 assert(newlbs !=
NULL);
1324 assert(newubs !=
NULL);
1342 if( i < ninitcands && bestuninitsbcand == -1 )
1343 bestuninitsbscore = initcandscores[i];
1348 if( bestpsscore > bestuninitsbscore &&
SCIPisSumGT(scip, bestpsscore, bestsbscore) )
1350 bestcand = bestpscand;
1351 bestisstrongbranch =
FALSE;
1353 else if( bestsbcand >= 0 )
1355 bestcand = bestsbcand;
1356 bestisstrongbranch =
TRUE;
1363 assert(ninitcands >= 1);
1364 bestcand = initcands[0];
1365 bestisstrongbranch =
FALSE;
1369 if( allcolsinlp && !exactsolve )
1385 freeBdchgs(scip, &bdchginds, &bdchgtypes, &bdchgbounds, &nbdchgs);
1402 assert(0 <= bestcand && bestcand < nbranchcands);
1405 assert(!bestsbdowncutoff && !bestsbupcutoff);
1407 var = branchcands[bestcand];
1408 val = branchcandssol[bestcand];
1411 SCIPdebugMsg(scip,
" -> %d (%d) cands, sel cand %d: var <%s> (sol=%g, down=%g (%+g), up=%g (%+g), sb=%u, psc=%g/%g [%g])\n",
1412 nbranchcands, ninitcands, bestcand,
SCIPvarGetName(var), branchcandssol[bestcand],
1413 bestsbdown, bestsbdown - lpobjval, bestsbup, bestsbup - lpobjval, bestisstrongbranch,
1418 assert(downchild !=
NULL);
1419 assert(upchild !=
NULL);
1422 if( bestisstrongbranch && allcolsinlp && !exactsolve )
1424 if( bestsbdownvalid )
1458 assert(scip !=
NULL);
1491 branchruledata->nlcount =
NULL;
1492 branchruledata->nlcountsize = 0;
1493 branchruledata->nlcountmax = 1;
1494 assert(branchruledata->startrandseed >= 0);
1533 assert(branchrule !=
NULL);
1535 assert(scip !=
NULL);
1536 assert(result !=
NULL);
1543 SCIPdebugMsg(scip,
"Could not apply relpscost branching, as the current LP was not solved to optimality.\n");
1550 assert(nlpcands > 0);
1589 assert(branchrule !=
NULL);
1600 "branching/relpscost/conflictweight",
1601 "weight in score calculations for conflict score",
1604 "branching/relpscost/conflictlengthweight",
1605 "weight in score calculations for conflict length score",
1608 "branching/relpscost/inferenceweight",
1609 "weight in score calculations for inference score",
1612 "branching/relpscost/cutoffweight",
1613 "weight in score calculations for cutoff score",
1616 "branching/relpscost/pscostweight",
1617 "weight in score calculations for pseudo cost score",
1620 "branching/relpscost/nlscoreweight",
1621 "weight in score calculations for nlcount score",
1624 "branching/relpscost/minreliable",
1625 "minimal value for minimum pseudo cost size to regard pseudo cost value as reliable",
1628 "branching/relpscost/maxreliable",
1629 "maximal value for minimum pseudo cost size to regard pseudo cost value as reliable",
1632 "branching/relpscost/sbiterquot",
1633 "maximal fraction of strong branching LP iterations compared to node relaxation LP iterations",
1636 "branching/relpscost/sbiterofs",
1637 "additional number of allowed strong branching LP iterations",
1640 "branching/relpscost/maxlookahead",
1641 "maximal number of further variables evaluated without better score",
1644 "branching/relpscost/initcand",
1645 "maximal number of candidates initialized with strong branching per node",
1648 "branching/relpscost/inititer",
1649 "iteration limit for strong branching initializations of pseudo cost entries (0: auto)",
1652 "branching/relpscost/maxbdchgs",
1653 "maximal number of bound tightenings before the node is reevaluated (-1: unlimited)",
1656 "branching/relpscost/maxproprounds",
1657 "maximum number of propagation rounds to be performed during strong branching before solving the LP (-1: no limit, -2: parameter settings)",
1660 "branching/relpscost/probingbounds",
1661 "should valid bounds be identified in a probing-like fashion during strong branching (only with propagation)?",
1675 "should strong branching result be considered for pseudo costs if the other direction was infeasible?",
1680 "should the scoring function use only local cutoff and inference information obtained for strong branching candidates?",
1685 "should the strong branching decision be based on a hypothesis test?",
1690 "should the confidence level be adjusted dynamically?",
1694 "should branching rule skip candidates that have a low probability to " 1695 "be better than the best strong-branching or pseudo-candidate?",
1699 "branching/relpscost/confidencelevel",
1700 "the confidence level for statistical methods, between 0 (Min) and 4 (Max).",
1704 "should candidates be initialized in randomized order?",
1709 "should smaller weights be used for pseudo cost updates after hitting the LP iteration limit?",
1714 "should the weights of the branching rule be adjusted dynamically during solving based on objective and infeasible leaf counters?",
1738 assert(scip !=
NULL);
1739 assert(result !=
NULL);
1743 assert(branchrule !=
NULL);
1746 SCIP_CALL(
execRelpscost(scip, branchrule, allowaddcons, branchcands, branchcandssol, branchcandsfrac, nbranchcands, executebranching, result) );
enum SCIP_Result SCIP_RESULT
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
static SCIP_RETCODE countNonlinearities(SCIP *scip, int *nlcount, int nlcountsize, int *nlcountmax)
enum SCIP_BoundType SCIP_BOUNDTYPE
static SCIP_Real calcNlscore(SCIP *scip, int *nlcount, int nlcountmax, int probindex)
reliable pseudo costs branching rule
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
SCIP_Real SCIPfeastol(SCIP *scip)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define DEFAULT_PSCOSTWEIGHT
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static void freeBdchgs(SCIP *scip, int **bdchginds, SCIP_BOUNDTYPE **bdchgtypes, SCIP_Real **bdchgbounds, int *nbdchgs)
#define BRANCHRULE_MAXDEPTH
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
#define DEFAULT_MAXBDCHGS
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
#define DEFAULT_LOWERRORTOL
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPgetVarStrongbranchLast(SCIP *scip, SCIP_VAR *var, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Real *solval, SCIP_Real *lpobjval)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
static SCIP_RETCODE execRelpscost(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Bool allowaddcons, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranch, SCIP_RESULT *result)
SCIP_Bool SCIPpscostThresholdProbabilityTest(SCIP *scip, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
static SCIP_RETCODE binvarGetActiveProbindex(SCIP *scip, SCIP_VAR *var, int *probindex)
SCIP_Real SCIPgetAvgConflictScore(SCIP *scip)
SCIP_RETCODE SCIPsetBranchruleInitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
#define BRANCHRULE_MAXBOUNDDIST
#define DEFAULT_STARTRANDSEED
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
SCIP_Real SCIPgetVarPseudocostScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
#define DEFAULT_SBITERQUOT
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
enum SCIP_Retcode SCIP_RETCODE
SCIP_Longint SCIPgetVarStrongbranchNode(SCIP *scip, SCIP_VAR *var)
#define DEFAULT_INFERENCEWEIGHT
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_Longint SCIPgetNRootStrongbranchLPIterations(SCIP *scip)
SCIP_Bool SCIPisVarPscostRelerrorReliable(SCIP *scip, SCIP_VAR *var, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
Constraint handler for AND constraints, .
#define SCIPduplicateBufferArray(scip, ptr, source, num)
static SCIP_DECL_BRANCHINITSOL(branchInitsolRelpscost)
static SCIP_DECL_BRANCHFREE(branchFreeRelpscost)
#define SCIPfreeBufferArray(scip, ptr)
#define DEFAULT_HIGHERRORTOL
#define SCIPallocBlockMemory(scip, ptr)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
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_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
static SCIP_DECL_BRANCHEXITSOL(branchExitsolRelpscost)
#define DEFAULT_USESMALLWEIGHTSITLIM
SCIP_Real SCIPgetVarPseudocostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
#define BRANCHRULE_PRIORITY
int SCIPgetNNLPVars(SCIP *scip)
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
SCIP_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE applyBdchgs(SCIP *scip, SCIP_VAR **vars, int *bdchginds, SCIP_BOUNDTYPE *bdchgtypes, SCIP_Real *bdchgbounds, int nbdchgs, SCIP_RESULT *result)
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArrayNull(scip, ptr)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
#define DEFAULT_USEHYPTESTFORRELIABILITY
SCIP_Real SCIPgetVarConflictlengthScore(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPsignificantVarPscostDifference(SCIP *scip, SCIP_VAR *varx, SCIP_Real fracx, SCIP_VAR *vary, SCIP_Real fracy, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel, SCIP_Bool onesided)
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
#define DEFAULT_SBITEROFS
#define DEFAULT_CUTOFFWEIGHT
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
SCIP_Real SCIPgetVarPseudocostCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
#define DEFAULT_CONFLICTWEIGHT
static SCIP_RETCODE addBdchg(SCIP *scip, int **bdchginds, SCIP_BOUNDTYPE **bdchgtypes, SCIP_Real **bdchgbounds, int *nbdchgs, int ind, SCIP_BOUNDTYPE type, SCIP_Real bound)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
public data structures and miscellaneous methods
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
static SCIP_DECL_BRANCHEXECLP(branchExeclpRelpscost)
static SCIP_DECL_BRANCHCOPY(branchCopyRelpscost)
#define DEFAULT_CONFLENGTHWEIGHT
#define DEFAULT_SKIPBADINITCANDS
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
SCIP_RETCODE SCIPgetVarStrongbranchWithPropagation(SCIP *scip, SCIP_VAR *var, SCIP_Real solval, SCIP_Real lpobjval, int itlim, int maxproprounds, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Longint *ndomredsdown, SCIP_Longint *ndomredsup, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict, SCIP_Bool *lperror, SCIP_Real *newlbs, SCIP_Real *newubs)
#define DEFAULT_MINRELIABLE
#define DEFAULT_MAXPROPROUNDS
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
SCIP_Longint SCIPgetNDualResolveLPs(SCIP *scip)
#define DEFAULT_NLSCOREWEIGHT
#define DEFAULT_DYNAMICWEIGHTS
#define DEFAULT_MAXLOOKAHEAD
SCIP_Longint SCIPgetNObjlimLeaves(SCIP *scip)
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
static SCIP_Real calcScore(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata, SCIP_Real conflictscore, SCIP_Real avgconflictscore, SCIP_Real conflengthscore, SCIP_Real avgconflengthscore, SCIP_Real inferencescore, SCIP_Real avginferencescore, SCIP_Real cutoffscore, SCIP_Real avgcutoffscore, SCIP_Real pscostscore, SCIP_Real avgpscostscore, SCIP_Real nlscore, SCIP_Real frac)
int SCIPgetNVars(SCIP *scip)
#define DEFAULT_USERELERRORFORRELIABILITY
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
SCIP_LPSOLSTAT SCIPgetLastStrongbranchLPSolStat(SCIP *scip, SCIP_BRANCHDIR branchdir)
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
SCIP_Longint SCIPgetNNodeInitLPs(SCIP *scip)
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_PROBINGBOUNDS
SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP *scip)
SCIP_RETCODE SCIPincludeBranchruleRelpscost(SCIP *scip)
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
#define DEFAULT_USESBLOCALINFO
#define DEFAULT_STORESEMIINITCOSTS
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPallColsInLP(SCIP *scip)
#define DEFAULT_USEDYNAMICCONFIDENCE
static SCIP_RETCODE branchruledataEnsureNlcount(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata)
SCIP_RETCODE SCIPexecRelpscostBranching(SCIP *scip, SCIP_Bool allowaddcons, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranching, SCIP_RESULT *result)
SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
SCIP_Real SCIPgetAvgPseudocostScore(SCIP *scip)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
#define BMSclearMemoryArray(ptr, num)
SCIP_RETCODE SCIPgetVarStrongbranchFrac(SCIP *scip, SCIP_VAR *var, int itlim, 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)
#define DEFAULT_MAXRELIABLE
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Longint SCIPgetNInfeasibleLeaves(SCIP *scip)
#define DEFAULT_CONFIDENCELEVEL
#define DEFAULT_RANDINITORDER
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPisExactSolve(SCIP *scip)
int SCIPsolGetIndex(SCIP_SOL *sol)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Real SCIPgetAvgInferenceScore(SCIP *scip)
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_Real SCIPgetVarConflictScore(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
#define SCIPreallocBufferArray(scip, ptr, num)
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)