Detailed Description
primal heuristic interface for LP diving heuristics on the original variables
Definition in file heur_origdiving.c.
#include <assert.h>#include <string.h>#include "gcg/heur_origdiving.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_TIMING SCIP_HEURTIMING_AFTERPLUNGE |
| #define | HEUR_USESSUBSCIP FALSE |
| #define | DEFAULT_MINRELDEPTH 0.0 |
| #define | DEFAULT_MAXRELDEPTH 1.0 |
| #define | DEFAULT_MAXLPITERQUOT 0.05 |
| #define | DEFAULT_MAXLPITEROFS 1000 |
| #define | DEFAULT_MAXPRICEROUNDS 0 |
| #define | DEFAULT_USEFARKASONLY FALSE |
| #define | DEFAULT_MAXDIVEUBQUOT 0.8 |
| #define | DEFAULT_MAXDIVEAVGQUOT 0.0 |
| #define | DEFAULT_MAXDIVEUBQUOTNOSOL 0.1 |
| #define | DEFAULT_MAXDIVEAVGQUOTNOSOL 0.0 |
| #define | DEFAULT_OTHERDIRECTION TRUE |
| #define | DEFAULT_BACKTRACK FALSE |
| #define | DEFAULT_MAXDISCREPANCY 2 |
| #define | DEFAULT_MAXDISCDEPTH 0 |
| #define | MINLPITER 10000 |
Variables | |
| heurdata = SCIPheurGetData(heur) | |
| return | SCIP_OKAY |
| heurdata | nlpiterations = 0 |
| heurdata | npricerounds = 0 |
| heurdata | nsuccess = 0 |
| static SCIP * | masterprob |
| SCIP_LPSOLSTAT | lpsolstat = SCIP_LPSOLSTAT_OPTIMAL |
| SCIP_VAR ** | selectedvars |
| SCIP_VAR ** | tabulist |
| int * | discrepancies |
| SCIP_Real | searchubbound = SCIPinfinity(scip) |
| SCIP_Real | searchavgbound = SCIPinfinity(scip) |
| SCIP_Real | searchbound = MIN(searchubbound, searchavgbound) |
| SCIP_Real | lpobj = objval |
| SCIP_Real | objval = SCIPgetRelaxSolObj(scip) |
| SCIP_Real | oldobjval |
| SCIP_Bool | lperror = FALSE |
| SCIP_Bool | lpsolved |
| SCIP_Bool | cutoff = FALSE |
| SCIP_Longint | ncalls |
| SCIP_Longint | nsolsfound |
| SCIP_Longint | maxnlpiterations |
| int | totalpricerounds = 0 |
| int | nlpcands |
| int | startnlpcands = nlpcands |
| int | depth |
| int | maxdepth |
| int | maxdivedepth |
| int | divedepth = 0 |
| int | discrepancy = 0 |
| int | i |
| gcg = heurdata->gcg | |
| * | result = SCIP_DELAYED |
| else | |
Macro Definition Documentation
◆ HEUR_TIMING
| #define HEUR_TIMING SCIP_HEURTIMING_AFTERPLUNGE |
Definition at line 45 of file heur_origdiving.c.
◆ HEUR_USESSUBSCIP
| #define HEUR_USESSUBSCIP FALSE |
Definition at line 46 of file heur_origdiving.c.
◆ DEFAULT_MINRELDEPTH
| #define DEFAULT_MINRELDEPTH 0.0 |
minimal relative depth to start diving
Definition at line 53 of file heur_origdiving.c.
◆ DEFAULT_MAXRELDEPTH
| #define DEFAULT_MAXRELDEPTH 1.0 |
maximal relative depth to start diving
Definition at line 54 of file heur_origdiving.c.
◆ DEFAULT_MAXLPITERQUOT
| #define DEFAULT_MAXLPITERQUOT 0.05 |
maximal fraction of diving LP iterations compared to node LP iterations
Definition at line 55 of file heur_origdiving.c.
◆ DEFAULT_MAXLPITEROFS
| #define DEFAULT_MAXLPITEROFS 1000 |
additional number of allowed LP iterations
Definition at line 56 of file heur_origdiving.c.
◆ DEFAULT_MAXPRICEROUNDS
| #define DEFAULT_MAXPRICEROUNDS 0 |
maximal number of allowed pricing rounds (-1: no limit)
Definition at line 57 of file heur_origdiving.c.
◆ DEFAULT_USEFARKASONLY
| #define DEFAULT_USEFARKASONLY FALSE |
perform pricing only if infeasibility is encountered
Definition at line 58 of file heur_origdiving.c.
◆ DEFAULT_MAXDIVEUBQUOT
| #define DEFAULT_MAXDIVEUBQUOT 0.8 |
maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)
Definition at line 59 of file heur_origdiving.c.
◆ DEFAULT_MAXDIVEAVGQUOT
| #define DEFAULT_MAXDIVEAVGQUOT 0.0 |
maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)
Definition at line 61 of file heur_origdiving.c.
◆ DEFAULT_MAXDIVEUBQUOTNOSOL
| #define DEFAULT_MAXDIVEUBQUOTNOSOL 0.1 |
maximal UBQUOT when no solution was found yet (0.0: no limit)
Definition at line 63 of file heur_origdiving.c.
◆ DEFAULT_MAXDIVEAVGQUOTNOSOL
| #define DEFAULT_MAXDIVEAVGQUOTNOSOL 0.0 |
maximal AVGQUOT when no solution was found yet (0.0: no limit)
Definition at line 64 of file heur_origdiving.c.
◆ DEFAULT_OTHERDIRECTION
| #define DEFAULT_OTHERDIRECTION TRUE |
try to branch the diving variable in the other direction in case of infeasibility
Definition at line 65 of file heur_origdiving.c.
Referenced by GCGincludeDivingHeurOrig().
◆ DEFAULT_BACKTRACK
| #define DEFAULT_BACKTRACK FALSE |
single backtracking by choosing another variable in case of infeasibility
Definition at line 66 of file heur_origdiving.c.
◆ DEFAULT_MAXDISCREPANCY
| #define DEFAULT_MAXDISCREPANCY 2 |
maximal discrepancy allowed in backtracking and limited discrepancy search
Definition at line 67 of file heur_origdiving.c.
◆ DEFAULT_MAXDISCDEPTH
| #define DEFAULT_MAXDISCDEPTH 0 |
maximal depth until which a limited discrepancy search is performed
Definition at line 68 of file heur_origdiving.c.
◆ MINLPITER
| #define MINLPITER 10000 |
minimal number of LP iterations allowed in each LP solving call
Definition at line 70 of file heur_origdiving.c.
Function Documentation
◆ assert() [1/5]
| assert | ( | heur ! | = NULL | ) |
◆ assert() [2/5]
◆ assert() [3/5]
◆ if() [1/8]
Definition at line 164 of file heur_origdiving.c.
References SCIP_HeurData::gcg, heurdata, and SCIP_CALL().
◆ SCIPfreeMemory()
| SCIPfreeMemory | ( | scip | , |
| & | heurdata ) |
References heurdata, and SCIPfreeMemory().
◆ SCIPheurSetData()
| SCIPheurSetData | ( | heur | , |
| NULL | ) |
◆ SCIP_CALL() [1/4]
| SCIP_CALL | ( | SCIPcreateSol(scip, &heurdata->sol, heur) | ) |
References heurdata, and SCIP_CALL().
◆ if() [2/8]
Definition at line 198 of file heur_origdiving.c.
References SCIP_HeurData::gcg, 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 209 of file heur_origdiving.c.
References assert(), SCIP_HeurData::gcg, heurdata, and SCIP_CALL().
◆ SCIP_DECL_HEUREXITSOL()
|
static |
solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
Definition at line 250 of file heur_origdiving.c.
References assert(), SCIP_HeurData::gcg, heurdata, and SCIP_CALL().
◆ if() [3/8]
Definition at line 284 of file heur_origdiving.c.
References SCIP_HeurData::gcg, heurdata, and SCIP_CALL().
◆ SCIP_CALL() [2/4]
| SCIP_CALL | ( | SCIPfreeSol(scip, &heurdata->sol) | ) |
References heurdata, and SCIP_CALL().
◆ assert() [4/5]
◆ assert() [5/5]
| assert | ( | masterprob ! | = NULL | ) |
References assert(), EVENTHDLR_NAME, and masterprob.
◆ if() [4/8]
| if | ( | SCIPgetStage(masterprob) | , |
| SCIP_STAGE_SOLVING||!SCIPhasCurrentNodeLP(masterprob)||SCIPgetLPSolstat(masterprob) ! | = SCIP_LPSOLSTAT_OPTIMAL ) |
Definition at line 377 of file heur_origdiving.c.
References assert(), depth, GCGgetNPricingprobs(), GCGgetNRelPricingprobs(), heurdata, masterprob, maxdepth, maxnlpiterations, MINLPITER, ncalls, nlpcands, nlpiterations, nsolsfound, result, searchavgbound, and searchubbound.
◆ if() [5/8]
| if | ( | heurdata-> | maxdiveavgquot, |
| 0. | 0 ) |
References heurdata, and searchavgbound.
◆ if() [6/8]
| if | ( | SCIPisObjIntegral(scip) | ) |
Definition at line 460 of file heur_origdiving.c.
References discrepancies, heurdata, i, maxdepth, maxdivedepth, SCIP_CALL(), SCIPstatistic(), searchbound, selectedvars, and tabulist.
◆ for()
Definition at line 481 of file heur_origdiving.c.
References heurdata, i, SCIP_CALL(), and tabulist.
◆ SCIP_CALL() [3/4]
| SCIP_CALL | ( | GCGrelaxStartProbing(gcg, heur) | ) |
References GCGrelaxStartProbing(), and SCIP_CALL().
◆ SCIPenableVarHistory()
◆ SCIPdebugMessage() [1/2]
| SCIPdebugMessage | ( | "(node %"SCIP_LONGINT_FORMAT") executing %s heuristic: | depth = %d, |
| %d | fractionals, | ||
| dualbound | = %g, | ||
| avgbound | = %g, | ||
| cutoffbound | = %g ) |
References cutoff, discrepancy, divedepth, lperror, nlpcands, npricerounds, SCIPdebugMessage(), searchbound, startnlpcands, and totalpricerounds.
◆ while()
| while | ( | !lperror &&!cutoff && | lpsolstat = = SCIP_LPSOLSTAT_OPTIMAL && nlpcands, |
| 0 && | divedepth< 10||nlpcands<=startnlpcands - divedepth/2||(divedepth< maxdivedepth &&heurdata->nlpiterations< maxnlpiterations &&objval< searchbound)) &&!SCIPisStopped(scip ) |
Definition at line 536 of file heur_origdiving.c.
References assert(), SCIP_HeurData::backtrack, bestcandmayround, bestfrac, cutoff, discrepancies, discrepancy, divedepth, GCGrelaxBacktrackProbing(), GCGrelaxNewProbingnodeMaster(), GCGrelaxNewProbingnodeOrig(), GCGrelaxPerformProbing(), GCGrelaxPerformProbingWithPricing(), heurdata, i, lperror, lpobj, lpsolstat, lpsolved, masterprob, SCIP_HeurData::maxdiscdepth, SCIP_HeurData::maxdiscrepancy, maxdivedepth, maxnlpiterations, SCIP_HeurData::maxpricerounds, MINLPITER, nlpcands, nlpiterations, SCIP_HeurData::nlpiterations, npricerounds, SCIP_HeurData::npricerounds, objval, oldobjval, SCIP_HeurData::otherdirection, result, SCIP_CALL(), SCIPdebugMessage(), SCIPstatistic(), searchbound, selectedvars, SCIP_HeurData::sol, startnlpcands, success, tabulist, totalpricerounds, and SCIP_HeurData::usefarkasonly.
◆ if() [7/8]
Definition at line 855 of file heur_origdiving.c.
References cutoff, divedepth, heurdata, lperror, lpsolstat, nlpcands, result, SCIP_CALL(), SCIPdebugMessage(), SCIP_HeurData::sol, and success.
◆ SCIP_CALL() [4/4]
| SCIP_CALL | ( | GCGrelaxEndProbing(gcg) | ) |
References GCGrelaxEndProbing(), heurdata, result, SCIP_CALL(), and totalpricerounds.
◆ if() [8/8]
Definition at line 922 of file heur_origdiving.c.
References heurdata, and SCIP_CALL().
◆ SCIPstatistic()
| SCIPstatistic | ( | SCIP_CALL(SCIPfreeClock(scip, &lptime)) | ) |
References SCIP_CALL(), and SCIPstatistic().
◆ SCIPfreeBufferArray()
| SCIPfreeBufferArray | ( | scip | , |
| & | selectedvars ) |
References discrepancies, SCIPfreeBufferArray(), selectedvars, and tabulist.
◆ SCIPdebugMessage() [2/2]
| SCIPdebugMessage | ( | "(node %"SCIP_LONGINT_FORMAT") finished %s heuristic: %d | fractionals, |
| dive %d/% | d, | ||
| LP iter %"SCIP_LONGINT_FORMAT"/%"SCIP_LONGINT_FORMAT" | , | ||
| pricerounds %d/% | d, | ||
| objval | = %g/%g, | ||
| lpsolstat | = %d ) |
References cutoff, divedepth, heurdata, lpsolstat, maxdivedepth, maxnlpiterations, nlpcands, objval, SCIPdebugMessage(), searchbound, and totalpricerounds.
◆ GCGheurGetDivingDataOrig()
| GCG_DIVINGDATA * GCGheurGetDivingDataOrig | ( | SCIP_HEUR * | heur | ) |
gets diving rule specific data of a diving heuristic
- Parameters
-
heur primal heuristic
Definition at line 1092 of file heur_origdiving.c.
References assert(), SCIP_HeurData::divingdata, GCGheurGetDivingDataOrig(), and heurdata.
Referenced by assert(), and GCGheurGetDivingDataOrig().
◆ GCGheurSetDivingDataOrig()
| void GCGheurSetDivingDataOrig | ( | SCIP_HEUR * | heur, |
| GCG_DIVINGDATA * | divingdata ) |
sets diving rule specific data of a diving heuristic
- Parameters
-
heur primal heuristic divingdata diving rule specific data
Definition at line 1108 of file heur_origdiving.c.
References assert(), divingdata, SCIP_HeurData::divingdata, GCGheurSetDivingDataOrig(), and heurdata.
◆ GCGincludeDivingHeurOrig()
| SCIP_RETCODE GCGincludeDivingHeurOrig | ( | GCG * | gcg, |
| SCIP_HEUR ** | heur, | ||
| const char * | name, | ||
| const char * | desc, | ||
| char | dispchar, | ||
| int | priority, | ||
| int | freq, | ||
| int | freqofs, | ||
| int | maxdepth, | ||
| GCG_DECL_DIVINGFREE((*divingfree)) | , | ||
| GCG_DECL_DIVINGINIT((*divinginit)) | , | ||
| GCG_DECL_DIVINGEXIT((*divingexit)) | , | ||
| GCG_DECL_DIVINGINITSOL((*divinginitsol)) | , | ||
| GCG_DECL_DIVINGEXITSOL((*divingexitsol)) | , | ||
| GCG_DECL_DIVINGINITEXEC((*divinginitexec)) | , | ||
| GCG_DECL_DIVINGEXITEXEC((*divingexitexec)) | , | ||
| GCG_DECL_DIVINGSELECTVAR((*divingselectvar)) | , | ||
| GCG_DIVINGDATA * | divingdata ) |
creates an original diving heuristic and includes it in GCG
- Parameters
-
gcg GCG data structure heur pointer to diving heuristic name name of primal heuristic desc description of primal heuristic dispchar display character of primal heuristic priority priority of the primal heuristic freq frequency for calling primal heuristic freqofs frequency offset for calling primal heuristic maxdepth maximal depth level to call heuristic at (-1: no limit) - destructor of diving heuristic - initialize diving heuristic - deinitialize diving heuristic - solving process initialization method of diving heuristic - solving process deinitialization method of diving heuristic - execution initialization method of diving heuristic - execution deinitialization method of diving heuristic - variable selection method of diving heuristic divingdata diving rule specific data (or NULL)
Definition at line 1125 of file heur_origdiving.c.
References assert(), SCIP_HeurData::backtrack, DEFAULT_BACKTRACK, DEFAULT_MAXDISCDEPTH, DEFAULT_MAXDISCREPANCY, DEFAULT_MAXDIVEAVGQUOT, DEFAULT_MAXDIVEAVGQUOTNOSOL, DEFAULT_MAXDIVEUBQUOT, DEFAULT_MAXDIVEUBQUOTNOSOL, DEFAULT_MAXLPITEROFS, DEFAULT_MAXLPITERQUOT, DEFAULT_MAXPRICEROUNDS, DEFAULT_MAXRELDEPTH, DEFAULT_MINRELDEPTH, DEFAULT_OTHERDIRECTION, DEFAULT_USEFARKASONLY, divingdata, SCIP_HeurData::divingdata, EVENTHDLR_NAME, SCIP_HeurData::gcg, GCG_DECL_DIVINGEXIT, GCG_DECL_DIVINGEXITEXEC, GCG_DECL_DIVINGEXITSOL, GCG_DECL_DIVINGFREE, GCG_DECL_DIVINGINIT, GCG_DECL_DIVINGINITEXEC, GCG_DECL_DIVINGINITSOL, GCG_DECL_DIVINGSELECTVAR, GCGgetMasterprob(), GCGgetOrigprob(), GCGincludeDivingHeurOrig(), HEUR_TIMING, HEUR_USESSUBSCIP, heurdata, masterprob, maxdepth, SCIP_HeurData::maxdiscdepth, SCIP_HeurData::maxdiscrepancy, SCIP_HeurData::maxdiveavgquot, SCIP_HeurData::maxdiveavgquotnosol, SCIP_HeurData::maxdiveubquot, SCIP_HeurData::maxdiveubquotnosol, SCIP_HeurData::maxlpiterofs, SCIP_HeurData::maxlpiterquot, SCIP_HeurData::maxpricerounds, SCIP_HeurData::maxreldepth, SCIP_HeurData::minreldepth, origprob, SCIP_HeurData::otherdirection, SCIP_CALL(), and SCIP_HeurData::usefarkasonly.
Referenced by GCGincludeDivingHeurOrig(), GCGincludeHeurGcgcoefdiving(), GCGincludeHeurGcgfracdiving(), GCGincludeHeurGcgguideddiving(), GCGincludeHeurGcglinesdiving(), GCGincludeHeurGcgpscostdiving(), and GCGincludeHeurGcgveclendiving().
◆ GCGincludeEventHdlrOrigdiving()
| SCIP_RETCODE GCGincludeEventHdlrOrigdiving | ( | GCG * | gcg | ) |
creates event handler for origdiving event and includes it in the master problem
creates event handler for origdiving event
- Parameters
-
gcg GCG data structure
Definition at line 1289 of file heur_origdiving.c.
References assert(), EVENTHDLR_DESC, EVENTHDLR_NAME, GCGgetMasterprob(), GCGincludeEventHdlrOrigdiving(), masterprob, and SCIP_CALL().
Referenced by GCGincludeEventHdlrOrigdiving(), and GCGincludeGcgPlugins().
Variable Documentation
◆ heurdata
| heurdata = SCIPheurGetData(heur) |
Definition at line 161 of file heur_origdiving.c.
◆ SCIP_OKAY
| return SCIP_OKAY |
Definition at line 173 of file heur_origdiving.c.
◆ nlpiterations
| SCIP_Longint nlpiterations = 0 |
Definition at line 193 of file heur_origdiving.c.
◆ npricerounds
| npricerounds = 0 |
Definition at line 194 of file heur_origdiving.c.
◆ nsuccess
Definition at line 195 of file heur_origdiving.c.
◆ masterprob
| masterprob |
execution method of primal heuristic
Definition at line 301 of file heur_origdiving.c.
◆ lpsolstat
| lpsolstat = SCIP_LPSOLSTAT_OPTIMAL |
Definition at line 307 of file heur_origdiving.c.
◆ selectedvars
| SCIP_VAR** selectedvars |
Definition at line 308 of file heur_origdiving.c.
◆ tabulist
| SCIP_VAR** tabulist |
Definition at line 309 of file heur_origdiving.c.
◆ discrepancies
| int* discrepancies |
Definition at line 310 of file heur_origdiving.c.
◆ searchubbound
| else searchubbound = SCIPinfinity(scip) |
Definition at line 311 of file heur_origdiving.c.
◆ searchavgbound
| else searchavgbound = SCIPinfinity(scip) |
Definition at line 312 of file heur_origdiving.c.
◆ searchbound
| searchbound = MIN(searchubbound, searchavgbound) |
Definition at line 313 of file heur_origdiving.c.
◆ lpobj
| lpobj = objval |
Definition at line 314 of file heur_origdiving.c.
Referenced by SCIP_DECL_DISPOUTPUT(), SCIPenableVarHistory(), and while().
◆ objval
| objval = SCIPgetRelaxSolObj(scip) |
Definition at line 315 of file heur_origdiving.c.
◆ oldobjval
| SCIP_Real oldobjval |
Definition at line 316 of file heur_origdiving.c.
◆ lperror
| lperror = FALSE |
Definition at line 317 of file heur_origdiving.c.
◆ lpsolved
| SCIP_Bool lpsolved |
Definition at line 318 of file heur_origdiving.c.
Referenced by applyProbing(), executeStrongBranching(), GCGrelaxPerformProbing(), GCGrelaxPerformProbingWithPricing(), performProbing(), performWeightedPricing(), and while().
◆ cutoff
| cutoff = FALSE |
Definition at line 319 of file heur_origdiving.c.
◆ ncalls
| SCIP_Longint ncalls |
Definition at line 320 of file heur_origdiving.c.
◆ nsolsfound
| SCIP_Longint nsolsfound |
Definition at line 321 of file heur_origdiving.c.
◆ maxnlpiterations
| SCIP_Longint maxnlpiterations |
Definition at line 323 of file heur_origdiving.c.
◆ totalpricerounds
| totalpricerounds = 0 |
Definition at line 325 of file heur_origdiving.c.
Referenced by while().
◆ nlpcands
| int nlpcands |
Definition at line 326 of file heur_origdiving.c.
◆ startnlpcands
| startnlpcands = nlpcands |
Definition at line 327 of file heur_origdiving.c.
◆ depth
| int depth |
Definition at line 328 of file heur_origdiving.c.
◆ maxdepth
| int maxdepth |
Definition at line 329 of file heur_origdiving.c.
◆ maxdivedepth
| int maxdivedepth |
Definition at line 330 of file heur_origdiving.c.
◆ divedepth
| divedepth = 0 |
Definition at line 331 of file heur_origdiving.c.
Referenced by while().
◆ discrepancy
| discrepancy = 0 |
Definition at line 332 of file heur_origdiving.c.
Referenced by while().
◆ i
| int i |
Definition at line 350 of file heur_origdiving.c.
◆ gcg
| gcg = heurdata->gcg |
Definition at line 360 of file heur_origdiving.c.
◆ result
| * result = SCIP_DELAYED |
Definition at line 374 of file heur_origdiving.c.
◆ else
| else |
Definition at line 446 of file heur_origdiving.c.