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 73 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;
348 if( MIN(frac, 1.0 - frac) < 10.0 *
SCIPfeastol(scip) )
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));
519 assert(branchruledata != NULL);
533 bestisstrongbranch =
FALSE;
536 bestsbdownvalid =
FALSE;
537 bestsbupvalid =
FALSE;
538 bestsbdowncutoff =
FALSE;
539 bestsbupcutoff =
FALSE;
540 provedbound = lpobjval;
542 if( nbranchcands == 1 )
590 int bestuninitsbcand;
604 avgconflictscore =
MAX(avgconflictscore, 0.1);
606 avgconflengthscore =
MAX(avgconflengthscore, 0.1);
608 avginferencescore =
MAX(avginferencescore, 0.1);
610 avgcutoffscore =
MAX(avgcutoffscore, 0.1);
612 avgpscostscore =
MAX(avgpscostscore, 0.1);
617 initstrongbranching =
FALSE;
620 propagate = (branchruledata->maxproprounds != 0);
623 probingbounds = propagate && branchruledata->probingbounds;
628 maxninitcands = MIN(nbranchcands, branchruledata->initcand);
638 if( nsblpiterations > maxnsblpiterations )
655 maxbdchgs = branchruledata->maxbdchgs;
656 if( maxbdchgs == -1 )
660 prio = (maxnsblpiterations - nsblpiterations)/(nsblpiterations + 1.0);
661 prio = MIN(prio, 1.0);
662 prio =
MAX(prio, (nlpiterationsquot - nsblpiterations)/(nsblpiterations + 1.0));
663 reliable = (1.0-prio) * branchruledata->minreliable + prio * branchruledata->maxreliable;
666 relerrorthreshold = (1.0 - prio) * branchruledata->higherrortol + prio * branchruledata->lowerrortol;
670 if( branchruledata->usedynamicconfidence )
675 else if( prio >= 0.7 )
677 else if( prio >= 0.5 )
679 else if( prio >= 0.3 )
693 if( branchruledata->usehyptestforreliability )
695 for( c = 0; c < nbranchcands; ++c )
725 downgain =
MAX(down - lastlpobjval, 0.0);
726 upgain =
MAX(up - lastlpobjval, 0.0);
729 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> already performed (down=%g (%+g), up=%g (%+g), pscostscore=%g)\n",
730 SCIPvarGetName(branchcands[c]), down, downgain, up, upgain, pscostscore);
733 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
734 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
742 fracscore = MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
746 || (
SCIPisSumGE(scip, fracscore, bestpsfracscore) && domainscore > bestpsdomainscore) )
750 bestpsfracscore = fracscore;
751 bestpsdomainscore = domainscore;
757 for( c = 0; c < nbranchcands; ++c )
768 assert(branchcands[c] != NULL);
794 downgain =
MAX(down - lastlpobjval, 0.0);
795 upgain =
MAX(up - lastlpobjval, 0.0);
798 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> already performed (down=%g (%+g), up=%g (%+g), pscostscore=%g)\n",
799 SCIPvarGetName(branchcands[c]), down, downgain, up, upgain, pscostscore);
801 else if( maxninitcands > 0 )
810 size = MIN(downsize, upsize);
814 assert(!branchruledata->usehyptestforreliability || bestpscand >= 0);
816 if( size < reliable )
818 else if( branchruledata->userelerrorforreliability && branchruledata->usehyptestforreliability )
828 else if( branchruledata->userelerrorforreliability &&
832 else if( branchruledata->usehyptestforreliability &&
845 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
846 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
853 if( branchruledata->randinitorder )
857 for( j = ninitcands; j > 0 && score > initcandscores[j-1]; --j )
859 initcands[j] = initcands[j-1];
860 initcandscores[j] = initcandscores[j-1];
863 initcandscores[j] = score;
865 ninitcands = MIN(ninitcands, maxninitcands);
868 else if( !branchruledata->usehyptestforreliability )
876 fracscore = MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
880 || (
SCIPisSumGE(scip, fracscore, bestpsfracscore) && domainscore > bestpsdomainscore) )
884 bestpsfracscore = fracscore;
885 bestpsdomainscore = domainscore;
892 if( branchruledata->usehyptestforreliability && ninitcands == 1 )
895 SCIPdebugMsg(scip,
"Only one single candidate for initialization-->Skipping strong branching\n");
902 inititer = branchruledata->inititer;
920 nlpiterations = 1000;
925 inititer = (int)(2*nlpiterations / nlps);
926 inititer = (int)((
SCIP_Real)inititer * (1.0 + 20.0/nodenum));
927 inititer =
MAX(inititer, 10);
928 inititer = MIN(inititer, 500);
931 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",
932 reliable, ninitcands, nbranchcands, nuninitcands, maxninitcands, maxlookahead, maxbdchgs, inititer,
940 bestuninitsbcand = -1;
942 for( i = 0; i < ninitcands && lookahead < maxlookahead && nbdchgs + nbdconflicts < maxbdchgs
963 if( branchruledata->skipbadinitcands )
969 if( bestsbscore > bestpsscore && bestsbscore > bestuninitsbscore && bestsbupvalid && bestsbdownvalid )
971 assert(bestsbcand != -1);
986 else if( bestpscand != -1 && bestpsscore > bestuninitsbscore )
995 else if( bestuninitsbcand != -1 )
1007 if( bestuninitsbcand == -1 )
1009 bestuninitsbcand = c;
1010 bestuninitsbscore = initcandscores[i];
1015 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",
1018 SCIPvarGetName(branchcands[c]), branchcandssol[c], initcandscores[i],
1022 if( !initstrongbranching )
1024 initstrongbranching =
TRUE;
1040 branchruledata->maxproprounds, &down, &up, &downvalid, &upvalid, &ndomredsdown, &ndomredsup, &downinf, &upinf,
1041 &downconflict, &upconflict, &lperror, newlbs, newubs) );
1047 &down, &up, &downvalid, &upvalid, &downinf, &upinf, &downconflict, &upconflict, &lperror) );
1049 ndomredsdown = ndomredsup = 0;
1058 "(node %" SCIP_LONGINT_FORMAT
") error in strong branching call for variable <%s> with solution %g\n",
1073 SCIPdebugMsg(scip,
" -> strong branching on variable <%s> lead to a new incumbent\n",
1089 else if( bestsbcand != -1 && allcolsinlp )
1093 bestsbdowncutoff =
TRUE;
1095 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",
1098 SCIPdebugMsg(scip,
" -> increase lower bound of best candidate <%s> to %g\n",
1107 bestsbupcutoff =
TRUE;
1109 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",
1112 SCIPdebugMsg(scip,
" -> decrease upper bound of best candidate <%s> to %g\n",
1122 down =
MAX(down, lpobjval);
1123 up =
MAX(up, lpobjval);
1124 downgain = down - lpobjval;
1125 upgain = up - lpobjval;
1128 assert(downinf || !downconflict);
1129 assert(upinf || !upconflict);
1136 #ifdef WITH_LPSOLSTAT
1139 && (!upinf || branchruledata->storesemiinitcosts) )
1144 if( branchruledata->usesmallweightsitlim )
1153 #ifdef WITH_LPSOLSTAT
1156 && (!downinf || branchruledata->storesemiinitcosts) )
1161 if( branchruledata->usesmallweightsitlim )
1170 if( allcolsinlp && !exactsolve && downvalid && upvalid )
1174 minbound = MIN(down, up);
1175 provedbound =
MAX(provedbound, minbound);
1183 assert(newlbs != NULL);
1184 assert(newubs != NULL);
1186 for( v = 0; v < nvars; ++v )
1190 SCIPdebugMsg(scip,
"better lower bound for variable <%s>: %.9g -> %.9g (by strongbranching on <%s>)\n",
1198 SCIPdebugMsg(scip,
"better upper bound for variable <%s>: %.9g -> %.9g (by strongbranching on <%s>)\n",
1209 if( downinf || upinf )
1211 assert(allcolsinlp || propagate);
1212 assert(!exactsolve);
1214 if( downinf && upinf )
1217 SCIPdebugMsg(scip,
" -> variable <%s> is infeasible in both directions (conflict: %u/%u)\n",
1225 SCIPdebugMsg(scip,
" -> variable <%s> is infeasible in %s branch (conflict: %u/%u)\n",
1226 SCIPvarGetName(branchcands[c]), downinf ?
"downward" :
"upward", downconflict, upconflict);
1230 if( nbdchgs + nbdconflicts >= maxbdchgs )
1257 score =
calcScore(scip, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
1258 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, nlscore, branchcandsfrac[c]);
1265 fracscore = MIN(branchcandsfrac[c], 1.0 - branchcandsfrac[c]);
1269 || (
SCIPisSumGE(scip, fracscore, bestsbfracscore) && domainscore > bestsbdomainscore) )
1272 bestsbscore = score;
1275 bestsbdownvalid = downvalid;
1276 bestsbupvalid = upvalid;
1277 bestsbdowncutoff =
FALSE;
1278 bestsbupcutoff =
FALSE;
1279 bestsbfracscore = fracscore;
1280 bestsbdomainscore = domainscore;
1289 SCIPdebugMsg(scip,
" -> variable <%s> (solval=%g, down=%g (%+g,valid=%u), up=%g (%+g,valid=%u), score=%g/ %g/%g %g/%g -> %g)\n",
1290 SCIPvarGetName(branchcands[c]), branchcandssol[c], down, downgain, downvalid, up, upgain, upvalid,
1291 pscostscore, conflictscore, conflengthscore, inferencescore, cutoffscore, score);
1295 if( bestsbcand >= 0 )
1297 SCIPdebugMsg(scip,
" -> best: <%s> (%g / %g / %g), lookahead=%g/%g\n",
1298 SCIPvarGetName(branchcands[bestsbcand]), bestsbscore, bestsbfracscore, bestsbdomainscore,
1299 lookahead, maxlookahead);
1303 if( initstrongbranching )
1307 assert(newlbs != NULL);
1308 assert(newubs != NULL);
1326 if( i < ninitcands && bestuninitsbcand == -1 )
1327 bestuninitsbscore = initcandscores[i];
1332 if( bestpsscore > bestuninitsbscore &&
SCIPisSumGT(scip, bestpsscore, bestsbscore) )
1334 bestcand = bestpscand;
1335 bestisstrongbranch =
FALSE;
1337 else if( bestsbcand >= 0 )
1339 bestcand = bestsbcand;
1340 bestisstrongbranch =
TRUE;
1347 assert(ninitcands >= 1);
1348 bestcand = initcands[0];
1349 bestisstrongbranch =
FALSE;
1353 if( allcolsinlp && !exactsolve )
1369 freeBdchgs(scip, &bdchginds, &bdchgtypes, &bdchgbounds, &nbdchgs);
1386 assert(0 <= bestcand && bestcand < nbranchcands);
1389 assert(!bestsbdowncutoff && !bestsbupcutoff);
1391 var = branchcands[bestcand];
1392 val = branchcandssol[bestcand];
1395 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",
1396 nbranchcands, ninitcands, bestcand,
SCIPvarGetName(var), branchcandssol[bestcand],
1397 bestsbdown, bestsbdown - lpobjval, bestsbup, bestsbup - lpobjval, bestisstrongbranch,
1402 assert(downchild != NULL);
1403 assert(upchild != NULL);
1406 if( bestisstrongbranch && allcolsinlp && !exactsolve )
1408 if( bestsbdownvalid )
1442 assert(scip != NULL);
1443 assert(branchrule != NULL);
1475 branchruledata->nlcount = NULL;
1476 branchruledata->nlcountsize = 0;
1477 branchruledata->nlcountmax = 1;
1478 assert(branchruledata->startrandseed >= 0);
1482 (
unsigned int)branchruledata->startrandseed) );
1517 assert(branchrule != NULL);
1519 assert(scip != NULL);
1520 assert(result != NULL);
1527 SCIPdebugMsg(scip,
"Could not apply relpscost branching, as the current LP was not solved to optimality.\n");
1534 assert(nlpcands > 0);
1573 assert(branchrule != NULL);
1584 "branching/relpscost/conflictweight",
1585 "weight in score calculations for conflict score",
1588 "branching/relpscost/conflictlengthweight",
1589 "weight in score calculations for conflict length score",
1592 "branching/relpscost/inferenceweight",
1593 "weight in score calculations for inference score",
1596 "branching/relpscost/cutoffweight",
1597 "weight in score calculations for cutoff score",
1600 "branching/relpscost/pscostweight",
1601 "weight in score calculations for pseudo cost score",
1604 "branching/relpscost/nlscoreweight",
1605 "weight in score calculations for nlcount score",
1608 "branching/relpscost/minreliable",
1609 "minimal value for minimum pseudo cost size to regard pseudo cost value as reliable",
1612 "branching/relpscost/maxreliable",
1613 "maximal value for minimum pseudo cost size to regard pseudo cost value as reliable",
1616 "branching/relpscost/sbiterquot",
1617 "maximal fraction of strong branching LP iterations compared to node relaxation LP iterations",
1620 "branching/relpscost/sbiterofs",
1621 "additional number of allowed strong branching LP iterations",
1624 "branching/relpscost/maxlookahead",
1625 "maximal number of further variables evaluated without better score",
1628 "branching/relpscost/initcand",
1629 "maximal number of candidates initialized with strong branching per node",
1632 "branching/relpscost/inititer",
1633 "iteration limit for strong branching initializations of pseudo cost entries (0: auto)",
1636 "branching/relpscost/maxbdchgs",
1637 "maximal number of bound tightenings before the node is reevaluated (-1: unlimited)",
1640 "branching/relpscost/maxproprounds",
1641 "maximum number of propagation rounds to be performed during strong branching before solving the LP (-1: no limit, -2: parameter settings)",
1644 "branching/relpscost/probingbounds",
1645 "should valid bounds be identified in a probing-like fashion during strong branching (only with propagation)?",
1659 "should strong branching result be considered for pseudo costs if the other direction was infeasible?",
1664 "should the scoring function use only local cutoff and inference information obtained for strong branching candidates?",
1669 "should the strong branching decision be based on a hypothesis test?",
1674 "should the confidence level be adjusted dynamically?",
1678 "should branching rule skip candidates that have a low probability to " 1679 "be better than the best strong-branching or pseudo-candidate?",
1683 "branching/relpscost/confidencelevel",
1684 "the confidence level for statistical methods, between 0 (Min) and 4 (Max).",
1688 "should candidates be initialized in randomized order?",
1693 "should smaller weights be used for pseudo cost updates after hitting the LP iteration limit?",
1698 "should the weights of the branching rule be adjusted dynamically during solving based on objective and infeasible leaf counters?",
1720 assert(scip != NULL);
1721 assert(result != NULL);
1725 assert(branchrule != NULL);
1728 SCIP_CALL(
execRelpscost(scip, branchrule, 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)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
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_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)
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed)
#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
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)
#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)
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)
static SCIP_RETCODE execRelpscost(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranch, SCIP_RESULT *result)
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
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
SCIP_RETCODE SCIPexecRelpscostBranching(SCIP *scip, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranching, SCIP_RESULT *result)
#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_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)