|
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
prop_obbt.c
Go to the documentation of this file.
22 /**@todo if bound tightenings of other propagators are the reason for lpsolstat != SCIP_LPSOLSTAT_OPTIMAL, resolve LP */
23 /**@todo only run more than once in root node if primal bound improved or many cuts were added to the LP */
24 /**@todo filter bounds of a variable already if SCIPisLbBetter()/SCIPisUbBetter() would return FALSE */
30 /**@todo implement conflict resolving callback by calling public method of genvbounds propagator, since the reason are
31 * exactly the variable bounds with nonnegative reduced costs stored in the right-hand side of the generated
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
51 #define DEFAULT_CREATE_GENVBOUNDS TRUE /**< should obbt try to provide genvbounds if possible? */
52 #define DEFAULT_FILTERING_NORM TRUE /**< should coefficients in filtering be normalized w.r.t. the
54 #define DEFAULT_APPLY_FILTERROUNDS FALSE /**< try to filter bounds in so-called filter rounds by solving
56 #define DEFAULT_DUALFEASTOL 1e-9 /**< feasibility tolerance for reduced costs used in obbt; this value
58 #define DEFAULT_CONDITIONLIMIT -1.0 /**< maximum condition limit used in LP solver (-1.0: no limit) */
61 #define DEFAULT_ITLIMITFACTOR 5.0 /**< multiple of root node LP iterations used as total LP iteration
88 {
91 };
96 {
149 SCIPwarningMessage(scip, " error while solving LP in obbt propagator; LP solve terminated with code <%d>\n", retcode);
150 SCIPwarningMessage(scip, " this does not affect the remaining solution procedure --> continue\n");
224 /* create objective cutoff row; set local flag to FALSE since primal cutoff is globally valid */
226 SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, &row, rowname, -SCIPinfinity(scip), SCIPgetCutoffbound(scip), FALSE, FALSE, FALSE) );
258 SCIP_Longint nolditerations, /**< iterations count at the beginning of the corresponding function */
284 /** returns the objective coefficient for a variable's bound that will be chosen during filtering */
348 SCIPdebugMessage("can't filter using existing lp solution since it was not solved to optimality\n");
368 /* bound is tight; since this holds for all fixed variables, those are filtered here automatically */
495 * 1.) Try first to filter lower bounds of interesting variables, whose bounds are not already filtered
524 * 2.) Now try to filter the remaining upper bounds of interesting variables, whose bounds are not already filtered
685 * where z is the current cutoff bound. Let (mu, nu, gamma, alpha, beta) >= 0 be the optimal solution of the dual of
706 * that holds for all primal feasible points with objective value at least cutoff_bound. Therefore, the latter
779 /* we need at least one nonzero coefficient or a nonzero dual multiplier for the objective cutoff */
827 SCIP_CALL( SCIPgenVBoundAdd(scip, propdata->genvboundprop, genvboundvars, xi, genvboundcoefs, ncoefs,
893 for( obbtround = 1; boundsleft && (propdata->maxlookahead == -1 || obbtround <= propdata->maxlookahead)
936 SCIP_CALL( SCIPchgVarObjDive(scip, var, (bound->boundtype == SCIP_BOUNDTYPE_LOWER) ? 1.0 : -1.0 ) );
1053 hasconditionlimit = (SCIPgetRealParam(scip, "lp/conditionlimit", &oldconditionlimit) == SCIP_OKAY);
1056 SCIPwarningMessage(scip, "obbt propagator could not set condition limit in LP solver - running without\n");
1058 else if( propdata->conditionlimit > 0.0 && (oldconditionlimit < 0.0 || propdata->conditionlimit < oldconditionlimit) )
1123 score = (unsigned int) ( nlcount > 0 ? (OBBT_SCOREBASE * nlcount * ( OBBT_SCOREBASE - 1 )) / maxnlcount : 0 );
1185 SCIPdebugPrintf(" %s bound of <%s>, scoreval=%u\n", bound->boundtype == SCIP_BOUNDTYPE_LOWER ? "lower" : "upper",
1327 propdata->bounds[bdidx]->score = getScore(scip, propdata->bounds[bdidx], nlcount[i], maxnlcount);
1338 propdata->bounds[bdidx]->score = getScore(scip, propdata->bounds[bdidx], nlcount[i], maxnlcount);
1381 /** solving process initialization method of propagator (called when branch and bound process is about to begin) */
1403 propdata->genvboundprop = propdata->creategenvbounds ? SCIPfindProp(scip, GENVBOUND_PROP_NAME) : NULL;
1405 SCIPdebugMessage("creating genvbounds: %s\n", propdata->genvboundprop != NULL ? "true" : "false");
1423 if( SCIPgetStage(scip) != SCIP_STAGE_SOLVING || SCIPinRepropagation(scip) || SCIPinProbing(scip) )
1433 /* only run if LP all columns are in the LP, i.e., the LP is a relaxation; e.g., do not run if pricers are active
1471 if( SCIPgetDepth(scip) > 0 && SCIPnodeGetNumber(SCIPgetCurrentNode(scip)) == propdata->lastnode )
1476 SCIPdebugMessage("applying obbt for problem <%s> at depth %d\n", SCIPgetProbName(scip), SCIPgetDepth(scip));
1478 /* without an optimal LP solution we don't want to run; this may be because propagators with higher priority have
1481 if( SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL && SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_UNBOUNDEDRAY )
1507 /** solving process deinitialization method of propagator (called before branch and bound process data is freed) */
1581 SCIP_CALL( SCIPincludePropBasic(scip, &prop, PROP_NAME, PROP_DESC, PROP_PRIORITY, PROP_FREQ, PROP_DELAY, PROP_TIMING,
1610 "multiple of root node LP iterations used as total LP iteration limit for obbt (<= 0: no limit )",
1611 &propdata->itlimitfactor, FALSE, DEFAULT_ITLIMITFACTOR, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1614 "feasibility tolerance for reduced costs used in obbt; this value is used if SCIP's dual feastol is greater",
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol))) Definition: scip.c:6747 Definition: type_result.h:33 SCIP_RETCODE SCIPgenVBoundAdd(SCIP *scip, SCIP_PROP *genvboundprop, SCIP_VAR **vars, SCIP_VAR *var, SCIP_Real *coefs, int ncoefs, SCIP_Real coefcutoffbound, SCIP_Real constant, SCIP_BOUNDTYPE boundtype) Definition: prop_genvbounds.c:1788 Definition: type_lp.h:39 Definition: struct_scip.h:52 void SCIPwarningMessage(SCIP *scip, const char *formatstr,...) Definition: scip.c:1206 Definition: struct_var.h:196 SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound) Definition: scip.c:29095 static SCIP_RETCODE findNewBounds(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Longint itlimit) Definition: prop_obbt.c:857 Definition: type_var.h:53 static SCIP_Real getFilterCoef(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype) Definition: prop_obbt.c:293 SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value) Definition: scip.c:3914 Definition: type_lp.h:37 SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub) Definition: scip.c:39054 SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound) Definition: scip.c:29063 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:3388 SCIP_RETCODE SCIPcreateEmptyRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable) Definition: scip.c:25334 static unsigned int getScore(SCIP *scip, BOUND *bound, int nlcount, int maxnlcount) Definition: prop_obbt.c:1115 SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol) Definition: scip.c:37848 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.c:3414 static SCIP_RETCODE filterExistingLP(SCIP *scip, SCIP_PROPDATA *propdata, int *nfiltered) Definition: prop_obbt.c:338 static SCIP_RETCODE applyBoundChgs(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_RESULT *result) Definition: prop_obbt.c:564 Definition: type_lp.h:40 Definition: type_result.h:35 Definition: prop_obbt.c:82 SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj) Definition: scip.c:29022 void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len) Definition: type_lp.h:47 SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38648 Definition: type_retcode.h:33 static SCIP_Bool varIsInteresting(SCIP *scip, SCIP_VAR *var, int nlcount) Definition: prop_obbt.c:1263 Definition: type_result.h:42 static int getIterationsLeft(SCIP *scip, SCIP_Longint nolditerations, SCIP_Longint itlimit) Definition: prop_obbt.c:263 Definition: type_lp.h:34 Definition: struct_prop.h:36 static SCIP_RETCODE filterRound(SCIP *scip, SCIP_PROPDATA *propdata, int itlimit, int *nfiltered) Definition: prop_obbt.c:392 SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:18371 SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop))) Definition: scip.c:6830 static SCIP_RETCODE createGenVBound(SCIP *scip, SCIP_PROPDATA *propdata, BOUND *bound) Definition: prop_obbt.c:717 SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree))) Definition: scip.c:6683 Definition: type_var.h:55 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:6630 Definition: type_var.h:54 optimization-based bound tightening propagator SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row) Definition: scip.c:25487 Definition: struct_lp.h:188 methods for debugging Definition: prop_obbt.c:94 SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol))) Definition: scip.c:6731 Definition: type_lp.h:36 static SCIP_RETCODE solveLP(SCIP *scip, int itlimit, SCIP_Bool *error, SCIP_Bool *optimal) Definition: prop_obbt.c:132 SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row) Definition: scip.c:25510 Definition: type_lp.h:48 SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38686 SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount) Definition: scip.c:26194 SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened) Definition: scip.c:18477 SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38724 static SCIP_RETCODE filterBounds(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Longint itlimit) Definition: prop_obbt.c:475 static SCIP_RETCODE addObjCutoff(SCIP *scip, SCIP_PROPDATA *propdata) Definition: prop_obbt.c:203 static SCIP_Bool varIsFixedLocal(SCIP *scip, SCIP_VAR *var) Definition: prop_obbt.c:253 Definition: type_set.h:42 Definition: type_lp.h:35 static SCIP_RETCODE tightenBoundDive(SCIP *scip, BOUND *bound, SCIP_Real newval, SCIP_Bool *tightened) Definition: prop_obbt.c:627 SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars) Definition: scip.c:9945 SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value) Definition: scip.c:3638 Definition: type_lp.h:33 Definition: type_lp.h:38 static SCIP_RETCODE initBounds(SCIP *scip, SCIP_PROPDATA *propdata) Definition: prop_obbt.c:1276 SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff) Definition: scip.c:29322 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.c:3470 SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val) Definition: scip.c:25540 static SCIP_RETCODE applyObbt(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Longint itlimit, SCIP_RESULT *result) Definition: prop_obbt.c:1016 Definition: type_result.h:39 SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub) Definition: scip.c:39067 generalized variable bounds propagator Definition: type_var.h:56 |