Detailed Description
LP gcgrounding heuristic that tries to recover from intermediate infeasibilities.
Definition in file heur_gcgrounding.c.
#include <assert.h>#include <string.h>#include "gcg/heur_gcgrounding.h"#include "gcg/relax_gcg.h"#include "gcg/gcg.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_HeurData |
Macros | |
| #define | HEUR_NAME "gcgrounding" |
| #define | HEUR_DESC "LP rounding heuristic on original variables with infeasibility recovering" |
| #define | HEUR_DISPCHAR 'R' |
| #define | HEUR_PRIORITY -1000 |
| #define | HEUR_FREQ 1 |
| #define | HEUR_FREQOFS 0 |
| #define | HEUR_MAXDEPTH -1 |
| #define | HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
| #define | HEUR_USESSUBSCIP FALSE |
| #define | DEFAULT_SUCCESSFACTOR 100 |
| #define | heurCopyGcgrounding NULL |
| #define | heurExitsolGcgrounding NULL |
Variables | |
| heurdata = SCIPheurGetData(heur) | |
| return | SCIP_OKAY |
| heurdata | lastlp = -1 |
| SCIP_SOL * | sol = heurdata->sol |
| SCIP_VAR ** | lpcands |
| SCIP_Real * | lpcandssol |
| SCIP_ROW ** | lprows |
| SCIP_Real * | activities |
| SCIP_ROW ** | violrows |
| int * | violrowpos |
| SCIP_Real | obj |
| SCIP_Real | minobj = SCIPgetSolTransObj(scip, sol) |
| int | nlpcands |
| int | nlprows |
| int | nfrac |
| int | nviolrows |
| int | c |
| int | r |
| SCIP_Longint | nlps |
| SCIP_Longint | ncalls |
| SCIP_Longint | nsolsfound |
| SCIP_Longint | nnodes |
| masterprob = GCGgetMasterprob(heurdata->gcg) | |
| * | result = SCIP_DIDNOTRUN |
Macro Definition Documentation
◆ HEUR_NAME
| #define HEUR_NAME "gcgrounding" |
Definition at line 45 of file heur_gcgrounding.c.
◆ HEUR_DESC
| #define HEUR_DESC "LP rounding heuristic on original variables with infeasibility recovering" |
Definition at line 46 of file heur_gcgrounding.c.
◆ HEUR_DISPCHAR
| #define HEUR_DISPCHAR 'R' |
Definition at line 47 of file heur_gcgrounding.c.
◆ HEUR_PRIORITY
| #define HEUR_PRIORITY -1000 |
Definition at line 48 of file heur_gcgrounding.c.
◆ HEUR_FREQ
| #define HEUR_FREQ 1 |
Definition at line 49 of file heur_gcgrounding.c.
◆ HEUR_FREQOFS
| #define HEUR_FREQOFS 0 |
Definition at line 50 of file heur_gcgrounding.c.
◆ HEUR_MAXDEPTH
| #define HEUR_MAXDEPTH -1 |
Definition at line 51 of file heur_gcgrounding.c.
◆ HEUR_TIMING
| #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
Definition at line 52 of file heur_gcgrounding.c.
◆ HEUR_USESSUBSCIP
| #define HEUR_USESSUBSCIP FALSE |
Definition at line 53 of file heur_gcgrounding.c.
◆ DEFAULT_SUCCESSFACTOR
| #define DEFAULT_SUCCESSFACTOR 100 |
number of calls per found solution that are considered as standard success, a higher factor causes the heuristic to be called more often
Definition at line 55 of file heur_gcgrounding.c.
Referenced by GCGincludeHeurGcgrounding().
◆ heurCopyGcgrounding
| #define heurCopyGcgrounding NULL |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 436 of file heur_gcgrounding.c.
Referenced by GCGincludeHeurGcgrounding().
◆ heurExitsolGcgrounding
| #define heurExitsolGcgrounding NULL |
solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
Definition at line 510 of file heur_gcgrounding.c.
Referenced by GCGincludeHeurGcgrounding().
Function Documentation
◆ updateViolations()
|
static |
update row violation arrays after a row's activity value changed
- Parameters
-
scip SCIP data structure row LP row violrows array with currently violated rows violrowpos position of LP rows in violrows array nviolrows pointer to the number of currently violated rows oldactivity old activity value of LP row newactivity new activity value of LP row
Definition at line 80 of file heur_gcgrounding.c.
References assert(), nviolrows, updateViolations(), violrowpos, and violrows.
Referenced by updateActivities(), updateActivities(), updateViolations(), and updateViolations().
◆ updateActivities()
|
static |
update row activities after a variable's solution value changed
- Parameters
-
scip SCIP data structure activities LP row activities violrows array with currently violated rows violrowpos position of LP rows in violrows array nviolrows pointer to the number of currently violated rows nlprows number of rows in current LP var variable that has been changed oldsolval old solution value of variable newsolval new solution value of variable
Definition at line 139 of file heur_gcgrounding.c.
References activities, assert(), nlprows, nviolrows, oldsolval, updateActivities(), updateViolations(), var, violrowpos, and violrows.
Referenced by SCIP_DECL_HEUREXEC(), updateActivities(), updateActivities(), updateActivities(), while(), and while().
◆ selectRounding()
|
static |
returns a variable, that pushes activity of the row in the given direction with minimal negative impact on other rows; if variables have equal impact, chooses the one with best objective value improvement in corresponding direction; rounding in a direction is forbidden, if this forces the objective value over the upper bound
- Parameters
-
scip SCIP data structure sol primal solution minobj minimal objective value possible after rounding remaining fractional vars row LP row direction should the activity be increased (+1) or decreased (-1)? roundvar pointer to store the rounding variable, returns NULL if impossible oldsolval pointer to store old (fractional) solution value of rounding variable newsolval pointer to store new (rounded) solution value of rounding variable
Definition at line 211 of file heur_gcgrounding.c.
References assert(), c, minobj, obj, oldsolval, selectRounding(), sol, solval, and var.
Referenced by selectDecreaseRounding(), selectIncreaseRounding(), and selectRounding().
◆ selectIncreaseRounding()
|
static |
returns a variable, that increases the activity of the row
- Parameters
-
scip SCIP data structure sol primal solution minobj minimal objective value possible after rounding remaining fractional vars row LP row roundvar pointer to store the rounding variable, returns NULL if impossible oldsolval old (fractional) solution value of rounding variable newsolval new (rounded) solution value of rounding variable
Definition at line 316 of file heur_gcgrounding.c.
References minobj, oldsolval, selectIncreaseRounding(), selectRounding(), and sol.
Referenced by selectIncreaseRounding(), and while().
◆ selectDecreaseRounding()
|
static |
returns a variable, that decreases the activity of the row
- Parameters
-
scip SCIP data structure sol primal solution minobj minimal objective value possible after rounding remaining fractional vars row LP row roundvar pointer to store the rounding variable, returns NULL if impossible oldsolval old (fractional) solution value of rounding variable newsolval new (rounded) solution value of rounding variable
Definition at line 331 of file heur_gcgrounding.c.
References minobj, oldsolval, selectDecreaseRounding(), selectRounding(), and sol.
Referenced by selectDecreaseRounding(), and while().
◆ selectEssentialRounding()
|
static |
returns a fractional variable, that has most impact on rows in opposite direction, i.e. that is most crucial to fix in the other direction; if variables have equal impact, chooses the one with best objective value improvement in corresponding direction; rounding in a direction is forbidden, if this forces the objective value over the upper bound
- Parameters
-
scip SCIP data structure sol primal solution minobj minimal objective value possible after rounding remaining fractional vars lpcands fractional variables in LP nlpcands number of fractional variables in LP roundvar pointer to store the rounding variable, returns NULL if impossible oldsolval old (fractional) solution value of rounding variable newsolval new (rounded) solution value of rounding variable
Definition at line 350 of file heur_gcgrounding.c.
References assert(), lpcands, minobj, nlpcands, obj, oldsolval, selectEssentialRounding(), sol, solval, and var.
Referenced by selectEssentialRounding(), selectEssentialRounding(), while(), and while().
◆ assert() [1/7]
| assert | ( | heur ! | = NULL | ) |
◆ assert() [2/7]
| assert | ( | strcmp(SCIPheurGetName(heur), HEUR_NAME) | = =0 | ) |
◆ assert() [3/7]
◆ assert() [4/7]
◆ SCIPfreeMemory()
| SCIPfreeMemory | ( | scip | , |
| & | heurdata ) |
References heurdata, and SCIPfreeMemory().
◆ SCIPheurSetData()
| SCIPheurSetData | ( | heur | , |
| NULL | ) |
◆ SCIP_CALL() [1/3]
| SCIP_CALL | ( | SCIPcreateSol(scip, &heurdata->sol, heur) | ) |
References heurdata, and SCIP_CALL().
◆ SCIP_CALL() [2/3]
| SCIP_CALL | ( | SCIPfreeSol(scip, &heurdata->sol) | ) |
References heurdata, and SCIP_CALL().
◆ SCIP_DECL_HEURINITSOL()
|
static |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
Definition at line 495 of file heur_gcgrounding.c.
References assert(), HEUR_NAME, heurdata, and SCIP_HeurData::lastlp.
◆ assert() [5/7]
◆ assert() [6/7]
| assert | ( | masterprob ! | = NULL | ) |
References assert(), and masterprob.
◆ if() [1/4]
| if | ( | ! | SCIPisRelaxSolValidscip | ) |
Definition at line 556 of file heur_gcgrounding.c.
◆ if() [2/4]
| if | ( | SCIPgetStage(masterprob) | , |
| SCIP_STAGE_SOLVING||SCIPgetLPSolstat(masterprob) ! | = SCIP_LPSOLSTAT_OPTIMAL ) |
Definition at line 563 of file heur_gcgrounding.c.
References activities, assert(), GCGrelaxGetCurrentOrigSol(), heurdata, lpcands, lpcandssol, lprows, masterprob, ncalls, nfrac, nlpcands, nlprows, nlps, nnodes, nsolsfound, nviolrows, result, SCIP_CALL(), SCIPdebugMessage(), violrowpos, and violrows.
◆ assert() [7/7]
◆ SCIP_CALL() [3/3]
| SCIP_CALL | ( | SCIPlinkRelaxSol(scip, sol) | ) |
References minobj, SCIP_CALL(), and sol.
◆ if() [3/4]
| if | ( | minobj >= | SCIPgetCutoffboundscip | ) |
Definition at line 637 of file heur_gcgrounding.c.
References activities, minobj, result, SCIPfreeBufferArray(), violrowpos, and violrows.
◆ for()
| for | ( | ) |
Definition at line 645 of file heur_gcgrounding.c.
References c, lpcands, lpcandssol, minobj, nlpcands, and obj.
◆ while()
| while | ( | nfrac | , |
| 0 | ) |
Definition at line 655 of file heur_gcgrounding.c.
References activities, assert(), lpcands, minobj, nfrac, nlpcands, nlprows, nviolrows, obj, oldsolval, SCIP_CALL(), SCIPdebugMessage(), selectDecreaseRounding(), selectEssentialRounding(), selectIncreaseRounding(), sol, updateActivities(), violrowpos, and violrows.
◆ if() [4/4]
Definition at line 732 of file heur_gcgrounding.c.
References nfrac, nviolrows, result, SCIP_CALL(), SCIPdebugMessage(), and sol.
◆ SCIPfreeBufferArray()
| SCIPfreeBufferArray | ( | scip | , |
| & | violrowpos ) |
References activities, SCIPfreeBufferArray(), violrowpos, and violrows.
◆ GCGincludeHeurGcgrounding()
| SCIP_RETCODE GCGincludeHeurGcgrounding | ( | GCG * | gcg | ) |
creates the GCG rounding heuristic with infeasibility recovering and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 769 of file heur_gcgrounding.c.
References DEFAULT_SUCCESSFACTOR, SCIP_HeurData::gcg, GCGgetOrigprob(), GCGincludeHeurGcgrounding(), HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, heurCopyGcgrounding, heurdata, heurExitsolGcgrounding, origprob, SCIP_CALL(), and SCIP_HeurData::successfactor.
Referenced by GCGincludeGcgPlugins(), and GCGincludeHeurGcgrounding().
Variable Documentation
◆ heurdata
| heurdata = SCIPheurGetData(heur) |
execution method of primal heuristic
Definition at line 449 of file heur_gcgrounding.c.
◆ SCIP_OKAY
| return SCIP_OKAY |
Definition at line 454 of file heur_gcgrounding.c.
◆ lastlp
| heurdata lastlp = -1 |
Definition at line 472 of file heur_gcgrounding.c.
◆ sol
| sol = heurdata->sol |
Definition at line 519 of file heur_gcgrounding.c.
Referenced by assert(), buildMod2Matrix(), computeDynamicPenalties(), ObjPricerGcg::createNewMasterVar(), createOriginalProblemSolution(), GCGcolpoolPrice(), GCGcreateGcgColFromSol(), GCGmasterIsBestsolValid(), GCGmasterIsCurrentSolValid(), GCGmasterSetRootLPSol(), GCGpricestoreAddCol(), GCGselectConstraintsZeroHalf(), GCGwriteVarCreationDetails(), if(), if(), if(), mod2matrixPreprocessRows(), mod2MatrixTransformContRows(), ObjPricerGcg::priceColumnPoolOld(), SCIP_CALL(), SCIP_DECL_BENDERSPOSTSOLVE(), SCIP_DECL_CONSCHECK(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_HEUREXEC(), selectConstraintsZerohalf(), selectDecreaseRounding(), selectEssentialRounding(), selectEssentialRounding(), selectIncreaseRounding(), selectRounding(), selectShifting(), setupRepairProblem(), solutionHasInfiniteValue(), solveBlockProblem(), solveCplex(), solveHighs(), transformNonIntegralRow(), updateSlacks(), while(), and while().
◆ lpcands
| SCIP_VAR** lpcands |
Definition at line 520 of file heur_gcgrounding.c.
◆ lpcandssol
| SCIP_Real* lpcandssol |
Definition at line 521 of file heur_gcgrounding.c.
◆ lprows
| SCIP_ROW** lprows |
Definition at line 522 of file heur_gcgrounding.c.
Referenced by if(), SCIP_DECL_HEUREXEC(), and SCIP_DECL_SEPAEXECLP().
◆ activities
| SCIP_Real* activities |
Definition at line 523 of file heur_gcgrounding.c.
Referenced by getBestMastervar(), getViolationChange(), if(), if(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIPfreeBufferArray(), SCIPfreeBufferArray(), updateActivities(), updateActivities(), updateActivities(), updateSlacks(), while(), and while().
◆ violrows
| SCIP_ROW** violrows |
Definition at line 524 of file heur_gcgrounding.c.
Referenced by if(), if(), SCIPfreeBufferArray(), SCIPfreeBufferArray(), updateActivities(), updateActivities(), updateViolations(), updateViolations(), while(), and while().
◆ violrowpos
| int* violrowpos |
Definition at line 525 of file heur_gcgrounding.c.
Referenced by if(), if(), SCIPfreeBufferArray(), SCIPfreeBufferArray(), updateActivities(), updateActivities(), updateViolations(), updateViolations(), while(), and while().
◆ obj
| SCIP_Real obj |
Definition at line 526 of file heur_gcgrounding.c.
Referenced by calculateScoreOrig(), chgProbingObjUsingRows(), for(), for(), GCG_DECL_SCORECALC(), SCIP_DECL_PRICERINITSOL(), SCIP_DECL_SEPAEXECLP(), SCIP_DECL_SEPAINIT(), selectEssentialRounding(), selectEssentialRounding(), selectRounding(), while(), and while().
◆ minobj
| minobj = SCIPgetSolTransObj(scip, sol) |
Definition at line 527 of file heur_gcgrounding.c.
Referenced by for(), for(), if(), SCIP_CALL(), selectDecreaseRounding(), selectEssentialRounding(), selectEssentialRounding(), selectIncreaseRounding(), selectRounding(), while(), and while().
◆ nlpcands
| int nlpcands |
Definition at line 528 of file heur_gcgrounding.c.
◆ nlprows
| int nlprows |
Definition at line 529 of file heur_gcgrounding.c.
Referenced by addFracCounter(), if(), mod2rowAddRow(), SCIP_DECL_HEUREXEC(), SCIP_DECL_SEPAEXECLP(), updateActivities(), updateActivities(), while(), and while().
◆ nfrac
| int nfrac |
◆ nviolrows
| int nviolrows |
Definition at line 531 of file heur_gcgrounding.c.
Referenced by for(), if(), if(), SCIP_DECL_HEUREXEC(), updateActivities(), updateActivities(), updateViolations(), updateViolations(), while(), and while().
◆ c
| int c |
Definition at line 532 of file heur_gcgrounding.c.
◆ r
| int r |
Definition at line 533 of file heur_gcgrounding.c.
◆ nlps
| SCIP_Longint nlps |
Definition at line 534 of file heur_gcgrounding.c.
Referenced by if(), if(), SCIP_DECL_HEUREXEC(), and selectCandidate().
◆ ncalls
| SCIP_Longint ncalls |
Definition at line 535 of file heur_gcgrounding.c.
◆ nsolsfound
| SCIP_Longint nsolsfound |
Definition at line 536 of file heur_gcgrounding.c.
◆ nnodes
| SCIP_Longint nnodes |
Definition at line 537 of file heur_gcgrounding.c.
Referenced by createGraph(), createGraphNewDetection(), detection(), findConnectedComponents(), findDiameter(), GCGwriteVarCreationDetails(), if(), gcg::GraphAlgorithms< T >::mst(), SCIP_DECL_DISPOUTPUT(), SCIP_DECL_HEUREXEC(), SCIP_DECL_NODESELSELECT(), solveRepairProblem(), and gcg::Graph< T >::writeToFile().
◆ masterprob
| masterprob = GCGgetMasterprob(heurdata->gcg) |
Definition at line 548 of file heur_gcgrounding.c.
◆ result
| * result = SCIP_DIDNOTRUN |
Definition at line 551 of file heur_gcgrounding.c.