prop_rootredcost.c
Go to the documentation of this file.
31 * This propagator uses the root reduced cost to (globally) propagate against the cutoff bound. The propagator checks if
32 * the variables with non-zero root reduced cost can exceed the cutoff bound. If this is the case the corresponding
35 * The propagate is performed during the search any time a new cutoff bound (primal solution) is found.
37 * @todo do not sort the variables; just store the cutoff bound which leads to a fixing. If that appears loop over all
39 * @todo resolve the root LP in case of repropagation and update root reduced costs use root LP counter to check if new
43 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
71 #define PROP_DESC "reduced cost strengthening using root node reduced costs and the cutoff bound"
75 #define PROP_DELAY FALSE /**< should propagation method be delayed, if other propagators found reductions? */
84 #define DEFAULT_FORCE FALSE /**< should the propagator be forced even if active pricer are present? Note that
100 SCIP_Real lastcutoffbound; /**< cutoff bound for which the root reduced costs were already processed */
120 {
168 )
210 )
233 )
256 SCIPdebugMsg(scip, "There are %d (poor) binary variables with non-zero root reduced cost <%s>.\n", nredcostbinvars, SCIPgetProbName(scip));
271 SCIPdebugMsg(scip, "Store non-zero root reduced cost variables at address <%p>.\n", (void*)propdata->redcostvars);
309 /* sort binary variables with respect to their cutoff bound which would lead to an fixing; this order can be used
316 SCIPdebugMsg(scip, "variables with non-zero redcostective coefficient: %d binaries, %d non-binaries\n", nredcostbinvars, nredcostvars - nredcostbinvars);
346 /* SCIPisLPDualReliable should always return TRUE if the dual feasibility check is enabled and the LP claims to
347 * have a dual feasible solution. if the check is disabled the dual solution might be incorrect and the assert
348 * might fail. however, if the user decides to disable the dual feasibility check (which also can lead to wrong
361 assert(SCIPisFeasLE(scip, rootsol, SCIPvarGetLbGlobal(var))); /* lb might have been increased in the meantime */
369 assert(SCIPisFeasGE(scip, rootsol, SCIPvarGetUbGlobal(var))); /* ub might have been decreased in the meantime */
393 /* the binary variables are stored in the beginning of the variable array; these variables are sorted w.r.t. cutoff
402 * @note In case the assertion fails it indicates that a new LP root solving arose after we initialized the
403 * propagator; The new LP solution destroyed the sorting of the binary variables since the reduced cost of the
404 * variables changed. This could lead to potentially missing a domain reductions. Currently, it is not possible to
405 * check if a new root LP was solved, changing the root reduced costs. This case, however, should not happen in the
432 /* check if the variables is already globally fixed; if so continue with the next potential candidate */
441 /* @note The variable might not be globally fixed right away since this would destroy the local internal data
442 * structure of a search node; the bound change is in that case pending; hence we cannot assert that the
447 SCIPdebugMsg(scip, "globally fixed binary variable <%s> [%g,%g] bestroot sol <%g>, redcost <%g>, lpobj <%g>\n",
457 /* The binary variables are sorted in non-increasing manner w.r.t. their cutoff bound which would lead to a
458 * global fixing; That is, abs(rootredcost) + rootlpobjval. Depending on the sign of the reduced cost the
461 * - redcost > 0 --> newub = 0.0 + (cutoffbound - lpobjval) / redcost --> newub = 0 <=> cutoffbound < redcost + lpobjval = sorting key
462 * - redcost < 0 --> newlb = 1.0 + (cutoffbound - lpobjval) / redcost --> newlb = 1 <=> cutoffbound < -redcost + lpobjval = sorting key
464 * Due to the order of the binary variables it follows if one binary variable cannot be fixed anymore all the
465 * remaining once can also not be fixed since these have only an smaller or equal cutoff bound which would lead
468 * Note that variables with non-zero reduced cost are sitting at one of their bound. That is the lower one if
469 * the reduced cost are positive and the upper bound if the reduced cost are negative. For binary variables
472 SCIPdebugMsg(scip, "interrupt propagation for binary variables after %d from %d binary variables\n",
477 SCIPdebugMsg(scip, "detected cutoff: binary variable <%s> [%g,%g], redcost <%g>, rootsol <%g>, rootlpobjval <%g>\n",
488 #if 0 /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may
489 * have evaluated variables with a really small difference in their reduced cost values but with really huge
493 /* check that the abort criteria works; that means none of the remaining binary variables can be fixed */
502 /* check if the variables is already globally fixed; if so continue with the potential candidate */
556 /** solving process deinitialization method of propagator (called before branch and bound process data is freed) */
594 /* the propagator should run in all nodes except the root node; for the root node the redcost propagator does
624 /* reduced cost strengthening can only be applied, if we have a finite upper bound on the LP value */
643 /* store cutoff bound to remember later that for that particular cutoff bound the propagation was already
681 /* we are done with solving since the cutoff is w.r.t. a global bound change; cutoff root node */
700 {
708 SCIP_CALL( SCIPincludePropBasic(scip, &prop, PROP_NAME, PROP_DESC, PROP_PRIORITY, PROP_FREQ, PROP_DELAY, PROP_TIMING,
Definition: type_result.h:42
public methods for SCIP parameter handling
Definition: struct_scip.h:69
public methods for memory management
static SCIP_DECL_PROPEXITSOL(propExitsolRootredcost)
Definition: prop_rootredcost.c:561
static int countNonZeroRootRedcostVars(SCIP *scip, SCIP_VAR **vars, int nvars)
Definition: prop_rootredcost.c:182
reduced cost strengthening using root node reduced costs and the cutoff bound
Definition: struct_var.h:207
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:832
static SCIP_RETCODE propdataInit(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_rootredcost.c:233
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:1018
public methods for problem variables
public methods for SCIP variables
public methods for numerical tolerances
public methods for querying solving statistics
public methods for the branch-and-bound tree
SCIP_Real SCIPvarGetBestRootLPObjval(SCIP_VAR *var)
Definition: var.c:13817
Definition: type_result.h:44
SCIP_RETCODE SCIPincludePropRootredcost(SCIP *scip)
Definition: prop_rootredcost.c:700
void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPtightenVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:6227
Definition: type_retcode.h:42
static SCIP_RETCODE propdataExit(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_rootredcost.c:210
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:806
Definition: type_result.h:51
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:1042
static SCIP_RETCODE propagateBinaryBestRootRedcost(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Real cutoffbound, int *nchgbds, SCIP_Bool *cutoff)
Definition: prop_rootredcost.c:383
Definition: struct_prop.h:46
static SCIP_RETCODE propagateRootRedcostVar(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffbound, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: prop_rootredcost.c:333
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip_prop.c:151
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip_prop.c:231
public methods for the LP relaxation, rows and columns
public methods for variable pricer plugins
methods for sorting joint arrays of various types
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:1030
general public methods
public methods for the probing mode
public methods for message output
public methods for message handling
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip_prop.c:167
public methods for propagator plugins
Definition: type_set.h:53
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:111
SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:6347
static SCIP_RETCODE propdataCreate(SCIP *scip, SCIP_PROPDATA **propdata)
Definition: prop_rootredcost.c:168
Definition: objbenders.h:43
public methods for global and local (sub)problems
Definition: type_result.h:48
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
public methods for propagators
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_prop.c:114