prop_rootredcost.c
Go to the documentation of this file.
21 * This propagator uses the root reduced cost to (globally) propagate against the cutoff bound. The propagator checks if 22 * the variables with non-zero root reduced cost can exceed the cutoff bound. If this is the case the corresponding 25 * The propagate is performed during the search any time a new cutoff bound (primal solution) is found. 27 * @todo do not sort the variables; just store the cutoff bound which leads to a fixing. If that appears loop over all 29 * @todo resolve the root LP in case of repropagation and update root reduced costs use root LP counter to check if new 33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 46 #define PROP_DESC "reduced cost strengthening using root node reduced costs and the cutoff bound" 50 #define PROP_DELAY FALSE /**< should propagation method be delayed, if other propagators found reductions? */ 59 #define DEFAULT_FORCE FALSE /**< should the propagator be forced even if active pricer are present? Note that 75 SCIP_Real lastcutoffbound; /**< cutoff bound for which the root reduced costs were already processed */ 95 ) 144 ) 186 ) 209 ) 232 SCIPdebugMessage("There are %d (poor) binary variables with non-zero root reduced cost <%s>.\n", nredcostbinvars, SCIPgetProbName(scip)); 247 SCIPdebugMessage("Store non-zero root reduced cost variables at address <%p>.\n", (void*)propdata->redcostvars); 285 /* sort binary variables with respect to their cutoff bound which would lead to an fixing; this order can be used 292 SCIPdebugMessage("variables with non-zero redcostective coefficient: %d binaries, %d non-binaries\n", nredcostbinvars, nredcostvars - nredcostbinvars); 331 assert(SCIPisFeasLE(scip, rootsol, SCIPvarGetLbGlobal(var))); /* lb might have been increased in the meantime */ 339 assert(SCIPisFeasGE(scip, rootsol, SCIPvarGetUbGlobal(var))); /* ub might have been decreased in the meantime */ 363 /* the binary variables are stored in the beginning of the variable array; these variables are sorted w.r.t. cutoff 372 * @note In case the assertion fails it indicates that a new LP root solving arose after we initialized the 373 * propagator; The new LP solution destroyed the sorting of the binary variables since the reduced cost of the 374 * variables changed. This could lead to potentially miss a domain reductions. Currently, it is not possible to 375 * check if a new LP root changing the root reduced costs. This case, however, should not happen in the current 402 /* check if the variables is already globally fixed; if so continue with the next potential candidate */ 411 /* @note The variable might not be globally fixed right away since this would destroy the local internal data 412 * structure of a search node; the bound change is in that case pending; hence we cannot assert that the 417 SCIPdebugMessage("globally fixed binary variable <%s> [%g,%g] bestroot sol <%g>, redcost <%g>, lpobj <%g>\n", 427 /* The binary variables are sorted in non-increasing manner w.r.t. their cutoff bound which would lead to a 428 * global fixing; That is, abs(rootredcost) + rootlpobjval. Depending on the sign of the reduced cost the 431 * - redcost > 0 --> newub = 0.0 + (cutoffbound - lpobjval) / redcost --> newub = 0 <=> cutoffbound < redcost + lpobjval = sorting key 432 * - redcost < 0 --> newlb = 1.0 + (cutoffbound - lpobjval) / redcost --> newlb = 1 <=> cutoffbound < -redcost + lpobjval = sorting key 434 * Due to the order of the binary variables it follows if one binary variable cannot be fixed anymore all the 435 * remaining once can also not be fixed since these have only an smaller or equal cutoff bound which would lead 438 * Note that variables with non-zero reduced cost are sitting at one of their bound. That is the lower one if 439 * the reduced cost are positive and the upper bound if the reduced cost are negative. For binary variables 442 SCIPdebugMessage("interrupt propagation for binary variables after %d from %d binary variables\n", 447 SCIPdebugMessage("detected cutoff: binary variable <%s> [%g,%g], redcost <%g>, rootsol <%g>, rootlpobjval <%g>\n", 458 #if 0 /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may 459 * have evaluated variables with a really small difference in their reduced cost values but with really huge 463 /* check that the abort criteria works; that means none of the remaining binary variables can be fixed */ 472 /* check if the variables is already globally fixed; if so continue with the potential candidate */ 526 /** solving process deinitialization method of propagator (called before branch and bound process data is freed) */ 564 /* the propagator should run in all nodes except the root node; for the root node the poor redcost propagator does 594 /* reduced cost strengthening can only be applied, if we have a finite upper bound on the LP value */ 613 /* store cutoff bound to remember later that for that particular cutoff bound the propagation was already 651 /* we are done with solving since the cutoff is w.r.t. a global bound change; cutoff root node */ 674 { 682 SCIP_CALL( SCIPincludePropBasic(scip, &prop, PROP_NAME, PROP_DESC, PROP_PRIORITY, PROP_FREQ, PROP_DELAY, PROP_TIMING, SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol))) Definition: scip.c:7025 Definition: type_result.h:33 Definition: struct_scip.h:53 static SCIP_DECL_PROPEXITSOL(propExitsolRootredcost) Definition: prop_rootredcost.c:531 SCIP_Real SCIPvarGetBestRootLPObjval(SCIP_VAR *var) Definition: var.c:13070 static int countNonZeroRootRedcostVars(SCIP *scip, SCIP_VAR **vars, int nvars) Definition: prop_rootredcost.c:158 reduced cost strengthening using root node reduced costs and the cutoff bound Definition: struct_var.h:196 static SCIP_RETCODE propdataInit(SCIP *scip, SCIP_PROPDATA *propdata) Definition: prop_rootredcost.c:209 SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy))) Definition: scip.c:6945 SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val) Definition: scip.c:42157 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.c:3547 Definition: type_result.h:35 void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len) SCIP_RETCODE SCIPincludePropRootredcost(SCIP *scip) Definition: prop_rootredcost.c:674 Definition: type_retcode.h:33 static SCIP_RETCODE propdataExit(SCIP *scip, SCIP_PROPDATA *propdata) Definition: prop_rootredcost.c:186 Definition: type_result.h:42 static SCIP_RETCODE propagateBinaryBestRootRedcost(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Real cutoffbound, int *nchgbds, SCIP_Bool *cutoff) Definition: prop_rootredcost.c:353 Definition: struct_prop.h:36 static SCIP_RETCODE propagateRootRedcostVar(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffbound, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: prop_rootredcost.c:309 SCIP_RETCODE SCIPtightenVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:21150 SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree))) Definition: scip.c:6961 SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata) Definition: scip.c:6908 SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val) Definition: scip.c:42169 static void propdataReset(SCIP *scip, SCIP_PROPDATA *propdata) Definition: prop_rootredcost.c:95 SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41933 SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:21260 SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:41959 Definition: type_set.h:42 static SCIP_RETCODE propdataCreate(SCIP *scip, SCIP_PROPDATA **propdata) Definition: prop_rootredcost.c:144 Definition: objbranchrule.h:33 Definition: type_result.h:39 |