heur_gcgrounding.c
Go to the documentation of this file.
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
54 #define DEFAULT_SUCCESSFACTOR 100 /**< number of calls per found solution that are considered as standard success,
64 int successfactor; /**< number of calls per found solution that are considered as standard success,
204 /** returns a variable, that pushes activity of the row in the given direction with minimal negative impact on other rows;
205 * if variables have equal impact, chooses the one with best objective value improvement in corresponding direction;
212 SCIP_Real minobj, /**< minimal objective value possible after rounding remaining fractional vars */
216 SCIP_Real* oldsolval, /**< pointer to store old (fractional) solution value of rounding variable */
276 if( (nlocks < minnlocks || deltaobj < bestdeltaobj) && minobj - obj < SCIPgetCutoffbound(scip) )
295 if( (nlocks < minnlocks || deltaobj < bestdeltaobj) && minobj + obj < SCIPgetCutoffbound(scip) )
317 SCIP_Real minobj, /**< minimal objective value possible after rounding remaining fractional vars */
332 SCIP_Real minobj, /**< minimal objective value possible after rounding remaining fractional vars */
342 /** returns a fractional variable, that has most impact on rows in opposite direction, i.e. that is most crucial to
344 * if variables have equal impact, chooses the one with best objective value improvement in corresponding direction;
351 SCIP_Real minobj, /**< minimal objective value possible after rounding remaining fractional vars */
377 assert(SCIPvarGetType(var) == SCIP_VARTYPE_BINARY || SCIPvarGetType(var) == SCIP_VARTYPE_INTEGER);
395 if( (nlocks > maxnlocks || deltaobj < bestdeltaobj) && minobj - obj < SCIPgetCutoffbound(scip) )
411 if( (nlocks > maxnlocks || deltaobj < bestdeltaobj) && minobj + obj < SCIPgetCutoffbound(scip) )
491 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
507 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
557 if( SCIPgetStage(masterprob) > SCIP_STAGE_SOLVING || SCIPgetLPSolstat(masterprob) != SCIP_LPSOLSTAT_OPTIMAL )
578 SCIP_CALL( SCIPgetExternBranchCands(scip, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL) );
590 SCIPdebugMessage("executing GCG rounding heuristic: %d LP rows, %d fractionals\n", nlprows, nfrac);
598 * the rows should be feasible, but due to numerical inaccuracies in the LP solver, they can be violated
648 bestroundval = obj > 0.0 ? SCIPfeasFloor(scip, lpcandssol[c]) : SCIPfeasCeil(scip, lpcandssol[c]);
659 SCIPdebugMessage("GCG rounding heuristic: nfrac=%d, nviolrows=%d, obj=%g (best possible obj: %g)\n",
667 * - if a violated row exists, round a variable decreasing the violation, that has least impact on other rows
668 * - otherwise, round a variable, that has strongest devastating impact on rows in opposite direction
696 SCIPdebugMessage("GCG rounding heuristic: search rounding variable and try to stay feasible\n");
697 SCIP_CALL( selectEssentialRounding(scip, sol, minobj, lpcands, nlpcands, &roundvar, &oldsolval, &newsolval) );
725 SCIPdebugMessage("GCG rounding heuristic: -> nfrac=%d, nviolrows=%d, obj=%g (best possible obj: %g)\n",
777 SCIP_CALL( SCIPincludeHeur(scip, HEUR_NAME, HEUR_DESC, HEUR_DISPCHAR, HEUR_PRIORITY, HEUR_FREQ, HEUR_FREQOFS,
static void updateViolations(SCIP *scip, SCIP_ROW *row, SCIP_ROW **violrows, int *violrowpos, int *nviolrows, SCIP_Real oldactivity, SCIP_Real newactivity)
Definition: heur_gcgrounding.c:78
GCG interface methods.
static SCIP_DECL_HEURINITSOL(heurInitsolGcgrounding)
Definition: heur_gcgrounding.c:493
static SCIP_RETCODE selectRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, int direction, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
Definition: heur_gcgrounding.c:209
static SCIP_RETCODE selectEssentialRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_VAR **lpcands, int nlpcands, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
Definition: heur_gcgrounding.c:348
SCIP_RETCODE SCIPincludeHeurGcgrounding(SCIP *scip)
Definition: heur_gcgrounding.c:767
LP gcgrounding heuristic that tries to recover from intermediate infeasibilities.
static SCIP_RETCODE selectIncreaseRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
Definition: heur_gcgrounding.c:314
static SCIP_RETCODE selectDecreaseRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
Definition: heur_gcgrounding.c:329
static SCIP_RETCODE updateActivities(SCIP *scip, SCIP_Real *activities, SCIP_ROW **violrows, int *violrowpos, int *nviolrows, int nlprows, SCIP_VAR *var, SCIP_Real oldsolval, SCIP_Real newsolval)
Definition: heur_gcgrounding.c:137
SCIP_SOL * GCGrelaxGetCurrentOrigSol(SCIP *scip)
Definition: relax_gcg.c:4183
GCG relaxator.
Definition: heur_gcgdins.c:74