branch_lookahead.c
Go to the documentation of this file.
32 * The (multi-level) lookahead branching rule applies strong branching to every fractional value of the LP solution
33 * at the current node of the branch-and-bound tree, as well as recursivly to every temporary child problem created by this
43 * For a more mathematical description and a comparison between lookahead branching and other branching rules
57/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
90#define DEFAULT_USEBINARYCONSTRAINTS FALSE /**< should binary constraints be collected and applied? */
91#define DEFAULT_ADDCLIQUE FALSE /**< add binary constraints with two variables found at the root node also as a clique? */
94#define DEFAULT_USEDOMAINREDUCTION TRUE /**< Should domain reductions be collected and applied? */
95#define DEFAULT_MERGEDOMAINREDUCTIONS FALSE /**< should domain reductions of feasible siblings should be merged? */
96#define DEFAULT_PREFERSIMPLEBOUNDS FALSE /**< should domain reductions only be applied if there are simple bound changes? */
97#define DEFAULT_ONLYVIOLDOMREDS FALSE /**< Should only domain reductions that violate the LP solution be applied? */
98#define DEFAULT_MAXNVIOLATEDCONS 1 /**< How many constraints that are violated by the base lp solution
100#define DEFAULT_MAXNVIOLATEDBINCONS 0 /**< How many binary constraints that are violated by the base lp
103#define DEFAULT_MAXNVIOLATEDDOMREDS 1 /**< How many domain reductions that are violated by the base lp solution
105#define DEFAULT_STOREUNVIOLATEDSOL TRUE /**< If only non violating constraints are added, should the branching
107#define DEFAULT_REEVALAGE 10LL /**< Max number of LPs solved after which a previous prob branching
109#define DEFAULT_REEVALAGEFSB 10LL /**< Max number of LPs solved after which a previous FSB scoring
112#define DEFAULT_ADDNONVIOCONS FALSE /**< Should binary constraints, that are not violated by the base LP, be
114#define DEFAULT_PROPAGATE TRUE /**< Should domain propagation be executed before each temporary node is
116#define DEFAULT_USELEVEL2DATA TRUE /**< should branching data generated at depth level 2 be stored for re-using it? */
118#define DEFAULT_ENFORCEMAXDOMREDS FALSE /**< should the maximum number of domain reductions maxnviolateddomreds be enforced? */
119#define DEFAULT_UPDATEBRANCHINGRESULTS FALSE /**< should branching results (and scores) be updated w.r.t. proven dual bounds? */
120#define DEFAULT_MAXPROPROUNDS 0 /**< maximum number of propagation rounds to perform at temporary
123#define DEFAULT_MAXNCANDS 4 /**< If abbreviated: The max number of candidates to consider at the base node */
124#define DEFAULT_MAXNDEEPERCANDS 2 /**< If abbreviated: The max number of candidates to consider per deeper node
126#define DEFAULT_REUSEBASIS TRUE /**< If abbreviated: Should the information gathered to obtain the best
128#define DEFAULT_ABBREVPSEUDO FALSE /**< If abbreviated: Use pseudo costs to estimate the score of a
130#define DEFAULT_LEVEL2AVGSCORE FALSE /**< should the average score be used for uninitialized scores in level 2? */
135#define DEFAULT_MINWEIGHT 0.8 /**< default value for the weight of the minimum in the convex combination of two
137#define DEFAULT_WORSEFACTOR -1.0 /**< if the FSB score is of a candidate is worse than the best by this factor, skip this candidate (-1: disable) */
138#define DEFAULT_FILTERBYMAXGAIN FALSE /**< should lookahead branching only be applied if the max gain in level 1 is not uniquely that of the best candidate? */
168/* Writes a debug message without the leading information. Can be used to append something to an output of LABdebugMessage*/
183/** A struct holding information to speed up the solving time for solving a problem again. This is filled by the FSB
184 * scoring routine that is run to get the best candidates. It is then read by the actual ALAB routine. */
187 SCIP_LPISTATE* lpistate; /**< the basis information that may be set before another solve lp call */
193/** Allocates the warm start information on the buffer and initializes it with default values. */
259 WARMSTARTINFO* downwarmstartinfo; /**< the warm start info containing the lp data from a previous down branch */
260 WARMSTARTINFO* upwarmstartinfo; /**< the warm start info containing the lp data from a previous up branch */
292 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "freeing warmstart info of candidate <%s>(%u/%u)...\n",
378/** returns whether the candidate has stored warm starting information for the given direction */
387 return warmStartInfoIsAvailable(down ? candidate->downwarmstartinfo : candidate->upwarmstartinfo);
411 /* As we solved the very same LP some time earlier and stored the state (the basis) and the norms, we can now set those in
413 * Some iterations may occur, as the conflict analysis may have added some constraints in the meantime. */
414 SCIP_CALL( SCIPsetProbingLPState(scip, &(warmstartinfo->lpistate), &(warmstartinfo->lpinorms), warmstartinfo->primalfeas,
417 /* The state and norms will be freed later by the SCIP framework. Therefore they are set to NULL to enforce that we won't
439 SCIP_Bool downdbvalid; /**< Indicator for the validity of the downdb value. Is FALSE, if no actual
494 * this is used to store the most important information (i.e., the dual bounds obtained) so that it can be used in a
495 * subsequent call in case the LP solution did not change because we only added bound changes that did not forbid the
497 * however, we do not want to store all the domain changes for the two potential child nodes for this rare case, they
534 /* a branching decision is deemed valid, if the var pointer is not on the default NULL value (see the allocate method) */
592 SCIP_Real dualbound; /**< The best dual bound for this branching, may be changed by deeper level
596 SCIP_Bool dualboundvalid; /**< Is the value of the dual bound valid? That means, was the according LP
600 SCIP_Real bestgain; /**< best gain (w.r.t. to the base lp) on the lowest level below this child */
683 SCIP_Real lpobjval; /**< the objective value of the solved lp; only contains meaningful data, if
689 unsigned int branchdir1:1; /**< branching direction for first branching variable (0:down, 1:up) */
690 unsigned int branchdir2:1; /**< branching direction for second branching variable (0:down, 1:up) */
705 unsigned int branchdir1:1; /**< branching direction for first branching variable (0:down, 1:up) */
706 unsigned int branchdir2:1; /**< branching direction for second branching variable (0:down, 1:up) */
709/** allocates a double branching result in the memory and fills it with the information stored in the level 2 data */
783/** returns TRUE iff both level 2 results are equal; two branchings are equal if they branched on the same variables
873 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &data->level2results, data->level2resultssize, newsize) );
928 SCIP_Bool* duplicate /**< pointer to store whether information for the same branching decisions was already stored */
978 BRANCHINGDECISION* olddecision; /**< The previous decision that gets used for the case that in the previous run
980 SCIP_Longint oldnnodelpiterations; /**< node LP iterations when previous branching decision was stored */
983 SCIP_Longint* lastbranchid; /**< The node id at which the var was last branched on (for a given branching
985 SCIP_Longint* lastbranchnlps; /**< The number of (non-probing) LPs that where solved when the var was last
988 BRANCHINGRESULTDATA** lastbranchupres; /**< The result of the last up branching for a given var. */
989 BRANCHINGRESULTDATA** lastbranchdownres; /**< The result of the last down branching for a given var. */
990 int restartindex; /**< The index at which the iteration over the number of candidates starts. */
994/** The parameter that can be changed by the user/caller and alter the behaviour of the lookahead branching. */
997 SCIP_Longint reevalage; /**< The number of "normal" (not probing) lps that may have been solved before
999 SCIP_Longint reevalagefsb; /**< The number of "normal" (not probing) lps that may have been solved before
1001 int maxnviolatedcons; /**< The number of constraints (domain reductions and binary constraints) we
1004 int maxnviolatedbincons;/**< The number of binary constraints we want to gather before restarting the
1006 int maxnviolateddomreds;/**< The number of domain reductions we want to gather before restarting the
1009 int maxncands; /**< If abbreviated == TRUE, at most how many candidates should be handled at the base node? */
1010 int maxndeepercands; /**< If abbreviated == TRUE, at most how many candidates should be handled in deeper nodes? */
1011 SCIP_Bool usedomainreduction; /**< indicates whether the data for domain reductions should be gathered and
1013 SCIP_Bool mergedomainreductions; /**< should domain reductions of feasible siblings should be merged? */
1014 SCIP_Bool prefersimplebounds; /**< should domain reductions only be applied if there are simple bound changes? */
1015 SCIP_Bool onlyvioldomreds; /**< Should only domain reductions that violate the LP solution be applied? */
1016 SCIP_Bool usebincons; /**< indicates whether the data for the implicit binary constraints should
1020 SCIP_Bool addnonviocons; /**< Should constraints be added, that are not violated by the base LP? */
1022 SCIP_Bool reusebasis; /**< If abbreviated == TRUE, should the solution lp-basis of the FSB run be
1024 SCIP_Bool storeunviolatedsol; /**< Should a solution/decision be stored, to speed up the next iteration
1026 SCIP_Bool abbrevpseudo; /**< If abbreviated == TRUE, should pseudocost values be used, to approximate
1028 SCIP_Bool level2avgscore; /**< should the average score be used for uninitialized scores in level 2? */
1030 SCIP_Bool addclique; /**< add binary constraints with two variables found at the root node also as a clique? */
1032 SCIP_Bool uselevel2data; /**< should branching data generated at depth level 2 be stored for re-using it? */
1034 SCIP_Bool enforcemaxdomreds; /**< should the maximum number of domain reductions maxnviolateddomreds be enforced? */
1035 SCIP_Bool updatebranchingresults; /**< should branching results (and scores) be updated w.r.t. proven dual bounds? */
1043 SCIP_Real worsefactor; /**< if the FSB score is of a candidate is worse than the best by this factor, skip this candidate (-1: disable) */
1044 SCIP_Bool filterbymaxgain; /**< should lookahead branching only be applied if the max gain in level 1 is not uniquely that of the best candidate? */
1113 int* nsinglecutoffs; /**< The number of single cutoffs on a (probing) node per probingdepth. */
1118 SCIP_Longint* nlpiterations; /**< The number of all lp iterations needed for a given probingdepth
1120 SCIP_Longint* nlpiterationsfsb; /**< The number of lp iterations needed to get the FSB scores. */
1125 int* noldbranchusedfsb; /**< The number of times old FSB scoring data is used (see the reevalagefsb
1127 int* chosenfsbcand; /**< If abbreviated, this is the number of times each candidate was finally
1131 int* cutoffafterfsb; /**< If abbreviated, this is the number of times the rule was stopped after
1133 int* domredafterfsb; /**< If abbreviated, this is the number of times the rule was stopped after
1135 int nsinglecandidate; /**< number of times a single candidate was given to the recursion routine */
1139 int nlperrorcalls; /**< number of times an LP error occured and LAB branched without completely
1145 int nbinconstvio; /**< The number of binary constraints added to the base node, that are violated
1150 int ndepthreached; /**< The number of times the branching was aborted due to a too small depth. */
1155 int maxnbestcands; /**< if abbreviated, this is the maximum number of candidates to investigate */
1156 int recursiondepth; /**< The recursiondepth of the LAB. Can be used to access the depth-dependent
1231 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Lookahead Branching was called <%i> times.\n", statistics->ntotalresults);
1237 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Result <%s> was chosen <%i> times\n", getStatusString(currentresult),
1245 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "The %i. variable (w.r.t. the FSB score) was chosen as the final result %i times.\n",
1252 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, branching was stopped after the scoring FSB %i times, %i times because of a cutoff and %i times because of a domain reduction\n",
1254 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, <%i> fullcutoffs and <%i> single cutoffs were found.\n",
1256 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, <%i> LPs were solved, <%i> of them to calculate the FSB score, <%i> were saved for duplicate grandchildren.\n",
1258 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, <%" SCIP_LONGINT_FORMAT "> iterations were needed to solve the LPs, <%"
1259 SCIP_LONGINT_FORMAT "> of them to calculate the FSB score.\n", i, statistics->nlpiterations[i],
1261 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, a decision was discarded <%i> times due to domain reduction because of"
1263 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "In depth <%i>, old LAB branching results were used in <%i> cases, old FSB scores in <%d> cases.\n",
1267 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "One single branching candidate was given <%i> times, after filtering, a single candidate remained <%i> times.\n",
1269 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "The old branching candidate was used <%i> times.\n",
1271 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "An LP error led to branching before all candidates were evaluated <%i> times.\n",
1273 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "A reached (time) limit led to branching before all candidates were evaluated <%i> times.\n",
1275 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Depth limit was reached <%i> times.\n", statistics->ndepthreached);
1276 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Ignored <%i> binary constraints, that would be domain reductions.\n",
1278 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Added <%i> binary constraints, of which <%i> where violated by the base LP.\n",
1280 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Reduced the domain of <%i> vars, <%i> of them where violated by the base LP.\n",
1282 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Added <%i> cliques found as binary constraint in the root node\n",
1284 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Needed <%i> additional nodes to prove the cutoffs of base nodes\n",
1286 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Needed <%i> additional nodes to prove the domain reductions\n",
1301 LOCALSTATISTICS** localstats /**< pointer to the local statistics to allocate and initialize */
1331 CONFIGURATION* config; /**< the parameter that influence the behaviour of the lookahead branching */
1397 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &list->nconsvars, list->memorysize, newmemsize) );
1403 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &list->consvars[list->nelements], consvars, nconsvars) ); /*lint !e866*/
1438 * these variables are used to build the binary constraint in case that a ('binary') branch is cut off
1564 int ncandidates; /**< the number of actual entries in candidates (without trailing NULLs); this
1569/** allocates the candidate list on the buffer WITHOUT initializing the contained array of candidates. */
1595/** allocates the given list and fills it with all fractional candidates of the current LP solution. */
1612 SCIP_CALL( SCIPgetLPBranchCands(scip, &lpcands, &lpcandssol, &lpcandsfrac, &nlpcands, NULL, NULL) );
1640/** frees the allocated buffer memory of the candidate list and frees the contained candidates. */
1706 SCIP_Shortbool* baselpviolated; /**< Indicates whether the base lp solution violates the new bounds of a var.*/
1707 int nviolatedvars; /**< Tracks the number of vars that have a violated (by the base lp) new lower
1709 int nchangedvars; /**< Tracks the number of vars, that have a changed domain. (a change on both,
1713 int* lowerboundnproofs; /**< The number of nodes needed to prove the lower bound for each variable. */
1714 int* upperboundnproofs; /**< The number of nodes needed to prove the upper bound for each variable. */
1732 /* The arrays saves the data for all variables in the problem via the ProbIndex. See SCIPvarGetProbindex() */
1760/** frees the given DOMAINREDUCTIONS and all contained Arrays in the opposite order of allocation */
1791 SCIP_Bool maxnconsreached; /**< was the max number of constraints (bin conss and dom red) reached? */
1836 CANDIDATE** bestsortedcands; /**< array containing the best sorted variable indices w.r.t. their score */
1869 /* the container saves the score for all variables in the problem via the ProbIndex, see SCIPvarGetProbindex() */
1898/** Finds the insertion index for the given score in the candidate list. The score of each candidate is taken from the
1899 * scorecontainer. The first elements of the candidate list have to be sorted, as this method uses binary search to find
1907 CANDIDATE** candidates, /**< candidate list where the first nsorted elements are sorted (w.r.t. their
1945/** Inserts the given probindex into the sorted array in the container, moving all indices after it to the right. Then
2012 /* insert the current variable (cand) at the position calculated above, returning the candidate that
2013 * was removed at the end of the list; this candidate can be the given candidate for the case that the score does not
2023 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Stored score <%.9g> for var <%s>.\n", score, SCIPvarGetName(cand->branchvar));
2038 /* don't free the candidates inside the cands array, as those are handled by the candidate list */
2057 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
2069 SCIP_Longint* niterations, /**< pointer to store the total number of iterations for this variable */
2070 int* ndeepestcutoffs, /**< pointer to store the total number of cutoffs on the deepest level */
2072 SCIP_Real* totalgains, /**< pointer to store the sum over all gains that are valid in both children */
2089 SCIP_SOL* baselpsol, /**< The LP solution of the base problem. Used to check whether the domain
2095 ,int force /**< should the number of proof nodes be added even if the bound is known already? */
2128 /* if the given lower bound is equal to the old one we take the smaller number of proof nodes */
2135 /* we get the solution value to check whether the domain reduction is violated in the base LP */
2138 /* in case the new lower bound is greater than the base solution val and the base solution val is not violated by a
2139 * previously found bound, we increment the nviolatedvars counter and set the baselpviolated flag */
2154 SCIP_SOL* baselpsol, /**< The LP solution of the base problem. Used to check whether the domain
2160 ,int force /**< should the number of proof nodes be added even if the bound is known already? */
2183 /* if the given upper bound is equal to the old one we take the smaller number of proof nodes */
2202 /* We get the solution value to check whether the domain reduction is violated in the base LP */
2205 /* In case the new upper bound is smaller than the base solution val and the base solution val is not violated by a
2206 * previously found bound, we increment the nviolatedvars counter and set the baselpviolated flag. */
2215/** apply the domain reductions from a single struct to another one; this may be used in case one of the two child
2221 SCIP_SOL* baselpsol, /**< The LP solution of the base problem. Used to check whether the domain
2224 DOMAINREDUCTIONS* targetdomreds, /**< The target that should be filled with the merged data. */
2270 * merges the domain reduction data from the two given branching children data into the target parent data
2275 SCIP_SOL* baselpsol, /**< The LP solution of the base problem. Used to check whether the domain
2278 DOMAINREDUCTIONS* targetdomreds, /**< The target that should be filled with the merged data. */
2300 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Combining domain reductions from up and down child.\n");
2301 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Previous number of changed variable domains: %d\n",
2304 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Number of changed variable domains in up child: %d\n",
2306 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Number of changed variable domains in down child: %d\n",
2345 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Subsequent number of changed variable domains: %d\n",
2354 SCIP_SOL* baselpsol, /**< The LP solution of the base problem. Used to check whether the domain
2356 DOMAINREDUCTIONS* domreds, /**< The domain reductions that should be applied to the current node. */
2357 SCIP_Bool* domredcutoff, /**< pointer to store whether a cutoff was found due to domain reductions */
2426 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Variable <%s>, old lower bound <%g>, proposed lower bound <%g>, new "
2434 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The domain reduction of variable <%s> resulted in an empty "
2445 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The lower bound of variable <%s> was successfully tightened (%d).\n",
2453 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The lower bound of variable <%s> is violated by the base lp "
2477 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Variable <%s>, old upper bound <%g>, proposed upper bound <%g>, new "
2485 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The domain reduction of variable <%s> resulted in an empty "
2496 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The upper bound of variable <%s> was successfully tightened (%d).\n",
2504 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The upper bound of variable <%s> is violated by the base lp "
2519 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Truly changed <%d> domains of the problem, <%d> of them are violated by the "
2564 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Effective branching on var <%s> with value <%g(%g)>. Old domain: [%g..%g].\n",
2565 SCIPvarGetName(bestvar), bestval, SCIPgetSolVal(scip, NULL, bestvar), SCIPvarGetLbLocal(bestvar), SCIPvarGetUbLocal(bestvar));
2574 SCIPdebugMsg(scip, "down child (node %" SCIP_LONGINT_FORMAT "): branching bound change <%s> <= %g\n",
2576 SCIPdebugMsg(scip, "up child (node %" SCIP_LONGINT_FORMAT "): branching bound change <%s> >= %g\n",
2582 /* update the lower bounds in the children; we must not do this if columns are missing in the LP
2629 SCIPdebugMsg(scip, "down child (node %" SCIP_LONGINT_FORMAT "): add bound change <%s> >= %g\n",
2633 /* update the upper bound of the lower child in case it is better than the current one AND it is not the
2640 SCIPdebugMsg(scip, "down child (node %" SCIP_LONGINT_FORMAT "): add bound change <%s> <= %g\n",
2647 /* update the lower bound of the upper child in case it is better than the current one AND it is not the
2669 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, " -> down child's lowerbound: %.9g, estimate: %.9g\n",
2671 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, " -> up child's lowerbound: %.9g, estimate: %.9g\n",
2701/** Creates a new probing node with a new bound for the given candidate and solves the corresponding LP. */
2708 BRANCHINGRESULTDATA* resultdata, /**< pointer to the result data which gets filled with the status */
2710 DOMAINREDUCTIONS* domreds, /**< struct to store the domain reduction found during propagation */
2751 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "DownBranching: Var=<%s>, Proposed upper bound=<%g>, "
2752 "old bounds=[<%g>..<%g>], new bounds=[<%g>..<%g>]\n", SCIPvarGetName(branchvar), newbound, oldlowerbound,
2757 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "UpBranching: Var=<%s>, Proposed lower bound=<%g>, "
2758 "old bounds=[<%g>..<%g>], new bounds=[<%g>..<%g>]\n", SCIPvarGetName(branchvar), newbound, oldlowerbound,
2803 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Restoring lp information for %s branch of variable <%s>\n",
2813 SCIP_CALL( SCIPpropagateProbing(scip, config->maxproprounds, &resultdata->cutoff, &ndomredsfound) );
2817 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Found %" SCIP_LONGINT_FORMAT " domain reductions via propagation.\n", ndomredsfound);
2862 /* for us an error occurred, if an error during the solving occurred or the lp could not be solved but was not
2864 status->lperror = status->lperror || (solstat == SCIP_LPSOLSTAT_NOTSOLVED && resultdata->cutoff == FALSE);
2866 /* if we seem to have reached a {time, iteration}-limit or the user cancelled the execution, we want to stop
2868 status->limitreached = (solstat == SCIP_LPSOLSTAT_ITERLIMIT) || (solstat == SCIP_LPSOLSTAT_TIMELIMIT);
2882 /* if we have no error, we save the new objective value and the cutoff decision in the resultdata */
2886 resultdata->cutoff = resultdata->cutoff || SCIPisGE(scip, resultdata->objval, SCIPgetCutoffbound(scip));
2895/** Creates a logic or constraint based on the given 'consvars'. This array has to consist of the negated
2896 * versions of the variables present on a cutoff "path" (path means all variables from the root directly
2898 * Let x_1, ..., x_n be the variables on a path to a cutoff with the branchings x_i <= 1 for all i.
2937 SCIP_CALL( SCIPcreateConsLogicor(scip, constraint, constraintname, nconsvars, consvars, initial, separate, enforce,
2959 (void) SCIPsnprintf(constraintname, SCIP_MAXSTRLEN, "lookahead_bin_%s", SCIPvarGetName(binaryvars[0]));
2975 * The implicit binary bounds were found when two or more consecutive branchings of binary variables were cutoff. Then these
2983 SCIP_SOL* baselpsol /**< the original lp solution, used to check the violation of the constraint */
2996 /* if we only have one var for the constraint, we can ignore it as it is already added as a domain reduction. */
3026 /* the constraint we will be building is a logic or: we have a list of binary variables that were
3029 * is violating this constraint we count this for our number of violated constraints and bounds. */
3056 SCIP_Bool* boundchange /**< pointer to store whether a bound change has been applied by adding the
3077 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "processing %d binary constraints.\n", conslist->nelements);
3141 /* a two-variable logicor constraint x + y >= 1 yields the implication x == 0 -> y == 1, and is represented
3161 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "added %d/%d binary constraints.\n", nconsadded, conslist->nelements);
3192 /* due to roundings the value might have changed slightly without an actual influence on the integral value */
3196/** Checks whether the branching rule should continue or terminate with the currently gathered data */
3209/** Checks whether the branching rule should continue or terminate with the currently gathered data. Additionally decrements
3210 * the given loopcounter. This is needed to better emulate the behavior of FSB by LAB with a depth of 1. */
3243 /* an old branching can be reused, if we are still at the same node and just a few LPs were solved in between */
3252 && SCIPgetNLPs(scip) - persistent->lastbranchnlps[SCIPvarGetProbindex(branchvar)] < config->reevalage;
3277 SCIP_CALL( SCIPgetVarStrongbranchLast(scip, branchvar, &downbranchingresult->dualbound, &upbranchingresult->dualbound,
3278 &downbranchingresult->dualboundvalid, &upbranchingresult->dualboundvalid, NULL, oldlpobjval) );
3299 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Lookahead branching on variable <%s> already performed (lpage=%"
3332 SCIP_CALL( SCIPsetVarStrongbranchData(scip, branchvar, lpobjval, branchval, downbranchingresult->dualbound,
3333 upbranchingresult->dualbound, downbranchingresult->dualboundvalid, upbranchingresult->dualboundvalid, niterations,
3355 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
3358 DOMAINREDUCTIONS* domainreductions, /**< container collecting all domain reductions found; or NULL */
3362 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
3465 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3511 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3526 downgain = MAX(SCIPsumepsilon(scip), downbranchingresult->dualbound - lpobjval); /*lint !e666*/
3533 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3567 assert(downbranchingresult->deeperscore >= -0.2 || downbranchingresult->cutoff || SCIPisStopped(scip));
3568 assert(upbranchingresult->deeperscore >= -0.2 || upbranchingresult->cutoff || SCIPisStopped(scip));
3609 assert(downbranchingresult->deeperscore >= -0.2 || downbranchingresult->cutoff || SCIPisStopped(scip));
3610 assert(upbranchingresult->deeperscore >= -0.2 || upbranchingresult->cutoff || SCIPisStopped(scip));
3612 nlowestlevelcutoffs = (1.0 * downbranchingresult->ndeepestcutoffs + upbranchingresult->ndeepestcutoffs)/(MAX(1,downbranchingresult->ndeepestnodes + upbranchingresult->ndeepestnodes));
3676 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3686 return config->minweight * MIN(downgain, upgain) + (1.0 - config->minweight) * MAX(downgain, upgain);
3689/** calculates the score as mentioned in the lookahead branching paper by Glankwamdee and Linderoth;
3690 * their score scales the number of cutoffs on the last layer of a 2-level temporary branching tree with the average gain of
3691 * every last level problem; together with the best gain for each branch of a variable we get the final score
3710 nlowestlevelcutoffs = downbranchingresult->ndeepestcutoffs + upbranchingresult->ndeepestcutoffs;
3718 return bestdowngain + bestupgain + (totaldowngains/ntotaldowngains + totalupgains/ntotalupgains)*nlowestlevelcutoffs;
3721/** calculates the score as mentioned in the lookahead branching paper by Glankwamdee and Linderoth;
3722 * their score scales the number of cutoffs on the last layer of a 2-level temporary branching tree with the average gain of
3723 * every last level problem; together with the best gain for each branch of a variable we get the final score
3743 nlowestlevelcutoffs = (1.0 * downbranchingresult->ndeepestcutoffs + upbranchingresult->ndeepestcutoffs)/(downbranchingresult->ndeepestnodes + upbranchingresult->ndeepestnodes);
3751 return config->minweight*MIN(bestdowngain, bestupgain) + (1.0 - config->minweight)*MAX(bestdowngain, bestupgain) + (totaldowngains/ntotaldowngains + totalupgains/ntotalupgains)*nlowestlevelcutoffs;
3788 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3832 assert(downbranchingresult->ndeepestnodes + upbranchingresult->ndeepestnodes > 0 || (downbranchingresult->cutoff && upbranchingresult->cutoff));
3834 nlowestlevelcutoffs = (1.0 * downbranchingresult->ndeepestcutoffs + upbranchingresult->ndeepestcutoffs)/(1 + downbranchingresult->ndeepestnodes + upbranchingresult->ndeepestnodes);
3853 /* in case a child is infeasible and therefore cutoff we take the gain of the other child to receive a somewhat
3913 score = calculateWeightedGain(scip, config, downbranchingresult, upbranchingresult, baselpobjval);
3916 score = calculateScoreFromDeeperscore(scip, branchvar, downbranchingresult, upbranchingresult);
3919 score = calculateScoreFromDeeperscoreAndCutoffs(scip, branchvar, downbranchingresult, upbranchingresult);
3922 score = calculateScoreFromResult2(scip, branchvar, downbranchingresult, upbranchingresult, lpobjval);
3925 score = calculateCutoffScore(scip, branchvar, downbranchingresult, upbranchingresult, lpobjval);
3928 score = calculateRelCutoffScore(scip, branchvar, downbranchingresult, upbranchingresult, lpobjval);
3931 score = calculateScoreFromResult(scip, branchvar, downbranchingresult, upbranchingresult, baselpobjval);
3935 score = calculateScoreFromResult(scip, branchvar, downbranchingresult, upbranchingresult, lpobjval);
3964/** prints the names of the candidates of the given candidate list with their corresponding scores */
3985 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, " Index %2i: Var %s Score %.9g\n", i, SCIPvarGetName(var), score);
3990/** sorts the best candidates (w.r.t. the score in the container) of the candidate list to the front of the list */
3996 int nbestcandidates /**< number of candidates that should be kept sorted at the start of the list*/
4022 insertionindex = findInsertionPoint(scip, scorecontainer, movescore, candidatelist->candidates, nsorted);
4049 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "All %i candidates, with the first %i candidates sorted by their FSB score:"
4088/** Ensures that the scores are present in the scorecontainer for each of the candidates to consider */
4093 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
4096 DOMAINREDUCTIONS* domainreductions, /**< container collecting all domain reductions found; or NULL */
4100 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
4122 /* filter the candidates based on the presence of a score in the 'scorecontainer'. Only those without a score need a
4184 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Calculating the FSB result to get a score for the remaining "
4190 SCIP_CALL( getFSBResult(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, unscoredcandidates,
4193 SCIP_CALL( getFSBResult(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, unscoredcandidates,
4206 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Calculated the scores for the remaining candidates\n");
4219/** Get the candidates to temporarily branch on. In the LAB case this is the complete list of possible candidates. In the
4225 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
4228 DOMAINREDUCTIONS* domainreductions, /**< container collecting all domain reductions found; or NULL */
4232 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
4252 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Getting the best (at most) %i of the given %i candidates: ",
4258 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "%s", "Ensuring that all candidates have a score.\n");
4260 SCIP_CALL( ensureScoresPresent(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
4263 SCIP_CALL( ensureScoresPresent(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
4290 config->worsefactor * scorecontainer->scores[SCIPvarGetProbindex(candidatelist->candidates[i]->branchvar)] )
4299 SCIP_Real bestmaxgain = MAX(scorecontainer->downgains[SCIPvarGetProbindex(candidatelist->candidates[0]->branchvar)],
4300 scorecontainer->upgains[SCIPvarGetProbindex(candidatelist->candidates[0]->branchvar)]); /*lint !e666*/
4308 maxgain = MAX(scorecontainer->downgains[SCIPvarGetProbindex(candidatelist->candidates[i]->branchvar)],
4309 scorecontainer->upgains[SCIPvarGetProbindex(candidatelist->candidates[i]->branchvar)]); /*lint !e666*/
4326 if( SCIPgetProbingDepth(scip) > 0 && scorecontainer->scores[SCIPvarGetProbindex(candidatelist->candidates[0]->branchvar)] > -0.05)
4330 if( scorecontainer->scores[SCIPvarGetProbindex(candidatelist->candidates[i]->branchvar)] < -0.05 )
4350 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Getting the branching candidates by selecting all candidates.\n");
4356/** Executes the general branching on a variable in a given direction (up/down) and repeats the algorithm from the new node */
4367 DOMAINREDUCTIONS* domainreductions, /**< container collecting all domain reductions found; or NULL */
4370 BRANCHINGRESULTDATA* branchingresult, /**< container to store the result of the branching in */
4371 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
4406 * This list is used to generate a set packing constraint for cutoff branches which were reached by only using
4422 * This list is used to generate a set packing constraint for cutoff branches which were reached by only using
4433 SCIP_Real newbound = downbranching ? SCIPfeasFloor(scip, branchval) : SCIPfeasCeil(scip, branchval);
4473 "Use old %s branching result on var <%s> with 'val > %g' and bounds [<%g>..<%g>]: objval <%.9g>, cutoff <%d> "
4475 downbranching ? "down" : "up", SCIPvarGetName(branchvar), branchval, SCIPvarGetLbLocal(branchvar),
4476 SCIPvarGetUbLocal(branchvar), branchingresult->objval, branchingresult->cutoff, localbaselpsolval);
4483 SCIP_CALL( executeBranching(scip, config, downbranching, candidate, branchingresult, baselpsol, domainreductions,
4492 SCIP_CALL( level2dataStoreResult(scip, level2data, branchingresult->objval, branchingresult->cutoff, branchingresult->dualboundvalid, &duplicate) );
4506 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Solving the LP took %" SCIP_LONGINT_FORMAT " iterations (status %d).\n",
4516 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The solved LP was infeasible and as such is cutoff\n");
4520 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The solved LP was feasible and has an objval <%.9g> (the parent objval was "
4545 /* store the warm start information in the candidate, so that it can be reused in a later branching */
4548 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Storing warm start information for %s branching on var <%s>\n",
4561 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "%sbranching has <%i> candidates.\n", downbranching ? "Down" : "Up",
4580 SCIP_CALL( filterCandidates(scip, deeperstatus, deeperpersistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
4584 SCIP_CALL( filterCandidates(scip, deeperstatus, deeperpersistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
4601 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Now the objval is <%.9g>\n", branchingresult->objval);
4605 SCIP_CALL( selectVarRecursive(scip, deeperstatus, deeperpersistent, config, baselpsol, domainreductions,
4607 deeperlpobjval, baselpobjval, &branchingresult->niterations, &branchingresult->ndeepestcutoffs,
4612 SCIP_CALL( selectVarRecursive(scip, deeperstatus, deeperpersistent, config, baselpsol, domainreductions,
4614 deeperlpobjval, baselpobjval, &branchingresult->niterations, &branchingresult->ndeepestcutoffs,
4624 /* the proved dual bound of the deeper branching cannot be less than the current dual bound, as every deeper
4655 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Both deeper children were cutoff, so the %s branch is "
4667 branchingresult->deeperscore = (branchingresult->dualbound - baselpobjval) * (branchingresult->dualbound - baselpobjval) * 10;
4685 /* the current branching child is infeasible and we only branched on binary variables in lookahead branching */
4710 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
4713 DOMAINREDUCTIONS* domainreductions, /**< container collecting all domain reductions found; or NULL */
4717 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
4722 SCIP_Longint* niterations, /**< pointer to store the total number of iterations for this variable; or NULL*/
4723 int* ndeepestcutoffs, /**< pointer to store the total number of cutoffs on the deepest level; or NULL */
4724 SCIP_Real* bestgain, /**< pointer to store the best gain found with these candidates; or NULL */
4725 SCIP_Real* totalgains, /**< pointer to store the sum over all gains that are valid in both children;
4809 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Started selectVarRecursive with <%i> candidates: ", nlpcands);
4815 /* iterate over all current branching candidates and evaluate their two potential child nodes by:
4818 * - potentially evaluating branching candidates at the potential child node again by applying this method recursively
4821 * - results obtained for a candidate in a previous lookahead branching call at this node may be re-used
4822 * - while i counts the number of candidates evaluated in this call, we do not always start at the front
4823 * of the candidate array, but rather store at which index we stopped last time (e.g., because a domain reduction was
4824 * found and applied) and start from that index next time. Even though the set of branching candidates is probably different
4857 * this may happen if domain propagation on other candidates finds better bounds for the current candidate
4863 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Domain Propagation changed the bounds of a branching candidate."
4871 /* Reset the cutoffproofnodes, as the number of proof nodes from previous branching vars (which where not
4881 if( persistent != NULL && (config->inscoring || probingdepth == 0) && isUseOldBranching(scip, persistent, config, branchvar) )
4883 SCIP_CALL( getOldBranching(scip, persistent, config, branchvar, downbranchingresult, upbranchingresult,
4898 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, "Started branching on var <%s> with val <%g> and bounds "
4922 SCIP_CALL( executeBranchingRecursive(scip, status, config, baselpsol, candidate, lpobjval, baselpobjval,
4923 recursiondepth, localdomainreductions, binconsdata, level2data, localbranchingresult, scorecontainer,
4927 SCIP_CALL( executeBranchingRecursive(scip, status, config, baselpsol, candidate, lpobjval, baselpobjval,
4928 recursiondepth, localdomainreductions, binconsdata, level2data, localbranchingresult, scorecontainer,
4950 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, "-> down=%.9g (gain=%.9g, valid=%u, inf=%u), up=%.9g "
4953 downbranchingresult->cutoff, upbranchingresult->dualbound, upbranchingresult->dualbound - lpobjval,
4960 if( persistent != NULL && !upbranchingresult->cutoff && !downbranchingresult->cutoff && (config->inscoring || probingdepth == 0) )
4962 SCIP_CALL( updateOldBranching(scip, persistent, config, branchvar, branchval, downbranchingresult,
4976 SCIP_Real score = calculateScore(scip, config, branchvar, downbranchingresult, upbranchingresult,
4984 if( bestgain != NULL && !config->inscoring && SCIPgetProbingDepth(scip) == 1 && !useoldbranching )
5001 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, " -> variable <%s> is infeasible in both directions\n",
5014 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, " -> variable <%s> is infeasible in upward branch\n",
5017 /* apply down branching bound change at current node if we proved that this node is really infeasible and
5044 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, " -> variable <%s> is infeasible in downward branch\n",
5047 /* apply up branching bound change at current node if we proved that this node is really infeasible and
5074 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Neither branch is cut off and no limit reached.\n");
5094 if( !upbranchingresult->cutoff && !downbranchingresult->cutoff && config->mergedomainreductions )
5095 applyDeeperDomainReductions(scip, baselpsol, maxstoredomreds, domainreductions, downdomainreductions,
5098 applySingleDeeperDomainReductions(scip, baselpsol, maxstoredomreds, domainreductions, downdomainreductions);
5100 applySingleDeeperDomainReductions(scip, baselpsol, maxstoredomreds, domainreductions, updomainreductions);
5109 bestdownbranchingresult->dualbound = MAX(bestdownbranchingresult->dualbound, decision->proveddb);
5112 newscore = calculateScore(scip, config, decision->branchvar, bestdownbranchingresult, bestupbranchingresult,
5129 /* the current candidate variable has a better score than the best candidate investigated so far */
5134 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Old best var <%s> with bounds [<%g>..<%g>] and score %.9g\n",
5177 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "New best var <%s> with bounds [<%g>..<%g>] and score %.9g\n",
5182 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, " -> cand %d/%d var <%s> (solval=%.9g, downgain=%.9g->%.9g, upgain=%.9g->%.9g,"
5184 MAX(downbranchingresult->objval - scoringlpobjval, 0), MAX(downbranchingresult->dualbound - scoringlpobjval, 0),
5185 MAX(upbranchingresult->objval - scoringlpobjval, 0), MAX(upbranchingresult->dualbound - scoringlpobjval, 0),
5192 /* only for abbreviated lookahead branching: we are in the FSB filtering step and store the score for this
5193 * variable and the warm starting basis to reuse it in the subsequent lookahead evaluation of the best
5197 downbranchingresult->dualbound - scoringlpobjval, upbranchingresult->dualbound - scoringlpobjval) );
5201 && (config->maxnviolatedcons >= 0 || config->maxnviolatedbincons >= 0 || config->maxnviolateddomreds >= 0 ) )
5210 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Found %d binary constraints (%d violated by the LP solution)\n",
5215 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The max number of violated binary constraints <%i> is "
5228 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Found %d bound changes (%d violated by the LP solution)\n",
5241 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The max number of violated binary constraints and bound "
5248 if( !(status->domred && decision->branchvar == candidate->branchvar) && areBoundsChanged(scip, decision->branchvar, bestscorelowerbound, bestscoreupperbound) )
5250 /* in case the bounds of the current highest scored solution have changed due to domain propagation during
5251 * the lookahead branching we can/should not branch on this variable but instead report the domain
5257 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Domain Propagation changed the bounds of a branching candidate."
5285/** checks whether the current decision should be stored. This is the case if we found domain reductions
5287 * Then our current decision still holds true for the next call and can be reused without further calculations
5293 DOMAINREDUCTIONS* domainreductions /**< container collecting all domain reductions found; or NULL */
5319 PERSISTENTDATA* persistent, /**< container to store data over multiple calls to the branching rule; or NULL */
5322 SCORECONTAINER* scorecontainer, /**< container to retrieve already calculated scores; or NULL */
5360 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Cannot perform probing in selectVarRecursive, depth limit reached. "
5381 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Only one candidate (<%s>) is given. This one is chosen without "
5391 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The objective value of the base lp is <%.9g>\n", lpobjval);
5395 /* we have to copy the current solution before getting the candidates, as we possibly solve some LPs during
5418 SCIP_CALL( filterCandidates(scip, status, persistent, config, baselpsol, domainreductions, NULL, candidatelist,
5422 SCIP_CALL( filterCandidates(scip, status, persistent, config, baselpsol, domainreductions, NULL, candidatelist,
5436 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Only one candidate (<%s>) is given. This one is chosen without "
5460 SCIP_CALL( selectVarRecursive(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
5461 decision, scorecontainer, level2data, recursiondepth, lpobjval, lpobjval, NULL, NULL, NULL, NULL, NULL, NULL,
5464 SCIP_CALL( selectVarRecursive(scip, status, persistent, config, baselpsol, domainreductions, binconsdata, candidatelist,
5465 decision, scorecontainer, level2data, recursiondepth, lpobjval, lpobjval, NULL, NULL, NULL, NULL, NULL, NULL) );
5474 if( persistent != NULL && !status->lperror && isStoreDecision(config, binconsdata, domainreductions) )
5476 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "store decision: lpiters=%lld, cand <%s>[%g,%g - %g]\n",
5540 SCIP_CALL( applyDomainReductions(scip, config, baselpsol, domainreductions, &status->domredcutoff,
5543 SCIP_CALL( applyDomainReductions(scip, config, baselpsol, domainreductions, &status->domredcutoff,
5560 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Applying %d binary constraints to the base node.\n", binconsdata->conslist->nelements);
5571 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Discarding %d binary constraints because the base node is cut off.\n", binconsdata->conslist->nelements);
5582 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Lookahead Branching has added domain reductions. LAB restarts.\n");
5591 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Lookahead Branching has added binary constraints. LAB restarts.\n");
5614 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "node %lld chose candidate %d score %16.9g vs %16.9g FSB: %16.9g vs %16.9g\n",
5616 scorecontainer->scores[SCIPvarGetProbindex(candidatelist->candidates[chosencandnr]->branchvar)],
5645 * We can use the previous result, stored in the branchruledata, if the branchingvariable (as an indicator) is set and
5664 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "check if previous result should be used: valid=%d, "\
5679 * This is the case, if in the previous run only non-violating constraints were added. In that case we can use the
5683 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5703 SCIP_CALL( branchOnVar(scip, branchruledata->config, branchruledata->persistent->olddecision) );
5706 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Branched based on previous solution. Variable <%s>\n",
5709 /* reset the var pointer, as this is our indicator whether we should branch on prev data in the next call */
5775 /* the branching rule data is already initialized and no new variables have been added in the meantime */
5785 /* The variables given by the SCIPgetVars() array are sorted with the binaries at first and the integer variables
5786 * directly afterwards. With the SCIPvarGetProbindex() method we can access the index of a given variable in the
5787 * SCIPgetVars() array and as such we can use it to access our arrays which should only contain binary and integer
5792 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->persistent->lastbranchid, nvars) );
5793 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->persistent->lastbranchnlps, nvars) );
5794 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->persistent->lastbranchupres, nvars) );
5795 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->persistent->lastbranchdownres, nvars) );
5796 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->persistent->lastbranchlpobjval, nvars) );
5810 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata->persistent->lastbranchupres[i]) ); /*lint !e866*/
5811 SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata->persistent->lastbranchdownres[i]) ); /*lint !e866*/
5886 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nsinglecutoffs, recursiondepth) );
5887 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nfullcutoffs, recursiondepth) );
5888 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nlpssolved, recursiondepth) );
5889 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nlpssolvedfsb, recursiondepth) );
5890 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nlpiterations, recursiondepth) );
5891 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nlpiterationsfsb, recursiondepth) );
5892 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->nduplicatelps, recursiondepth) );
5893 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->npropdomred, recursiondepth) );
5894 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->noldbranchused, recursiondepth) );
5895 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->noldbranchusedfsb, recursiondepth) );
5896 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->chosenfsbcand, maxncands) );
5897 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->domredafterfsb, recursiondepth) );
5898 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->cutoffafterfsb, recursiondepth) );
5899 SCIP_CALL( SCIPallocMemoryArray(scip, &branchruledata->statistics->stopafterfsb, recursiondepth) );
5951/** solving process deinitialization method of branching rule (called before branch and bound process data is freed) */
5981 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Entering branchExeclpLookahead at node %lld.\n", SCIPnodeGetNumber(SCIPgetCurrentNode(scip)));
5997 /* in case we stopped the previous run without a branching decision, we have stored the decision and execute it
6022 /* allocate and init the container used to store the FSB scores, later used to filter the candidates */
6028 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "The base lp has <%i> variables with fractional value.\n",
6066 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "LP error with no valid candidate: select first candidate variable\n");
6075 /* this case may occure if the domain reductions that reached the limit were already applied via domain
6093 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Result before branching is %s\n", getStatusString(*result));
6095 if( *result != SCIP_CUTOFF /* a variable could not be branched in any direction or any of the calculated domain
6097 && *result != SCIP_REDUCEDDOM /* the domain of a variable was reduced by evaluating the calculated cutoffs */
6104 LABdebugMessage(scip, SCIP_VERBLEVEL_NORMAL, " -> %d candidates, selected variable <%s> (solval=%g, down=%.9g, "
6105 "up=%.9g)\n", candidatelist->ncandidates, SCIPvarGetName(decision->branchvar), decision->branchval,
6115 LABdebugMessage(scip, SCIP_VERBLEVEL_FULL, "Result after branching is %s\n", getStatusString(*result));
6119 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Finished LookaheadBranching by branching.\n");
6123 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Finished LookaheadBranching by reducing domains.\n");
6127 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Finished LookaheadBranching by cutting off, as the current "
6132 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Finished LookaheadBranching by adding constraints.\n");
6136 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: The remaining tree depth did not allow for multi level "
6141 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "Result: Could not find any variable to branch on.\n");
6170 sum = branchruledata->statistics->nsinglecandidate + branchruledata->statistics->nsingleafterfilter
6190 LABdebugMessage(scip, SCIP_VERBLEVEL_HIGH, "#### ncutoffproofnodes: %d ndomredproofnodes: %d\n",
6221 SCIP_CALL( SCIPincludeBranchruleBasic(scip, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY,
6241 "should binary constraints be added as rows to the base LP? (0: no, 1: separate, 2: as initial rows)",
6244 "how many constraints that are violated by the base lp solution should be gathered until the rule is stopped and "\
6246 &branchruledata->config->maxnviolatedcons, TRUE, DEFAULT_MAXNVIOLATEDCONS, 0, INT_MAX, NULL, NULL) );
6248 "how many binary constraints that are violated by the base lp solution should be gathered until the rule is "\
6250 &branchruledata->config->maxnviolatedbincons, TRUE, DEFAULT_MAXNVIOLATEDBINCONS, 0, INT_MAX, NULL, NULL) );
6252 "how many domain reductions that are violated by the base lp solution should be gathered until the rule is "\
6254 &branchruledata->config->maxnviolateddomreds, TRUE, DEFAULT_MAXNVIOLATEDDOMREDS, 0, INT_MAX, NULL, NULL) );
6258 &branchruledata->config->reevalage, TRUE, DEFAULT_REEVALAGE, 0LL, SCIP_LONGINT_MAX, NULL, NULL) );
6262 &branchruledata->config->reevalagefsb, TRUE, DEFAULT_REEVALAGEFSB, 0LL, SCIP_LONGINT_MAX, NULL, NULL) );
6265 &branchruledata->config->recursiondepth, TRUE, DEFAULT_RECURSIONDEPTH, 1, INT_MAX, NULL, NULL) );
6273 &branchruledata->config->mergedomainreductions, TRUE, DEFAULT_MERGEDOMAINREDUCTIONS, NULL, NULL) );
6295 &branchruledata->config->maxndeepercands, TRUE, DEFAULT_MAXNDEEPERCANDS, 0, INT_MAX, NULL, NULL) );
6302 "if only non violating constraints are added, should the branching decision be stored till the next call?",
6339 &branchruledata->config->updatebranchingresults, TRUE, DEFAULT_UPDATEBRANCHINGRESULTS, NULL, NULL) );
6342 "maximum number of propagation rounds to perform at each temporary node (-1: unlimited, 0: SCIP default)",
6343 &branchruledata->config->maxproprounds, TRUE, DEFAULT_MAXPROPROUNDS, -1, INT_MAX, NULL, NULL) );
6347 &branchruledata->config->scoringfunction, TRUE, DEFAULT_SCORINGFUNCTION, "dfswplcra", NULL, NULL) );
6351 &branchruledata->config->deeperscoringfunction, TRUE, DEFAULT_DEEPERSCORINGFUNCTION, "dfswlcrx", NULL, NULL) );
6355 &branchruledata->config->scoringscoringfunction, TRUE, DEFAULT_SCORINGSCORINGFUNCTION, "dfswlcr", NULL, NULL) );
6358 "if scoringfunction is 's', this value is used to weight the min of the gains of two child problems in the convex combination",
6359 &branchruledata->config->minweight, TRUE, DEFAULT_MINWEIGHT, 0.0, SCIP_REAL_MAX, NULL, NULL) );
6362 "if the FSB score is of a candidate is worse than the best by this factor, skip this candidate (-1: disable)",
6363 &branchruledata->config->worsefactor, TRUE, DEFAULT_WORSEFACTOR, -1.0, SCIP_REAL_MAX, NULL, NULL) );
6366 "should lookahead branching only be applied if the max gain in level 1 is not uniquely that of the best candidate?",
static SCIP_RETCODE selectVarStart(SCIP *scip, CONFIGURATION *config, PERSISTENTDATA *persistent, STATUS *status, BRANCHINGDECISION *decision, SCORECONTAINER *scorecontainer, CANDIDATELIST *candidatelist)
Definition: branch_lookahead.c:5316
static SCIP_Bool isCandidateReliable(SCIP *scip, SCIP_VAR *branchvar)
Definition: branch_lookahead.c:4057
static SCIP_DECL_BRANCHFREE(branchFreeLookahead)
Definition: branch_lookahead.c:5838
static SCIP_Bool warmStartInfoIsAvailable(WARMSTARTINFO *warmstartinfo)
Definition: branch_lookahead.c:215
static void domainReductionsFree(SCIP *scip, DOMAINREDUCTIONS **domreds)
Definition: branch_lookahead.c:1762
static SCIP_RETCODE branchingDecisionEnsureBoundArraysSize(SCIP *scip, BRANCHINGDECISION *decision, int nvars)
Definition: branch_lookahead.c:540
static void binConsDataFree(SCIP *scip, BINCONSDATA **consdata)
Definition: branch_lookahead.c:1547
static void level2resultFree(SCIP *scip, LEVEL2RESULT **result)
Definition: branch_lookahead.c:772
static SCIP_RETCODE getOldBranching(SCIP *scip, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real *oldlpobjval)
Definition: branch_lookahead.c:3258
#define DEFAULT_UPDATEBRANCHINGRESULTS
Definition: branch_lookahead.c:119
static SCIP_RETCODE scoreContainerCreate(SCIP *scip, SCORECONTAINER **scorecontainer, CONFIGURATION *config)
Definition: branch_lookahead.c:1855
static SCIP_RETCODE applyDomainReductions(SCIP *scip, CONFIGURATION *config, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domreds, SCIP_Bool *domredcutoff, SCIP_Bool *domred)
Definition: branch_lookahead.c:2351
static SCIP_Real calculateScaledCutoffScore(BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult)
Definition: branch_lookahead.c:3694
static SCIP_DECL_BRANCHINIT(branchInitLookahead)
Definition: branch_lookahead.c:5857
static SCIP_RETCODE level2dataEnsureSize(SCIP *scip, LEVEL2DATA *data)
Definition: branch_lookahead.c:861
#define DEFAULT_DEEPERSCORINGFUNCTION
Definition: branch_lookahead.c:133
static SCIP_RETCODE executeBranching(SCIP *scip, CONFIGURATION *config, SCIP_Bool downbranching, CANDIDATE *candidate, BRANCHINGRESULTDATA *resultdata, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domreds, STATUS *status)
Definition: branch_lookahead.c:2703
static SCIP_RETCODE statusCreate(SCIP *scip, STATUS **status)
Definition: branch_lookahead.c:1796
static void addLowerBound(SCIP *scip, SCIP_VAR *var, SCIP_Real lowerbound, SCIP_SOL *baselpsol, SCIP_Bool simplechange, DOMAINREDUCTIONS *domainreductions)
Definition: branch_lookahead.c:2085
static SCIP_Real calculateScoreFromPseudocosts(SCIP *scip, CANDIDATE *lpcand)
Definition: branch_lookahead.c:3943
static void createBinaryConstraintName(SCIP_VAR **binaryvars, int nbinaryvars, char *constraintname)
Definition: branch_lookahead.c:2946
static SCIP_RETCODE executeBranchingRecursive(SCIP *scip, STATUS *status, CONFIGURATION *config, SCIP_SOL *baselpsol, CANDIDATE *candidate, SCIP_Real localbaselpsolval, SCIP_Real baselpobjval, int recursiondepth, DOMAINREDUCTIONS *domainreductions, BINCONSDATA *binconsdata, LEVEL2DATA *level2data, BRANCHINGRESULTDATA *branchingresult, SCORECONTAINER *scorecontainer, SCIP_Bool downbranching)
Definition: branch_lookahead.c:4358
static void binaryVarListDrop(BINARYVARLIST *list)
Definition: branch_lookahead.c:1491
static SCIP_Bool areBoundsChanged(SCIP *scip, SCIP_VAR *var, SCIP_Real lowerbound, SCIP_Real upperbound)
Definition: branch_lookahead.c:3178
static SCIP_Bool isBranchFurther(STATUS *status, SCIP_Bool checkdomreds)
Definition: branch_lookahead.c:3198
static SCIP_RETCODE branchingResultDataCreate(SCIP *scip, BRANCHINGRESULTDATA **resultdata)
Definition: branch_lookahead.c:608
static SCIP_RETCODE domainReductionsCreate(SCIP *scip, DOMAINREDUCTIONS **domreds)
Definition: branch_lookahead.c:1720
static SCIP_RETCODE copyCurrentSolution(SCIP *scip, SCIP_SOL **lpsol)
Definition: branch_lookahead.c:2526
static SCIP_DECL_BRANCHEXIT(branchExitLookahead)
Definition: branch_lookahead.c:5916
static SCIP_RETCODE warmStartInfoFree(SCIP *scip, WARMSTARTINFO **warmstartinfo)
Definition: branch_lookahead.c:224
static void branchingResultDataCopy(BRANCHINGRESULTDATA *sourcedata, BRANCHINGRESULTDATA *targetdata)
Definition: branch_lookahead.c:646
static SCIP_RETCODE applyBinaryConstraints(SCIP *scip, SCIP_NODE *basenode, CONSTRAINTLIST *conslist, CONFIGURATION *config, SCIP_Bool *consadded, SCIP_Bool *cutoff, SCIP_Bool *boundchange)
Definition: branch_lookahead.c:3049
static SCIP_RETCODE scoreContainerFree(SCIP *scip, SCORECONTAINER **scorecontainer)
Definition: branch_lookahead.c:2030
static SCIP_RETCODE constraintListCreate(SCIP *scip, CONSTRAINTLIST **conslist, int startsize)
Definition: branch_lookahead.c:1353
static SCIP_Real calculateScoreFromDeeperscoreAndCutoffs(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult)
Definition: branch_lookahead.c:3588
static void scoreContainterResetBestSortedCands(SCORECONTAINER *scorecontainer)
Definition: branch_lookahead.c:1844
static SCIP_Bool isUsePreviousResult(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch_lookahead.c:5651
static SCIP_DECL_BRANCHEXECLP(branchExeclpLookahead)
Definition: branch_lookahead.c:5970
static SCIP_RETCODE ensureScoresPresent(SCIP *scip, STATUS *status, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domainreductions, BINCONSDATA *binconsdata, CANDIDATELIST *allcandidates, BRANCHINGDECISION *decision, SCORECONTAINER *scorecontainer, LEVEL2DATA *level2data, SCIP_Real lpobjval)
Definition: branch_lookahead.c:4090
static SCIP_RETCODE candidateCreate(SCIP *scip, CANDIDATE **candidate)
Definition: branch_lookahead.c:265
static SCIP_RETCODE candidateListCreate(SCIP *scip, CANDIDATELIST **candidatelist, int ncandidates)
Definition: branch_lookahead.c:1571
static SCIP_Bool isBranchFurtherLoopDecrement(STATUS *status, int *loopcounter)
Definition: branch_lookahead.c:3212
static void binaryVarListAppend(SCIP *scip, BINARYVARLIST *list, SCIP_VAR *vartoadd)
Definition: branch_lookahead.c:1472
static SCIP_Bool level2resultEqual(LEVEL2RESULT *result1, LEVEL2RESULT *result2)
Definition: branch_lookahead.c:787
static SCIP_Real calculateScore(SCIP *scip, CONFIGURATION *config, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval, SCIP_Real baselpobjval)
Definition: branch_lookahead.c:3878
static SCIP_DECL_BRANCHCOPY(branchCopyLookahead)
Definition: branch_lookahead.c:5827
static SCIP_RETCODE usePreviousResult(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata, SCIP_RESULT *result)
Definition: branch_lookahead.c:5687
static SCIP_RETCODE level2resultCreateFromData(SCIP *scip, LEVEL2DATA *data, LEVEL2RESULT **result)
Definition: branch_lookahead.c:711
static SCIP_RETCODE candidateListKeep(SCIP *scip, CANDIDATELIST *candidatelist, int nindices)
Definition: branch_lookahead.c:1673
static SCIP_RETCODE filterCandidates(SCIP *scip, STATUS *status, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domainreductions, BINCONSDATA *binconsdata, CANDIDATELIST *candidatelist, BRANCHINGDECISION *decision, SCORECONTAINER *scorecontainer, LEVEL2DATA *level2data, SCIP_Real lpobjval)
Definition: branch_lookahead.c:4222
static SCIP_Real calculateScoreFromResult2(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3481
static SCIP_RETCODE initBranchruleData(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch_lookahead.c:5764
static int findInsertionPoint(SCIP *scip, SCORECONTAINER *scorecontainer, SCIP_Real scoretoinsert, CANDIDATE **candidates, int ncandidates)
Definition: branch_lookahead.c:1903
static SCIP_RETCODE candidateFree(SCIP *scip, CANDIDATE **candidate)
Definition: branch_lookahead.c:311
static SCIP_RETCODE candidateListGetAllFractionalCandidates(SCIP *scip, CANDIDATELIST **candidatelist)
Definition: branch_lookahead.c:1597
static SCIP_RETCODE selectVarRecursive(SCIP *scip, STATUS *status, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domainreductions, BINCONSDATA *binconsdata, CANDIDATELIST *candidatelist, BRANCHINGDECISION *decision, SCORECONTAINER *scorecontainer, LEVEL2DATA *level2data, int recursiondepth, SCIP_Real lpobjval, SCIP_Real baselpobjval, SCIP_Longint *niterations, int *ndeepestcutoffs, SCIP_Real *bestgain, SCIP_Real *totalgains, int *ntotalgains, int *ndeepestnodes)
Definition: branch_lookahead.c:4707
static void binaryVarListFree(SCIP *scip, BINARYVARLIST **list)
Definition: branch_lookahead.c:1505
static SCIP_RETCODE getNIterationsLastLP(SCIP *scip, SCIP_Longint *iterations)
Definition: branch_lookahead.c:2679
static SCIP_RETCODE binConsDataCreate(SCIP *scip, BINCONSDATA **consdata, int maxdepth, int nstartcons)
Definition: branch_lookahead.c:1526
static SCIP_RETCODE candidateStoreWarmStartInfo(SCIP *scip, CANDIDATE *candidate, SCIP_Bool down)
Definition: branch_lookahead.c:332
static SCIP_RETCODE branchOnVar(SCIP *scip, CONFIGURATION *config, BRANCHINGDECISION *decision)
Definition: branch_lookahead.c:2545
static SCIP_RETCODE level2dataCreate(SCIP *scip, LEVEL2DATA **data)
Definition: branch_lookahead.c:811
static void applyDeeperDomainReductions(SCIP *scip, SCIP_SOL *baselpsol, int maxstoredomreds, DOMAINREDUCTIONS *targetdomreds, DOMAINREDUCTIONS *downdomreds, DOMAINREDUCTIONS *updomreds)
Definition: branch_lookahead.c:2273
static void level2dataFree(SCIP *scip, LEVEL2DATA **data)
Definition: branch_lookahead.c:836
static SCIP_Bool isUseOldBranching(SCIP *scip, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_VAR *branchvar)
Definition: branch_lookahead.c:3232
static SCIP_DECL_BRANCHEXITSOL(branchExitSolLookahead)
Definition: branch_lookahead.c:5953
static void addUpperBound(SCIP *scip, SCIP_VAR *var, SCIP_Real upperbound, SCIP_SOL *baselpsol, SCIP_Bool simplechange, DOMAINREDUCTIONS *domainreductions)
Definition: branch_lookahead.c:2150
static SCIP_RETCODE freePersistent(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch_lookahead.c:5717
static void branchingDecisionFree(SCIP *scip, BRANCHINGDECISION **decision)
Definition: branch_lookahead.c:563
static SCIP_RETCODE level2dataGetResult(SCIP *scip, LEVEL2DATA *data, LEVEL2RESULT **result)
Definition: branch_lookahead.c:882
static SCIP_RETCODE candidateFreeWarmStartInfo(SCIP *scip, CANDIDATE *candidate)
Definition: branch_lookahead.c:284
static SCIP_Real calculateScoreFromDeeperscore(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult)
Definition: branch_lookahead.c:3551
static void branchingDecisionCopy(BRANCHINGDECISION *sourcedecision, BRANCHINGDECISION *targetdecision)
Definition: branch_lookahead.c:501
SCIP_RETCODE SCIPincludeBranchruleLookahead(SCIP *scip)
Definition: branch_lookahead.c:6205
static SCIP_RETCODE scoreContainerSetScore(SCIP *scip, SCORECONTAINER *scorecontainer, CANDIDATE *cand, SCIP_Real score, SCIP_Real downgain, SCIP_Real upgain)
Definition: branch_lookahead.c:1973
static void constraintListFree(SCIP *scip, CONSTRAINTLIST **conslist)
Definition: branch_lookahead.c:1413
static SCIP_RETCODE addBinaryConstraint(SCIP *scip, CONFIGURATION *config, BINCONSDATA *binconsdata, SCIP_SOL *baselpsol)
Definition: branch_lookahead.c:2979
static SCIP_RETCODE candidateListFree(SCIP *scip, CANDIDATELIST **candidatelist)
Definition: branch_lookahead.c:1642
static SCIP_Real calculateWeightedCutoffScore(CONFIGURATION *config, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult)
Definition: branch_lookahead.c:3726
static SCIP_RETCODE warmStartInfoCreate(SCIP *scip, WARMSTARTINFO **warmstartinfo)
Definition: branch_lookahead.c:195
static SCIP_Bool isStoreDecision(CONFIGURATION *config, BINCONSDATA *binconsdata, DOMAINREDUCTIONS *domainreductions)
Definition: branch_lookahead.c:5290
static void applySingleDeeperDomainReductions(SCIP *scip, SCIP_SOL *baselpsol, int maxstoredomreds, DOMAINREDUCTIONS *targetdomreds, DOMAINREDUCTIONS *domreds)
Definition: branch_lookahead.c:2219
static CANDIDATE * scoreContainerUpdateSortOrder(SCORECONTAINER *scorecontainer, CANDIDATE *candidate, int insertpoint)
Definition: branch_lookahead.c:1948
static SCIP_RETCODE constraintListAppend(SCIP *scip, CONSTRAINTLIST *list, SCIP_VAR **consvars, int nconsvars, SCIP_Bool violated)
Definition: branch_lookahead.c:1378
static SCIP_RETCODE binaryVarListCreate(SCIP *scip, BINARYVARLIST **list, int startsize)
Definition: branch_lookahead.c:1450
static SCIP_RETCODE createBinaryConstraint(SCIP *scip, CONFIGURATION *config, SCIP_CONS **constraint, char *constraintname, SCIP_VAR **consvars, int nconsvars)
Definition: branch_lookahead.c:2903
static SCIP_Bool candidateHasWarmStartInfo(CANDIDATE *candidate, SCIP_Bool down)
Definition: branch_lookahead.c:380
#define DEFAULT_SCORINGSCORINGFUNCTION
Definition: branch_lookahead.c:134
static void branchingResultDataFree(SCIP *scip, BRANCHINGRESULTDATA **resultdata)
Definition: branch_lookahead.c:669
static SCIP_RETCODE updateOldBranching(SCIP *scip, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_VAR *branchvar, SCIP_Real branchval, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3311
static SCIP_Bool isCurrentNodeCutoff(SCIP *scip)
Definition: branch_lookahead.c:4079
static SCIP_RETCODE level2dataStoreResult(SCIP *scip, LEVEL2DATA *data, SCIP_Real lpobjval, SCIP_Bool cutoff, SCIP_Bool valid, SCIP_Bool *duplicate)
Definition: branch_lookahead.c:922
static SCIP_Real calculateWeightedGain(SCIP *scip, CONFIGURATION *config, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3644
static void branchingResultDataInit(SCIP *scip, BRANCHINGRESULTDATA *resultdata)
Definition: branch_lookahead.c:623
static SCIP_Real calculateRelCutoffScore(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3814
static SCIP_Real calculateCutoffScore(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3755
static void sortFirstCandidatesByScore(SCIP *scip, CANDIDATELIST *candidatelist, SCORECONTAINER *scorecontainer, int nbestcandidates)
Definition: branch_lookahead.c:3992
static SCIP_RETCODE branchingDecisionCreate(SCIP *scip, BRANCHINGDECISION **decision)
Definition: branch_lookahead.c:478
static SCIP_Real calculateScoreFromResult(SCIP *scip, SCIP_VAR *branchvar, BRANCHINGRESULTDATA *downbranchingresult, BRANCHINGRESULTDATA *upbranchingresult, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3437
static SCIP_RETCODE getFSBResult(SCIP *scip, STATUS *status, PERSISTENTDATA *persistent, CONFIGURATION *config, SCIP_SOL *baselpsol, DOMAINREDUCTIONS *domainreductions, BINCONSDATA *binconsdata, CANDIDATELIST *candidatelist, BRANCHINGDECISION *decision, SCORECONTAINER *scorecontainer, LEVEL2DATA *level2data, SCIP_Real lpobjval)
Definition: branch_lookahead.c:3352
static SCIP_Bool branchingDecisionIsValid(BRANCHINGDECISION *decision)
Definition: branch_lookahead.c:528
static void branchingDecisionInit(SCIP *scip, BRANCHINGDECISION *decision)
Definition: branch_lookahead.c:451
static SCIP_RETCODE candidateLoadWarmStartInfo(SCIP *scip, CANDIDATE *candidate, SCIP_Bool down)
Definition: branch_lookahead.c:393
lookahead LP branching rule
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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)
Definition: cons_logicor.c:5415
SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
Definition: lpi_clp.cpp:3623
SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
Definition: lpi_clp.cpp:3592
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
Definition: lpi_clp.cpp:3503
SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations)
Definition: lpi_clp.cpp:2921
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
Definition: lpi_clp.cpp:3389
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip_prob.c:3762
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip_prob.c:3697
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip_prob.c:3324
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:208
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:225
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip_param.c:250
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)
Definition: scip_param.c:111
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:167
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)
Definition: scip_param.c:83
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)
Definition: scip_param.c:139
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)
Definition: scip_param.c:57
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: scip_branch.c:201
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: scip_branch.c:249
SCIP_RETCODE SCIPsetBranchruleCopy(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: scip_branch.c:153
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
Definition: scip_branch.c:116
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1971
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1849
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip_branch.c:169
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: scip_branch.c:233
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip_branch.c:185
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
Definition: branch.c:1859
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip_branch.c:1126
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip_branch.c:395
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip_branch.c:849
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip_cons.c:2537
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1174
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip_mem.h:126
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
Definition: scip_mem.h:99
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:105
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_probing.c:345
SCIP_RETCODE SCIPsetProbingLPState(SCIP *scip, SCIP_LPISTATE **lpistate, SCIP_LPINORMS **lpinorms, SCIP_Bool primalfeas, SCIP_Bool dualfeas)
Definition: scip_probing.c:877
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_probing.c:301
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip_probing.c:580
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip_probing.c:225
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_probing.c:820
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:222
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip_sol.c:1213
SCIP_Longint SCIPgetNNodeZeroIterationLPs(SCIP *scip)
Definition: scip_solvingstats.c:767
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
Definition: scip_solvingstats.c:785
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:497
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:1195
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:471
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:793
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:881
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:484
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:819
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:445
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:458
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:705
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5326
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip_var.c:7044
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip_var.c:9073
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:5013
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5443
SCIP_Longint SCIPgetVarStrongbranchNode(SCIP *scip, SCIP_VAR *var)
Definition: scip_var.c:4283
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
Definition: scip_var.c:4768
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
Definition: scip_var.c:4317
SCIP_RETCODE SCIPsetVarStrongbranchData(SCIP *scip, SCIP_VAR *var, SCIP_Real lpobjval, SCIP_Real primsol, SCIP_Real down, SCIP_Real up, SCIP_Bool downvalid, SCIP_Bool upvalid, SCIP_Longint iter, int itlim)
Definition: scip_var.c:4167
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip_var.c:8937
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
Definition: scip_var.c:4736
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
Definition: scip_var.c:1527
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: scip_var.c:8903
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_var.c:4969
SCIP_RETCODE SCIPtryStrongbranchLPSol(SCIP *scip, SCIP_Bool *foundsol, SCIP_Bool *cutoff)
Definition: scip_var.c:4202
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)
Definition: scip_var.c:4133
SCIP_Bool SCIPisStrongbranchDownFirst(SCIP *scip, SCIP_VAR *var)
Definition: scip_var.c:2655
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip_var.c:2686
interface methods for specific LP solvers
memory allocation routines
Definition: objbenders.h:44
public methods for branching rules
public methods for message output
public data structures and miscellaneous methods
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
general public methods
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 solutions
public methods for querying solving statistics
public methods for the branch-and-bound tree
public methods for SCIP variables
Definition: branch_lookahead.c:1441
Definition: branch_lookahead.c:1519
Definition: branch_lookahead.c:428
Definition: branch_lookahead.c:589
Definition: branch_lookahead.c:1562
Definition: branch_lookahead.c:255
Definition: branch_lookahead.c:996
SCIP_Bool mergedomainreductions
Definition: branch_lookahead.c:1013
SCIP_Bool updatebranchingresults
Definition: branch_lookahead.c:1035
Definition: branch_lookahead.c:1341
Definition: branch_lookahead.c:1703
Definition: branch_lookahead.c:697
Definition: branch_lookahead.c:682
Definition: branch_lookahead.c:977
SCIP_Longint oldnnodelpiterations
Definition: branch_lookahead.c:980
BRANCHINGRESULTDATA ** lastbranchdownres
Definition: branch_lookahead.c:989
BRANCHINGRESULTDATA ** lastbranchupres
Definition: branch_lookahead.c:988
Definition: struct_branch.h:79
Definition: struct_cons.h:47
Definition: lpi_cpx.c:199
Definition: lpi_clp.cpp:133
Definition: lpi_clp.cpp:105
Definition: struct_tree.h:142
Definition: struct_sol.h:74
Definition: struct_var.h:208
Definition: branch_lookahead.c:1832
Definition: branch_lookahead.c:1782
Definition: struct_scip.h:70
Definition: branch_lookahead.c:186