diving heuristic that selects adaptively between the existing, public dive sets
Definition in file heur_adaptivediving.c.
#include <assert.h>#include <string.h>#include "scip/heur_adaptivediving.h"#include "scip/heuristics.h"#include "scip/scipdefplugins.h"Go to the source code of this file.
Macros | |
| #define | HEUR_NAME "adaptivediving" |
| #define | HEUR_DESC "diving heuristic that selects adaptively between the existing, public divesets" |
| #define | HEUR_DISPCHAR SCIP_HEURDISPCHAR_DIVING |
| #define | HEUR_PRIORITY -70000 |
| #define | HEUR_FREQ 5 |
| #define | HEUR_FREQOFS 3 |
| #define | HEUR_MAXDEPTH -1 |
| #define | HEUR_TIMING SCIP_HEURTIMING_AFTERLPPLUNGE |
| #define | HEUR_USESSUBSCIP FALSE |
| #define | DIVESETS_INITIALSIZE 10 |
| #define | DEFAULT_INITIALSEED 13 |
| #define | DEFAULT_SELTYPE 'w' |
| #define | DEFAULT_SCORETYPE 'c' |
| #define | DEFAULT_USEADAPTIVECONTEXT FALSE |
| #define | DEFAULT_SELCONFIDENCECOEFF 10.0 |
| #define | DEFAULT_EPSILON 1.0 |
| #define | DEFAULT_MAXLPITERQUOT 0.15 |
| #define | DEFAULT_MAXLPITEROFS 1500L |
| #define | DEFAULT_BESTSOLWEIGHT 10.0 |
Variables | |
| heurdata = SCIPheurGetData(heur) | |
| return | SCIP_OKAY |
| heurdata | lastselection = -1 |
| static SCIP_DIVESET * | diveset |
| SCIP_DIVESET ** | divesets = heurdata->divesets |
| SCIP_Longint | lpiterlimit = getLPIterlimit(scip, heur, heurdata) |
| int | selection |
| * | result = SCIP_DELAYED |
| #define HEUR_NAME "adaptivediving" |
Definition at line 40 of file heur_adaptivediving.c.
| #define HEUR_DESC "diving heuristic that selects adaptively between the existing, public divesets" |
Definition at line 41 of file heur_adaptivediving.c.
| #define HEUR_DISPCHAR SCIP_HEURDISPCHAR_DIVING |
Definition at line 42 of file heur_adaptivediving.c.
| #define HEUR_PRIORITY -70000 |
Definition at line 43 of file heur_adaptivediving.c.
| #define HEUR_FREQ 5 |
Definition at line 44 of file heur_adaptivediving.c.
| #define HEUR_FREQOFS 3 |
Definition at line 45 of file heur_adaptivediving.c.
| #define HEUR_MAXDEPTH -1 |
Definition at line 46 of file heur_adaptivediving.c.
| #define HEUR_TIMING SCIP_HEURTIMING_AFTERLPPLUNGE |
Definition at line 47 of file heur_adaptivediving.c.
| #define HEUR_USESSUBSCIP FALSE |
does the heuristic use a secondary SCIP instance?
Definition at line 48 of file heur_adaptivediving.c.
| #define DIVESETS_INITIALSIZE 10 |
Definition at line 50 of file heur_adaptivediving.c.
Referenced by findAndStoreDivesets().
| #define DEFAULT_INITIALSEED 13 |
Definition at line 51 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving(), and SCIPsetRandomSeed().
| #define DEFAULT_SELTYPE 'w' |
Definition at line 56 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving().
| #define DEFAULT_SCORETYPE 'c' |
score parameter for selection: minimize either average 'n'odes, LP 'i'terations, backtrack/'c'onflict ratio, 'd'epth, 1 / 's'olutions, or 1 / solutions'u'ccess
Definition at line 57 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving().
| #define DEFAULT_USEADAPTIVECONTEXT FALSE |
Definition at line 60 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving().
| #define DEFAULT_SELCONFIDENCECOEFF 10.0 |
coefficient c to decrease initial confidence (calls + 1.0) / (calls + c) in scores
Definition at line 61 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving().
| #define DEFAULT_EPSILON 1.0 |
parameter that increases probability of exploration among divesets (only active if seltype is 'e')
Definition at line 62 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving().
| #define DEFAULT_MAXLPITERQUOT 0.15 |
maximal fraction of diving LP iterations compared to node LP iterations
Definition at line 63 of file heur_adaptivediving.c.
| #define DEFAULT_MAXLPITEROFS 1500L |
additional number of allowed LP iterations
Definition at line 64 of file heur_adaptivediving.c.
| #define DEFAULT_BESTSOLWEIGHT 10.0 |
weight of incumbent solutions compared to other solutions in computation of LP iteration limit
Definition at line 65 of file heur_adaptivediving.c.
Referenced by SCIPincludeHeurAdaptivediving(), updateHeurStatsDiving(), updateHeurStatsLNS(), and updateNeighborhoodStats().
|
static |
get the selection score for this dive set
| diveset | diving settings data structure |
| heurdata | heuristic data |
| divecontext | context for diving statistics |
| scoreptr | pointer to store the score |
Definition at line 97 of file heur_adaptivediving.c.
References assert(), diveset, heurdata, NULL, SCIP_INVALID, SCIP_OKAY, SCIP_PARAMETERWRONGVAL, SCIP_Real, SCIPABORT, SCIPdivesetGetAvgDepth(), SCIPdivesetGetNBacktracks(), SCIPdivesetGetNCalls(), SCIPdivesetGetNConflicts(), SCIPdivesetGetNLPIterations(), SCIPdivesetGetNProbingNodes(), SCIPdivesetGetNSols(), SCIPdivesetGetSolSuccess(), and SCIPerrorMessage.
Referenced by selectDiving().
|
static |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 147 of file heur_adaptivediving.c.
References assert(), HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurAdaptivediving().
| assert | ( | heur ! | = NULL | ) |
| assert | ( | strcmp(SCIPheurGetName(heur), HEUR_NAME) | = =0 | ) |
References HEUR_NAME.
Definition at line 173 of file heur_adaptivediving.c.
References heurdata, NULL, and SCIPfreeBlockMemoryArray.
References heurdata.
Referenced by conshdlrdataFree(), DECL_NHEXIT(), DECL_NHEXIT(), DECL_NHEXIT(), DECL_NHEXIT(), DECL_NHINIT(), DECL_NHINIT(), probdataFree(), runCyckerlin(), SCIP_DECL_BRANCHEXIT(), SCIP_DECL_BRANCHEXITSOL(), SCIP_DECL_BRANCHFREE(), SCIP_DECL_CONSEXIT(), SCIP_DECL_CONSFREE(), SCIP_DECL_CUTSELEXIT(), SCIP_DECL_CUTSELEXIT(), SCIP_DECL_CUTSELEXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXIT(), SCIP_DECL_NLHDLREXIT(), SCIP_DECL_NLPIFREE(), SCIP_DECL_NLPIFREEPROBLEM(), SCIP_DECL_NLPIFREEPROBLEM(), SCIP_DECL_NLPIFREEPROBLEM(), SCIP_DECL_PRICEREXIT(), SCIP_DECL_PROPEXIT(), SCIP_DECL_PROPEXITSOL(), SCIP_DECL_PROPEXITSOL(), SCIP_DECL_READERREAD(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXITSOL(), SCIPpermuteProb(), and SCIPsolveConcurrent().
|
static |
find publicly available divesets and store them
Definition at line 188 of file heur_adaptivediving.c.
References assert(), diveset, DIVESETS_INITIALSIZE, h, heurdata, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPdebugMsg, SCIPdivesetGetName(), SCIPdivesetIsPublic(), SCIPgetHeurs(), SCIPgetNHeurs(), SCIPheurGetDivesets(), SCIPheurGetNDivesets(), and SCIPreallocBlockMemoryArray.
Referenced by if().
| SCIPsetRandomSeed | ( | scip | , |
| heurdata-> | randnumgen, | ||
| (unsigned int)(DEFAULT_INITIALSEED+SCIPgetNOrigVars(scip)+SCIPgetNOrigConss(scip)) | ) |
References DEFAULT_INITIALSEED, heurdata, SCIP_OKAY, and SCIPgetNOrigVars().
Referenced by SCIP_DECL_BRANCHINIT().
|
static |
get LP iteration limit for diving
Definition at line 295 of file heur_adaptivediving.c.
References assert(), heurdata, i, lpiterlimit, ncalls, nlpiterations, nsolsfound, NULL, SCIP_DIVECONTEXT_ADAPTIVE, SCIP_Longint, SCIP_Real, SCIPdivesetGetNLPIterations(), SCIPgetNNodeLPIterations(), SCIPheurGetNBestSolsFound(), SCIPheurGetNCalls(), and SCIPheurGetNSolsFound().
|
static |
sample from a distribution defined by weights
| scip | SCIP data structure |
| rng | random number generator |
| weights | weights of a ground set that define the sampling distribution |
| nweights | number of elements in the ground set |
Definition at line 345 of file heur_adaptivediving.c.
References assert(), SCIP_MAXSTRLEN, SCIP_Real, SCIPdebugMsg, SCIPrandomGetReal(), and w.
Referenced by selectDiving().
|
static |
select the diving method to apply
Definition at line 388 of file heur_adaptivediving.c.
References assert(), divesetGetSelectionScore(), divesets, heurdata, MAX, NULL, sampleWeighted(), SCIP_Bool, SCIP_CALL, SCIP_DIVECONTEXT_ADAPTIVE, SCIP_DIVECONTEXT_TOTAL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPerrorMessage, SCIPfreeBufferArray, SCIPheurGetNCalls(), SCIPisDivesetAvailable(), SCIPrandomGetInt(), SCIPrandomGetReal(), and selection.
| assert | ( | SCIPhasCurrentNodeLP(scip) | ) |
References heurdata.
Definition at line 517 of file heur_adaptivediving.c.
References findAndStoreDivesets(), heurdata, NULL, and SCIP_CALL.
| SCIPdebugMsg | ( | scip | , |
| "heurExecAdaptivediving: depth %d sols %d inf %u node %lld (last dive at %lld)\n" | , | ||
| SCIPgetDepth(scip) | , | ||
| SCIPgetNSols(scip) | , | ||
| nodeinfeasible | , | ||
| SCIPgetNNodes(scip) | , | ||
| SCIPgetLastDivenode(scip) | ) |
| if | ( | nodeinfeasible | ) |
Definition at line 537 of file heur_adaptivediving.c.
References SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, and SCIPdebugMsg.
| if | ( | lpiterlimit<= | 0 | ) |
References lpiterlimit, and SCIP_OKAY.
| SCIPdebugMsg | ( | scip | , |
| "Selected diveset %s\n" | , | ||
| SCIPdivesetGetName(diveset) | ) |
References diveset.
| SCIPperformGenericDivingAlgorithm | ( | scip | , |
| diveset | , | ||
| heurdata-> | sol, | ||
| heur | , | ||
| result | , | ||
| nodeinfeasible | , | ||
| lpiterlimit | , | ||
| - | 1, | ||
| -1. | 0, | ||
| SCIP_DIVECONTEXT_ADAPTIVE | ) |
References diveset, heurdata, lpiterlimit, result, SCIP_DIVECONTEXT_ADAPTIVE, and SCIP_FOUNDSOL.
Referenced by executeDivingHeuristic(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), and SCIP_DECL_HEUREXEC().
| SCIP_RETCODE SCIPincludeHeurAdaptivediving | ( | SCIP * | scip | ) |
creates the adaptivediving heuristic and includes it in SCIP
Definition at line 588 of file heur_adaptivediving.c.
References assert(), DEFAULT_BESTSOLWEIGHT, DEFAULT_EPSILON, DEFAULT_INITIALSEED, DEFAULT_MAXLPITEROFS, DEFAULT_MAXLPITERQUOT, DEFAULT_SCORETYPE, DEFAULT_SELCONFIDENCECOEFF, DEFAULT_SELTYPE, DEFAULT_USEADAPTIVECONTEXT, FALSE, HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, heurdata, NULL, SCIP_CALL, SCIP_CALL_TERMINATE, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPaddBoolParam(), SCIPaddCharParam(), SCIPaddLongintParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPcreateRandom(), SCIPfreeMemory, SCIPheurMarkExact(), SCIPincludeHeurBasic(), SCIPsetHeurCopy(), SCIPsetHeurExit(), SCIPsetHeurFree(), SCIPsetHeurInit(), and TRUE.
Referenced by SCIP_DECL_HEURCOPY(), and SCIPincludeDefaultPlugins().
| heurdata = SCIPheurGetData(heur) |
Definition at line 170 of file heur_adaptivediving.c.
| return SCIP_OKAY |
Definition at line 183 of file heur_adaptivediving.c.
| heurdata lastselection = -1 |
Definition at line 248 of file heur_adaptivediving.c.
| diveset |
execution method of primal heuristic
Definition at line 505 of file heur_adaptivediving.c.
| divesets = heurdata->divesets |
Definition at line 506 of file heur_adaptivediving.c.
Referenced by assert(), assert(), and selectDiving().
| lpiterlimit = getLPIterlimit(scip, heur, heurdata) |
Definition at line 507 of file heur_adaptivediving.c.
Referenced by getLPIterlimit(), if(), SCIPlpiIsIterlimExc(), SCIPlpiIsTimelimExc(), and SCIPperformGenericDivingAlgorithm().
| int selection |
Definition at line 508 of file heur_adaptivediving.c.
Referenced by assert(), determineLimits(), determineVariableFixings(), executeDivingHeuristic(), executeHeuristic(), executeLNSHeuristic(), fixVariables(), getReward(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BANDITSELECT(), SCIP_DECL_BANDITUPDATE(), SCIP_DECL_BANDITUPDATE(), SCIP_DECL_BANDITUPDATE(), SCIP_DECL_BANDITUPDATE(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), selectDiving(), selectDiving(), selectHeuristic(), selectSolsRandomized(), setupAndSolveSubscipCrossover(), solHasNewSource(), and updateSelectionStrategy().
| if result = SCIP_DELAYED |
Definition at line 534 of file heur_adaptivediving.c.