All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
branch_inference.c
Go to the documentation of this file.
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
52 #define DEFAULT_RELIABLESCORE 0.001 /**< score which is seen to be reliable for a branching decision */
53 #define DEFAULT_FRACTIONALS TRUE /**< should branching on LP solution be restricted to the fractional variables? */
54 #define DEFAULT_USEWEIGHTEDSUM TRUE /**< should a weighted sum of inference, conflict and cutoff weights be used? */
65 SCIP_Bool fractionals; /**< should branching on LP solution be restricted to the fractional variables? */
66 SCIP_Bool useweightedsum; /**< should a weighted sum of inference, conflict and cutoff weights be used? */
69 /** evaluate the given candidate with the given score against the currently best know candidate */
79 SCIP_BRANCHDIR* bestbranchdir /**< pointer to store the branching direction relative to the branching point */
99 /* the candidate has the same score as the best known candidate; therefore we use a second and third
102 * - the second criteria prefers the candidate with a larger absolute value of its objective coefficient
104 * - if the absolute values of the objective coefficient are equal the variable index is used to define a
107 * @note It is very important to select a unique best candidate. Otherwise the solver might vary w.r.t. the
108 * performance to much since the candidate array which is used here (SCIPgetPseudoBranchCands() or
110 * starting a probing mode might already change the order of these arrays. To be independent of that
111 * the selection should be unique. Otherwise, to selection process can get influenced by starting a
114 if( bestobj < candobj || (bestobj == candobj && SCIPvarGetIndex(*bestcand) < SCIPvarGetIndex(cand)) ) /*lint !e777*/
123 /** evaluate the given candidate with the given score against the currently best know candidate */
150 /* the candidate has the same score as the best known candidate; therefore we use a second and third
153 * - the second criteria prefers the candidate with a larger absolute value of its objective coefficient
155 * - if the absolute values of the objective coefficient are equal the variable index is used to define a
158 * @note It is very important to select a unique best candidate. Otherwise the solver might vary w.r.t. the
159 * performance to much since the candidate array which is used here (SCIPgetPseudoBranchCands() or
161 * starting a probing mode might already change the order of these arrays. To be independent of that
162 * the selection should be unique. Otherwise, to selection process can get influenced by starting a
165 if( bestobj < candobj || (bestobj == candobj && SCIPvarGetIndex(*bestcand) < SCIPvarGetIndex(cand)) ) /*lint !e777*/
173 /** check if the score for the given domain value and variable domain value is better than the current best know one */
184 SCIP_BRANCHDIR* branchdir /**< pointer to store the branching direction relative to the branching point */
194 /* in case the conflict score is below the reliable score we set it to zero since it is seen to be
200 /* in case the cutoff score is below the reliable score we set it to zero since it is seen to be unreliable */
215 /** return an aggregated score for the given variable using the conflict score and cutoff score */
232 /* in case the conflict score is below the reliable score we set it to zero since it is seen to be
238 /* in case the cutoff score is below the reliable score we set it to zero since it is seen to be unreliable */
246 /** return an aggregated score for the given variable using the conflict score and cutoff score */
255 SCIP_BRANCHDIR* branchdir /**< pointer to store the branching direction relative to the branching point */
293 checkValueScore(value, histories[v], SCIP_BRANCHDIR_DOWNWARDS, conflictweight, cutoffweight, reliablescore, &bestscore, branchpoint, branchdir);
296 checkValueScore(value, histories[v], SCIP_BRANCHDIR_UPWARDS, conflictweight, cutoffweight, reliablescore, &bestscore, branchpoint, branchdir);
315 SCIP_Bool useweightedsum, /**< should a weighted sum of inference, conflict and cutoff weights be used? */
340 /* check if the weighted sum between the average inferences and conflict score should be used */
354 bestvaluescore = getValueScore(scip, cands[0], conflictweight, cutoffweight, reliablescore, &bestbranchpoint, &bestbranchdir);
356 SCIPvarGetName(bestvaluecand), SCIPvarGetLbLocal(bestvaluecand), SCIPvarGetUbLocal(bestvaluecand),
363 bestaggrscore = getAggrScore(scip, cands[0], conflictweight, inferenceweight, cutoffweight, reliablescore);
383 valuescore = getValueScore(scip, cand, conflictweight, cutoffweight, reliablescore, &branchpoint, &branchdir);
386 evaluateValueCand(cand, valuescore, branchpoint, branchdir, &bestvaluecand, &bestvaluescore, &bestbranchpoint, &bestbranchdir);
389 SCIPvarGetName(bestvaluecand), SCIPvarGetLbLocal(bestvaluecand), SCIPvarGetUbLocal(bestvaluecand),
396 aggrscore = getAggrScore(scip, cand, conflictweight, inferenceweight, cutoffweight, reliablescore);
398 SCIPdebugMessage(" -> cand <%s>: prio=%d, solval=%g, score=%g\n", SCIPvarGetName(cand), SCIPvarGetBranchPriority(cand),
436 /* in case the average inferences score is below the reliable score we set it to zero since it is seen to be
442 SCIPdebugMessage(" -> cand <%s>: prio=%d, solval=%g, score=%g\n", SCIPvarGetName(cand), SCIPvarGetBranchPriority(cand),
452 SCIPdebugMessage(" -> %d candidates, selected variable <%s>[%g,%g] (prio=%d, solval=%.12f, score=%g, conflict=%g cutoff=%g, inference=%g)\n",
453 ncands, SCIPvarGetName(bestaggrcand), SCIPvarGetLbLocal (bestaggrcand), SCIPvarGetUbLocal(bestaggrcand), SCIPvarGetBranchPriority(bestaggrcand),
454 bestval == SCIP_UNKNOWN ? SCIPgetVarSol(scip, bestaggrcand) : bestval, bestaggrscore, /*lint !e777*/
455 SCIPgetVarConflictScore(scip, bestaggrcand), SCIPgetVarAvgInferenceCutoffScore(scip, bestaggrcand, cutoffweight),
461 SCIP_CALL( SCIPbranchVarVal(scip, bestaggrcand, SCIPgetBranchingPoint(scip, bestaggrcand, bestval), &downchild, &eqchild, &upchild) );
511 SCIPdebugMessage("branch on variable <%s> and value <%g>\n", SCIPvarGetName(bestvaluecand), bestbranchpoint);
612 SCIP_CALL( SCIPgetExternBranchCands(scip, &cands, &candsols, NULL, &ncands, NULL, NULL, NULL, NULL) );
665 SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY,
681 &branchruledata->conflictweight, TRUE, DEFAULT_CONFLICTWEIGHT, 0.0, SCIP_REAL_MAX, NULL, NULL) );
685 &branchruledata->inferenceweight, TRUE, DEFAULT_INFERENCEWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
|