74#if !defined(_WIN32) && !defined(_WIN64)
78#define HEUR_NAME "alns"
79#define HEUR_DESC "Large neighborhood search heuristic that orchestrates the popular neighborhoods Local Branching, RINS, RENS, DINS etc."
80#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_LNS
81#define HEUR_PRIORITY -1100500
84#define HEUR_MAXDEPTH -1
85#define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE | SCIP_HEURTIMING_DURINGLPLOOP
86#define HEUR_USESSUBSCIP TRUE
88#define NNEIGHBORHOODS 9
90#define DEFAULT_SHOWNBSTATS FALSE
95#define DEFAULT_NODESQUOT 0.1
96#define DEFAULT_NODESQUOTMIN 0.0
97#define DEFAULT_NODESOFFSET 500LL
98#define DEFAULT_NSOLSLIM 3
99#define DEFAULT_MINNODES 50LL
100#define DEFAULT_MAXNODES 5000LL
101#define DEFAULT_WAITINGNODES 25LL
102#define DEFAULT_TARGETNODEFACTOR 1.05
105#define DEFAULT_INITDURINGROOT FALSE
106#define DEFAULT_MAXCALLSSAMESOL -1
111#define DEFAULT_MINIMPROVELOW 0.01
112#define DEFAULT_MINIMPROVEHIGH 0.01
113#define MINIMPROVEFAC 1.5
114#define DEFAULT_STARTMINIMPROVE 0.01
115#define DEFAULT_ADJUSTMINIMPROVE FALSE
116#define DEFAULT_ADJUSTTARGETNODES TRUE
121#define DEFAULT_BESTSOLWEIGHT 1
122#define DEFAULT_BANDITALGO 'i'
123#define DEFAULT_REWARDCONTROL 0.8
124#define DEFAULT_SCALEBYEFFORT TRUE
125#define DEFAULT_RESETWEIGHTS TRUE
126#define DEFAULT_SUBSCIPRANDSEEDS FALSE
127#define DEFAULT_REWARDBASELINE 0.5
128#define DEFAULT_FIXTOL 0.1
129#define DEFAULT_UNFIXTOL 0.1
130#define DEFAULT_USELOCALREDCOST FALSE
131#define DEFAULT_BETA 0.0
137#define DEFAULT_EPS 0.4685844
138#define DEFAULT_ALPHA 0.0016
139#define DEFAULT_GAMMA 0.07041455
143#define DEFAULT_USEREDCOST TRUE
144#define DEFAULT_USEPSCOST TRUE
145#define DEFAULT_USEDISTANCES TRUE
146#define DEFAULT_DOMOREFIXINGS TRUE
148#define DEFAULT_ADJUSTFIXINGRATE TRUE
149#define FIXINGRATE_DECAY 0.75
150#define FIXINGRATE_STARTINC 0.2
151#define DEFAULT_USESUBSCIPHEURS FALSE
152#define DEFAULT_COPYCUTS FALSE
153#define DEFAULT_REWARDFILENAME "-"
156#define DEFAULT_SEED 113
157#define MUTATIONSEED 121
158#define CROSSOVERSEED 321
161#define DEFAULT_MINFIXINGRATE_RENS 0.3
162#define DEFAULT_MAXFIXINGRATE_RENS 0.9
163#define DEFAULT_ACTIVE_RENS TRUE
164#define DEFAULT_PRIORITY_RENS 1.0
166#define DEFAULT_MINFIXINGRATE_RINS 0.3
167#define DEFAULT_MAXFIXINGRATE_RINS 0.9
168#define DEFAULT_ACTIVE_RINS TRUE
169#define DEFAULT_PRIORITY_RINS 1.0
171#define DEFAULT_MINFIXINGRATE_MUTATION 0.3
172#define DEFAULT_MAXFIXINGRATE_MUTATION 0.9
173#define DEFAULT_ACTIVE_MUTATION TRUE
174#define DEFAULT_PRIORITY_MUTATION 1.0
176#define DEFAULT_MINFIXINGRATE_LOCALBRANCHING 0.3
177#define DEFAULT_MAXFIXINGRATE_LOCALBRANCHING 0.9
178#define DEFAULT_ACTIVE_LOCALBRANCHING TRUE
179#define DEFAULT_PRIORITY_LOCALBRANCHING 1.0
181#define DEFAULT_MINFIXINGRATE_PROXIMITY 0.3
182#define DEFAULT_MAXFIXINGRATE_PROXIMITY 0.9
183#define DEFAULT_ACTIVE_PROXIMITY TRUE
184#define DEFAULT_PRIORITY_PROXIMITY 1.0
186#define DEFAULT_MINFIXINGRATE_CROSSOVER 0.3
187#define DEFAULT_MAXFIXINGRATE_CROSSOVER 0.9
188#define DEFAULT_ACTIVE_CROSSOVER TRUE
189#define DEFAULT_PRIORITY_CROSSOVER 1.0
191#define DEFAULT_MINFIXINGRATE_ZEROOBJECTIVE 0.3
192#define DEFAULT_MAXFIXINGRATE_ZEROOBJECTIVE 0.9
193#define DEFAULT_ACTIVE_ZEROOBJECTIVE TRUE
194#define DEFAULT_PRIORITY_ZEROOBJECTIVE 1.0
196#define DEFAULT_MINFIXINGRATE_DINS 0.3
197#define DEFAULT_MAXFIXINGRATE_DINS 0.9
198#define DEFAULT_ACTIVE_DINS TRUE
199#define DEFAULT_PRIORITY_DINS 1.0
201#define DEFAULT_MINFIXINGRATE_TRUSTREGION 0.3
202#define DEFAULT_MAXFIXINGRATE_TRUSTREGION 0.9
203#define DEFAULT_ACTIVE_TRUSTREGION FALSE
204#define DEFAULT_PRIORITY_TRUSTREGION 1.0
207#define DEFAULT_NSOLS_CROSSOVER 2
208#define DEFAULT_NPOOLSOLS_DINS 5
209#define DEFAULT_VIOLPENALTY_TRUSTREGION 100.0
212#define EVENTHDLR_NAME "Alns"
213#define EVENTHDLR_DESC "LP event handler for " HEUR_NAME " heuristic"
214#define SCIP_EVENTTYPE_ALNS (SCIP_EVENTTYPE_LPSOLVED | SCIP_EVENTTYPE_SOLFOUND | SCIP_EVENTTYPE_BESTSOLFOUND)
217#define TABLE_NAME_NEIGHBORHOOD "neighborhood"
218#define TABLE_DESC_NEIGHBORHOOD "ALNS neighborhood statistics"
219#define TABLE_POSITION_NEIGHBORHOOD 12500
220#define TABLE_EARLIEST_STAGE_NEIGHBORHOOD SCIP_STAGE_TRANSFORMED
261 #define DECL_VARFIXINGS(x) SCIP_RETCODE x ( \
267 SCIP_RESULT* result \
278#define DECL_CHANGESUBSCIP(x) SCIP_RETCODE x ( \
282 SCIP_VAR** subvars, \
290#define DECL_NHINIT(x) SCIP_RETCODE x ( \
296#define DECL_NHEXIT(x) SCIP_RETCODE x ( \
302#define DECL_NHFREE(x) SCIP_RETCODE x ( \
315#define DECL_NHREFSOL(x) SCIP_RETCODE x ( \
319 SCIP_RESULT* result \
323#define DECL_NHDEACTIVATE(x) SCIP_RETCODE x (\
325 SCIP_Bool* deactivate \
340#define NHISTENTRIES 7
424 char* rewardfilename;
426 SCIP_Longint nodesoffset;
427 SCIP_Longint maxnodes;
428 SCIP_Longint targetnodes;
429 SCIP_Longint minnodes;
431 SCIP_Longint waitingnodes;
433 SCIP_Real nodesquotmin;
434 SCIP_Real startminimprove;
435 SCIP_Real minimprovelow;
436 SCIP_Real minimprovehigh;
437 SCIP_Real minimprove;
439 SCIP_Real exp3_gamma;
441 SCIP_Real epsgreedy_eps;
443 SCIP_Real rewardcontrol;
445 SCIP_Real targetnodefactor;
446 SCIP_Real rewardbaseline;
450 int nactiveneighborhoods;
451 int ninitneighborhoods;
454 int currneighborhood;
458 SCIP_Longint firstcallthissol;
460 SCIP_Bool useredcost;
461 SCIP_Bool usedistances;
463 SCIP_Bool domorefixings;
465 SCIP_Bool adjustfixingrate;
466 SCIP_Bool usesubscipheurs;
467 SCIP_Bool adjustminimprove;
468 SCIP_Bool adjusttargetnodes;
469 SCIP_Bool resetweights;
470 SCIP_Bool subsciprandseeds;
471 SCIP_Bool scalebyeffort;
473 SCIP_Bool uselocalredcost;
474 SCIP_Bool initduringroot;
475 SCIP_Bool shownbstats;
484 SCIP_Longint nodelimit;
487 SCIP_Bool allrewardsmode;
595 switch (subscipstatus)
660 switch (subscipstatus)
739 switch (subscipstatus)
807 SCIP_Real minfixingrate,
808 SCIP_Real maxfixingrate,
835 (*neighborhood)->changesubscip = changesubscip;
836 (*neighborhood)->varfixings = varfixings;
837 (*neighborhood)->nhinit = nhinit;
838 (*neighborhood)->nhexit = nhexit;
839 (*neighborhood)->nhfree = nhfree;
840 (*neighborhood)->nhrefsol = nhrefsol;
841 (*neighborhood)->nhdeactivate = nhdeactivate;
846 &(*neighborhood)->fixingrate.minfixingrate,
TRUE, minfixingrate, 0.0, 1.0,
NULL,
NULL) );
849 &(*neighborhood)->fixingrate.maxfixingrate,
TRUE, maxfixingrate, 0.0, 1.0,
NULL,
NULL) );
855 &(*neighborhood)->priority,
TRUE, priority, 1e-2, 1.0,
NULL,
NULL) );
874 nhptr = *neighborhood;
880 if( nhptr->nhfree !=
NULL )
889 *neighborhood =
NULL;
905 if( neighborhood->nhinit !=
NULL )
923 if( neighborhood->nhexit !=
NULL )
952 sourcescip = eventdata->sourcescip;
953 subvars = eventdata->subvars;
954 heur = eventdata->heur;
955 runstats = eventdata->runstats;
957 assert(sourcescip != subscip);
969 if( eventdata->allrewardsmode )
1076 switch (subscipstatus)
1111 SCIPinfoMessage(
scip, file,
"Neighborhoods : %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %4s %4s %4s %4s %4s %4s %4s %4s\n",
1112 "Calls",
"SetupTime",
"SolveTime",
"SolveNodes",
"Sols",
"Best",
"Exp3",
"Exp3-IX",
"EpsGreedy",
"UCB",
"TgtFixRate",
1113 "Opt",
"Inf",
"Node",
"Stal",
"Sol",
"Usr",
"Othr",
"Actv");
1122 SCIP_Real epsgreedyweight;
1124 neighborhood =
heurdata->neighborhoods[
i];
1136 epsgreedyweight = -1.0;
1183 stats = &neighborhood->
stats;
1246 else if( dist1 > dist2 )
1288 SCIP_Real refsolval,
1289 SCIP_Bool uselocalredcost
1292 SCIP_Real bestbound;
1302 if( ! uselocalredcost )
1327 score = redcost * (refsolval - bestbound);
1330 if( ! uselocalredcost )
1331 score =
MAX(score, 0.0);
1341 SCIP_Real refsolval,
1342 SCIP_Bool uselocallpsol
1395 varbuf[*nfixings] =
var;
1396 valbuf[*nfixings] = val;
1414 if( neighborhood->nhrefsol !=
NULL )
1450 SCIP_Real* redcostscores;
1451 SCIP_Real* pscostscores;
1458 SCIP_Real* randscores;
1484 if( ntargetfixings >= nbinintvars )
1488 nvarstoadd = ntargetfixings - *nfixings;
1489 if( nvarstoadd == 0 )
1522 for(
b = 0;
b < *nfixings; ++
b )
1530 if( probindex < nbinintvars )
1531 isfixed[probindex] =
TRUE;
1538 for(
b = 0;
b < nbinintvars; ++
b )
1553 unfixedvars[nunfixedvars] =
var;
1554 perm[nunfixedvars] = nunfixedvars;
1558 solvals[nunfixedvars] = solvals[
b];
1559 distances[nunfixedvars] = distances[
b];
1561 SCIPdebugMsg(
scip,
"Var <%s> scores: dist %3d, red cost %15.9g, pscost %15.9g rand %6.4f\n",
1563 pscostscores[nunfixedvars], randscores[nunfixedvars]);
1574 nvarstoadd =
MIN(nunfixedvars, nvarstoadd);
1577 if( nvarstoadd < nunfixedvars )
1578 SCIPselectInd(perm, sortIndCompAlns, &varprio, nvarstoadd, nunfixedvars);
1581 for(
b = 0;
b < nvarstoadd; ++
b )
1583 int permindex = perm[
b];
1585 assert(permindex < nunfixedvars);
1610 SCIP_Real* priorities,
1611 unsigned int initseed
1628 heurdata->nactiveneighborhoods, initseed) );
1679 SCIP_Real* redcostscores;
1680 SCIP_Real* pscostscores;
1681 SCIP_Real* randscores;
1684 SCIP_Real* valbufcpy;
1685 SCIP_Bool* isfixedvar;
1689 int* fixeddistances;
1699 if( nbinintvars == 0 )
1722 for(
i = 0;
i < *nfixings; ++
i )
1728 isfixedvar[probindex] =
TRUE;
1734 for(
i = 0;
i < nbinintvars; ++
i )
1736 if( ! isfixedvar[
i] )
1737 unfixedvars[nunfixed++] =
vars[
i];
1747 for(
i = 0;
i < *nfixings; ++
i )
1750 if( probindex >= 0 )
1751 fixeddistances[
i] = distances[probindex];
1761 for(
i = 0;
i < *nfixings; ++
i )
1764 SCIP_Real fixval = valbuf[
i];
1772 SCIPdebugMsg(
scip,
"Var <%s> scores: dist %3d, red cost %15.9g, pscost %15.9g rand %6.4f\n",
1773 SCIPvarGetName(fixedvar), fixeddistances[
i], redcostscores[
i], pscostscores[
i], randscores[
i]);
1788 for(
i = 0;
i < ntargetfixings; ++
i )
1790 valbuf[
i] = valbufcpy[perm[
i]];
1791 varbuf[
i] = varbufcpy[perm[
i]];
1794 *nfixings = ntargetfixings;
1842 if( neighborhood->varfixings !=
NULL )
1844 SCIP_CALL( neighborhood->varfixings(
scip, neighborhood, varbuf, valbuf, nfixings,
result) );
1849 else if( ntargetfixings == 0 )
1861 nminfixings =
MAX(nminfixings, 0);
1863 nmaxfixings =
MIN(nmaxfixings, nbinintvars);
1865 SCIPdebugMsg(
scip,
"Neighborhood Fixings/Target: %d / %d <= %d <= %d\n",*nfixings, nminfixings, ntargetfixings, nmaxfixings);
1877 if( refsol !=
NULL )
1891 SCIPdebugMsg(
scip,
"After additional fixings: %d / %d\n",*nfixings, ntargetfixings);
1893 else if( (SCIP_Real)(*nfixings) > nmaxfixings )
1901 SCIPdebugMsg(
scip,
"Unfixed variables, fixed variables remaining: %d\n", ntargetfixings);
1939 if( neighborhood->changesubscip !=
NULL )
1941 SCIP_CALL( neighborhood->changesubscip(sourcescip, targetscip, neighborhood, targetvars, ndomchgs, nchgobjs, naddedconss, success) );
1981 SCIP_Real initfactor;
1982 SCIP_Real nodesquot;
1983 SCIP_Bool avoidmemout;
2017 nodesquot =
MAX(nodesquot,
heurdata->nodesquotmin);
2028 initfactor = (
heurdata->nactiveneighborhoods -
heurdata->ninitneighborhoods + 1.0) / (
heurdata->nactiveneighborhoods + 1.0);
2054 int* neighborhoodidx
2062 *neighborhoodidx = -1;
2067 assert(*neighborhoodidx >= 0);
2078 SCIP_Real* rewardptr
2081 SCIP_Real reward = 0.0;
2085 memset(rewardptr, 0,
sizeof(*rewardptr)*(
int)
NREWARDTYPES);
2095 if( ndiscretevars > 0 )
2104 SCIP_Real rewardcontrol =
heurdata->rewardcontrol;
2129 reward /= (effort + 1.0);
2132 reward =
heurdata->rewardbaseline + (1.0 -
heurdata->rewardbaseline) * reward;
2137 SCIP_Real maxeffort =
heurdata->targetnodes;
2140 if( ndiscretevars > 0 )
2165 assert(neighborhoodidx >= 0);
2166 assert(neighborhoodidx < heurdata->nactiveneighborhoods);
2170 SCIPdebugMsg(
scip,
"Rewarding bandit algorithm action %d with reward %.2f\n", neighborhoodidx, reward);
2189 SCIP_Real upperbound;
2202#ifdef ALNS_SUBSCIPOUTPUT
2321 SCIPdebugMsg(
scip,
"Solve Limits: %lld (%lld) nodes (stall nodes), %.1f sec., %d sols\n",
2342 int neighborhoodidx;
2349 SCIP_Bool allrewardsmode;
2360 if(
heurdata->nactiveneighborhoods == 0 )
2375 if(
heurdata->maxcallssamesol != -1 )
2377 SCIP_Longint samesollimit = (
heurdata->maxcallssamesol > 0) ?
2415 if( allrewardsmode )
2429 SCIPdebugMsg(
scip,
"Delay ALNS heuristic until a feasible node with optimally solved LP relaxation\n");
2436 if(
heurdata->currneighborhood >= 0 )
2438 assert(! allrewardsmode);
2439 banditidx =
heurdata->currneighborhood;
2445 SCIPdebugMsg(
scip,
"Selected neighborhood %d with bandit algorithm\n", banditidx);
2449 if( ! allrewardsmode )
2450 neighborhoodidx = banditidx;
2452 neighborhoodidx = 0;
2471 SCIP_Real allfixingrate;
2480 neighborhood =
heurdata->neighborhoods[neighborhoodidx];
2505 if( allrewardsmode )
2507 if( ntries ==
heurdata->nactiveneighborhoods )
2510 neighborhoodidx = (neighborhoodidx + 1) %
heurdata->nactiveneighborhoods;
2529 else if(
heurdata->currneighborhood == -1 )
2531 heurdata->currneighborhood = neighborhoodidx;
2542 if( ntries < heurdata->nactiveneighborhoods )
2549 SCIPdebugMsg(
scip,
"Neighborhood cannot run -> try next neighborhood %d\n", neighborhoodidx);
2564 runstats[neighborhoodidx].
nfixings = nfixings;
2571 SCIP_CALL(
SCIPcopyLargeNeighborhoodSearch(
scip, subscip, varmapf, probnamesuffix, varbuf, valbuf, nfixings,
FALSE,
heurdata->copycuts, &success,
NULL) );
2574 for( v = 0; v <
nvars; ++v )
2588 if( ! allrewardsmode || ntries ==
heurdata->nactiveneighborhoods )
2591 neighborhoodidx = (neighborhoodidx + 1) %
heurdata->nactiveneighborhoods;
2604 eventdata.nodelimit = solvelimits.
nodelimit;
2605 eventdata.lplimfac =
heurdata->lplimfac;
2606 eventdata.heur = heur;
2607 eventdata.sourcescip =
scip;
2608 eventdata.subvars = subvars;
2609 eventdata.runstats = &runstats[neighborhoodidx];
2610 eventdata.allrewardsmode = allrewardsmode;
2627 SCIPwarningMessage(
scip,
"Error while presolving subproblem in ALNS heuristic; sub-SCIP terminated with code <%d>\n", retcode);
2638 allfixingrate =
MAX(allfixingrate, 0.0);
2647 SCIPdebugMsg(
scip,
"Fixed only %.3f of all variables after presolving -> do not solve sub-SCIP\n", allfixingrate);
2650#ifdef ALNS_SUBSCIPOUTPUT
2659 SCIPdebugMsg(
scip,
"Status of sub-SCIP run: %d\n", subscipstatus[neighborhoodidx]);
2664 if( allrewardsmode && ntries < heurdata->nactiveneighborhoods )
2666 neighborhoodidx = (neighborhoodidx + 1) %
heurdata->nactiveneighborhoods;
2675 if( subscip !=
NULL )
2685 if( ! allrewardsmode )
2686 banditidx = neighborhoodidx;
2702 if(
heurdata->adjustfixingrate && ! allrewardsmode )
2729 if( allrewardsmode )
2733 for(
i = 0;
i <
heurdata->nactiveneighborhoods; ++
i )
2734 fprintf(
heurdata->rewardfile,
"%.4f,", rewards[
i][j]);
2736 fprintf(
heurdata->rewardfile,
"%d\n", banditidx);
2750 int *fracidx =
NULL;
2794 fracidx[nfracs++] =
i;
2839 if( subvars[
i] ==
NULL )
2844 SCIP_Real newlb =
SCIPfloor(sourcescip, lpsolval);
2845 SCIP_Real newub = newlb + 1.0;
2896 nvars = nbinintvars;
2902 for( v = 0; v <
nvars; ++v )
2913 for( s = 1; s < nsols; ++s )
2955 if( incumbent ==
NULL )
2969 sols[1] = incumbent;
3040 nsols = data->
nsols;
3064 if( lastdraw == nsols )
3069 for( s = 0; s < nsols; ++s )
3070 sols[s] = scipsols[s];
3078 assert(nsols < lastdraw);
3084 sols[nsols - 1] = scipsols[nextdraw];
3086 lastdraw = nextdraw;
3174 SCIP_Real targetfixingrate;
3188 if( nbinintvars == 0 )
3192 if( incumbentsol ==
NULL )
3196 ntargetfixings = (int)(targetfixingrate * nbinintvars) + 1;
3199 if( nbinintvars <= ntargetfixings )
3208 for(
i = 0; *nfixings < ntargetfixings &&
i < nbinintvars; ++
i )
3211 assert(randint < nbinintvars);
3221 assert(
i == nbinintvars || *nfixings == ntargetfixings);
3228 if( *nfixings == ntargetfixings )
3253 SCIP_Real* consvals;
3266 if( referencesol ==
NULL )
3270 rhs =
MAX(rhs, 2.0);
3278 if( subvars[
i] ==
NULL )
3330 if( referencesol ==
NULL )
3339 if( subvars[
i] ==
NULL )
3353 if( subvars[
i] ==
NULL )
3393 if( subvars[
i] ==
NULL )
3434 if(
REALABS(lpsol - mipsol) >= 0.5 )
3442 range = 2 * lpsol - mipsol;
3444 if( mipsol >= lpsol )
3447 *lbptr =
MAX(*lbptr, range);
3458 *ubptr =
MIN(*ubptr, range);
3468 *lbptr =
MAX(*lbptr, lbglobal);
3469 *ubptr =
MIN(*ubptr, ubglobal);
3474 *lbptr =
MAX(mipsol, lbglobal);
3475 *ubptr =
MIN(mipsol, ubglobal);
3522 nsols = nmipsols + 2;
3526 sols[1] = rootlpsol;
3578 if( subvars[v] ==
NULL )
3628 SCIPdebugMsg(sourcescip,
"changeSubscipTrustregion unsuccessful, because it was called without incumbent being present\n");
3729 varFixingsRens, changeSubscipRens,
NULL,
NULL,
NULL,
NULL, nhDeactivateDiscreteVars) );
3734 varFixingsRins,
NULL,
NULL,
NULL,
NULL, nhRefsolIncumbent, nhDeactivateDiscreteVars) );
3739 varFixingsMutation,
NULL, nhInitMutation, nhExitMutation,
NULL, nhRefsolIncumbent, nhDeactivateDiscreteVars) );
3744 NULL, changeSubscipLocalbranching,
NULL,
NULL,
NULL, nhRefsolIncumbent, nhDeactivateBinVars) );
3749 varFixingsCrossover,
NULL,
3750 nhInitCrossover, nhExitCrossover, nhFreeCrossover, nhRefsolCrossover, nhDeactivateDiscreteVars) );
3763 NULL, changeSubscipProximity,
NULL,
NULL,
NULL, nhRefsolIncumbent, nhDeactivateBinVars) );
3768 NULL, changeSubscipZeroobjective,
NULL,
NULL,
NULL, nhRefsolIncumbent, nhDeactivateObjVars) );
3773 varFixingsDins, changeSubscipDins,
NULL,
NULL, nhFreeDins, nhRefsolIncumbent, nhDeactivateBinVars) );
3780 "number of pool solutions where binary solution values must agree",
3786 NULL, changeSubscipTrustregion,
NULL,
NULL, nhFreeTrustregion, nhRefsolIncumbent, nhDeactivateBinVars) );
3792 "the penalty for each change in the binary variables from the candidate solution",
3852 SCIP_Real* priorities;
3853 unsigned int initseed;
3865 for(
i =
heurdata->nneighborhoods - 1;
i >= 0; --
i )
3868 SCIP_Bool deactivate;
3873 if( deactivate || ! neighborhood->
active )
3875 if(
heurdata->nactiveneighborhoods - 1 >
i )
3885 for(
i = 0;
i <
heurdata->nactiveneighborhoods; ++
i )
3886 priorities[
i] =
heurdata->neighborhoods[
i]->priority;
3898 if(
heurdata->nactiveneighborhoods > 0 )
4049 "show statistics on neighborhoods?",
4054 "maximum number of nodes to regard in the subproblem",
4058 "offset added to the nodes budget",
4062 "minimum number of nodes required to start a sub-SCIP",
4066 "number of nodes since last incumbent solution that the heuristic should wait",
4070 "fraction of nodes compared to the main SCIP for budget computation",
4073 "lower bound fraction of nodes compared to the main SCIP for budget computation",
4077 "initial factor by which ALNS should at least improve the incumbent",
4081 "lower threshold for the minimal improvement over the incumbent",
4085 "upper bound for the minimal improvement over the incumbent",
4089 "limit on the number of improving solutions in a sub-SCIP call",
4093 "the bandit algorithm: (u)pper confidence bounds, (e)xp.3, epsilon (g)reedy, exp.3-(i)x",
4097 "weight between uniform (gamma ~ 1) and weight driven (gamma ~ 0) probability distribution for exp3",
4101 "reward offset between 0 and 1 at every observation for Exp.3",
4105 "parameter to increase the confidence width in UCB",
4109 "distances from fixed variables be used for variable prioritization",
4113 "should reduced cost scores be used for variable prioritization?",
4117 "should the ALNS heuristic do more fixings by itself based on variable prioritization "
4118 "until the target fixing rate is reached?",
4122 "should the heuristic adjust the target fixing rate based on the success?",
4126 "should the heuristic activate other sub-SCIP heuristics during its search?",
4130 "reward control to increase the weight of the simple solution indicator and decrease the weight of the closed gap reward",
4134 "factor by which target node number is eventually increased",
4138 "initial random seed for bandit algorithms and random decisions by neighborhoods",
4141 "number of allowed executions of the heuristic on the same incumbent solution (-1: no limit, 0: number of active neighborhoods)",
4145 "should the factor by which the minimum improvement is bound be dynamically updated?",
4149 "should the target nodes be dynamically adjusted?",
4153 "increase exploration in epsilon-greedy bandit algorithm",
4157 "the reward baseline to separate successful and failed calls",
4161 "should the bandit algorithms be reset when a new problem is read?",
4168 "should random seeds of sub-SCIPs be altered to increase diversification?",
4172 "should the reward be scaled by the effort?",
4176 "should cutting planes be copied to the sub-SCIP?",
4180 "tolerance by which the fixing rate may be missed without generic fixing",
4184 "tolerance by which the fixing rate may be exceeded without generic unfixing",
4188 "should local reduced costs be used for generic (un)fixing?",
4192 "should pseudo cost scores be used for variable priorization?",
4196 "should the heuristic be executed multiple times during the root node?",
static GRAPHNODE ** active
Constraint handler for linear constraints in their most general form, .
#define SCIP_CALL_ABORT(x)
#define SCIP_LONGINT_FORMAT
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPtranslateSubSol(SCIP *scip, SCIP *subscip, SCIP_SOL *subsol, SCIP_HEUR *heur, SCIP_VAR **subvars, SCIP_SOL **newsol)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
int SCIPgetNObjVars(SCIP *scip)
int SCIPgetNIntVars(SCIP *scip)
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
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)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
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)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
void SCIPswapPointers(void **pointer1, void **pointer2)
SCIP_RETCODE SCIPincludeHeurAlns(SCIP *scip)
SCIP_RETCODE SCIPresetBandit(SCIP *scip, SCIP_BANDIT *bandit, SCIP_Real *priorities, unsigned int seed)
SCIP_RETCODE SCIPbanditUpdate(SCIP_BANDIT *bandit, int action, SCIP_Real score)
int SCIPbanditGetNActions(SCIP_BANDIT *bandit)
SCIP_Real SCIPgetProbabilityExp3IX(SCIP_BANDIT *exp3ix, int action)
SCIP_Real * SCIPgetWeightsEpsgreedy(SCIP_BANDIT *epsgreedy)
SCIP_RANDNUMGEN * SCIPbanditGetRandnumgen(SCIP_BANDIT *bandit)
SCIP_RETCODE SCIPcreateBanditExp3(SCIP *scip, SCIP_BANDIT **exp3, SCIP_Real *priorities, SCIP_Real gammaparam, SCIP_Real beta, int nactions, unsigned int initseed)
SCIP_RETCODE SCIPcreateBanditEpsgreedy(SCIP *scip, SCIP_BANDIT **epsgreedy, SCIP_Real *priorities, SCIP_Real eps, SCIP_Bool usemodification, SCIP_Bool preferrecent, SCIP_Real decayfactor, int avglim, int nactions, unsigned int initseed)
SCIP_Real SCIPgetConfidenceBoundUcb(SCIP_BANDIT *ucb, int action)
SCIP_RETCODE SCIPcreateBanditExp3IX(SCIP *scip, SCIP_BANDIT **exp3ix, SCIP_Real *priorities, int nactions, unsigned int initseed)
SCIP_RETCODE SCIPbanditSelect(SCIP_BANDIT *bandit, int *action)
SCIP_RETCODE SCIPcreateBanditUcb(SCIP *scip, SCIP_BANDIT **ucb, SCIP_Real *priorities, SCIP_Real alpha, int nactions, unsigned int initseed)
SCIP_RETCODE SCIPfreeBandit(SCIP *scip, SCIP_BANDIT **bandit)
SCIP_Real SCIPgetProbabilityExp3(SCIP_BANDIT *exp3, int action)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur,)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur,)
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur,)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
int SCIPheurGetFreq(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur,)
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur,)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
int SCIPgetNSols(SCIP *scip)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
SCIP_RETCODE SCIPpresolve(SCIP *scip)
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPaddTrustregionNeighborhoodConstraint(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **subvars, SCIP_Real violpenalty)
SCIP_RETCODE SCIPcopyLargeNeighborhoodSearch(SCIP *sourcescip, SCIP *subscip, SCIP_HASHMAP *varmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool uselprows, SCIP_Bool copycuts, SCIP_Bool *success, SCIP_Bool *valid)
SCIP_TABLE * SCIPfindTable(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeTable(SCIP *scip, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPvariablegraphBreadthFirst(SCIP *scip, SCIP_VGRAPH *vargraph, SCIP_VAR **startvars, int nstartvars, int *distances, int maxdistance, int maxvars, int maxbinintvars)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetBestRootSol(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetRootSol(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPgetVarRedcost(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Real SCIPvarGetBestRootRedcost(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
void SCIPselectInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int k, int len)
void SCIPselectDownInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int k, int len)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeSol(scip, &heurdata->sol))
SCIPcreateSol(scip, &heurdata->sol, heur))
SCIPfreeRandom(scip, &heurdata->randnumgen)
static void tryAdd2variableBuffer(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_VAR **varbuf, SCIP_Real *valbuf, int *nfixings, SCIP_Bool integer)
static void updateRunStats(NH_STATS *stats, SCIP *subscip)
#define DEFAULT_ACTIVE_MUTATION
#define DEFAULT_MINFIXINGRATE_ZEROOBJECTIVE
static SCIP_RETCODE alnsFixMoreVariables(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *refsol, SCIP_VAR **varbuf, SCIP_Real *valbuf, int *nfixings, int ntargetfixings, SCIP_Bool *success)
static SCIP_RETCODE alnsFreeNeighborhood(SCIP *scip, NH **neighborhood)
#define TABLE_POSITION_NEIGHBORHOOD
#define DEFAULT_NODESQUOT
static void increaseFixingRate(NH_FIXINGRATE *fx)
#define DEFAULT_MINIMPROVEHIGH
#define DEFAULT_MAXCALLSSAMESOL
#define DECL_NHDEACTIVATE(x)
static SCIP_RETCODE neighborhoodStatsReset(SCIP *scip, NH_STATS *stats)
#define DEFAULT_MINIMPROVELOW
#define DEFAULT_REWARDBASELINE
#define DEFAULT_PRIORITY_RENS
#define DEFAULT_ACTIVE_PROXIMITY
#define DEFAULT_NODESQUOTMIN
#define DEFAULT_MINFIXINGRATE_DINS
#define DEFAULT_ACTIVE_RINS
static void updateNeighborhoodStats(NH_STATS *runstats, NH *neighborhood, SCIP_STATUS subscipstatus)
#define TABLE_NAME_NEIGHBORHOOD
static SCIP_RETCODE neighborhoodGetRefsol(SCIP *scip, NH *neighborhood, SCIP_SOL **solptr)
#define DEFAULT_USEREDCOST
#define DEFAULT_ADJUSTFIXINGRATE
#define DEFAULT_ADJUSTMINIMPROVE
static void decreaseFixingRate(NH_FIXINGRATE *fx)
static void increaseMinimumImprovement(SCIP_HEURDATA *heurdata)
static SCIP_RETCODE updateBanditAlgorithm(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Real reward, int neighborhoodidx)
#define FIXINGRATE_STARTINC
static void resetMinimumImprovement(SCIP_HEURDATA *heurdata)
#define DEFAULT_MAXFIXINGRATE_RENS
#define DEFAULT_PRIORITY_PROXIMITY
static void resetTargetNodeLimit(SCIP_HEURDATA *heurdata)
static SCIP_RETCODE neighborhoodInit(SCIP *scip, NH *neighborhood)
#define DEFAULT_STARTMINIMPROVE
static SCIP_RETCODE alnsIncludeNeighborhood(SCIP *scip, SCIP_HEURDATA *heurdata, NH **neighborhood, const char *name, SCIP_Real minfixingrate, SCIP_Real maxfixingrate, SCIP_Bool active, SCIP_Real priority, DECL_VARFIXINGS((*varfixings)), DECL_CHANGESUBSCIP((*changesubscip)), DECL_NHINIT((*nhinit)), DECL_NHEXIT((*nhexit)), DECL_NHFREE((*nhfree)), DECL_NHREFSOL((*nhrefsol)),)
#define DEFAULT_ACTIVE_TRUSTREGION
#define DEFAULT_MINFIXINGRATE_RENS
#define DEFAULT_MAXFIXINGRATE_DINS
#define DEFAULT_MINFIXINGRATE_RINS
#define DEFAULT_PRIORITY_ZEROOBJECTIVE
static void updateMinimumImprovement(SCIP_HEURDATA *heurdata, SCIP_STATUS subscipstatus, NH_STATS *runstats)
#define DEFAULT_WAITINGNODES
#define DEFAULT_NODESOFFSET
#define TABLE_DESC_NEIGHBORHOOD
#define DECL_CHANGESUBSCIP(x)
@ REWARDTYPE_NOSOLPENALTY
#define DEFAULT_RESETWEIGHTS
static void increaseTargetNodeLimit(SCIP_HEURDATA *heurdata)
#define DEFAULT_MAXFIXINGRATE_MUTATION
#define TABLE_EARLIEST_STAGE_NEIGHBORHOOD
#define DEFAULT_ADJUSTTARGETNODES
static void updateTargetNodeLimit(SCIP_HEURDATA *heurdata, NH_STATS *runstats, SCIP_STATUS subscipstatus)
#define DEFAULT_USELOCALREDCOST
#define DEFAULT_MAXFIXINGRATE_TRUSTREGION
#define DEFAULT_MAXFIXINGRATE_ZEROOBJECTIVE
static void updateFixingRate(NH *neighborhood, SCIP_STATUS subscipstatus, NH_STATS *runstats)
static void initRunStats(SCIP *scip, NH_STATS *stats)
static SCIP_BANDIT * getBandit(SCIP_HEURDATA *heurdata)
static SCIP_RETCODE selectNeighborhood(SCIP *scip, SCIP_HEURDATA *heurdata, int *neighborhoodidx)
#define DEFAULT_ACTIVE_RENS
static void updateFixingRateIncrement(NH_FIXINGRATE *fx)
#define DEFAULT_MINFIXINGRATE_CROSSOVER
static SCIP_RETCODE addLocalBranchingConstraint(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **subvars, int distance, SCIP_Bool *success, int *naddedconss)
#define DEFAULT_REWARDCONTROL
#define DEFAULT_ACTIVE_ZEROOBJECTIVE
#define DEFAULT_MINFIXINGRATE_LOCALBRANCHING
#define SCIP_EVENTTYPE_ALNS
static SCIP_RETCODE determineLimits(SCIP *scip, SCIP_HEUR *heur, SOLVELIMITS *solvelimits, SCIP_Bool *runagain)
#define DEFAULT_PRIORITY_CROSSOVER
#define DEFAULT_DOMOREFIXINGS
static SCIP_RETCODE setLimits(SCIP *subscip, SOLVELIMITS *solvelimits)
#define DEFAULT_INITDURINGROOT
#define DEFAULT_VIOLPENALTY_TRUSTREGION
static SCIP_RETCODE resetFixingRate(SCIP *scip, NH_FIXINGRATE *fixingrate)
#define DEFAULT_ACTIVE_LOCALBRANCHING
static void decreaseMinimumImprovement(SCIP_HEURDATA *heurdata)
static SCIP_RETCODE fixMatchingSolutionValues(SCIP *scip, SCIP_SOL **sols, int nsols, SCIP_VAR **vars, int nvars, SCIP_VAR **varbuf, SCIP_Real *valbuf, int *nfixings)
#define DEFAULT_PRIORITY_MUTATION
#define DEFAULT_PRIORITY_RINS
#define DEFAULT_REWARDFILENAME
static SCIP_Real getVariablePscostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real refsolval, SCIP_Bool uselocallpsol)
static int getHistIndex(SCIP_STATUS subscipstatus)
#define DEFAULT_ACTIVE_DINS
#define DEFAULT_PRIORITY_TRUSTREGION
#define DEFAULT_MAXFIXINGRATE_LOCALBRANCHING
#define DEFAULT_SUBSCIPRANDSEEDS
#define DEFAULT_NPOOLSOLS_DINS
static void computeIntegerVariableBoundsDins(SCIP *scip, SCIP_VAR *var, SCIP_Real *lbptr, SCIP_Real *ubptr)
#define DEFAULT_MAXFIXINGRATE_RINS
static SCIP_RETCODE includeNeighborhoods(SCIP *scip, SCIP_HEURDATA *heurdata)
#define DEFAULT_MINFIXINGRATE_MUTATION
#define DEFAULT_TARGETNODEFACTOR
#define DEFAULT_MAXFIXINGRATE_CROSSOVER
#define DEFAULT_NSOLS_CROSSOVER
#define DEFAULT_USEDISTANCES
#define DEFAULT_SCALEBYEFFORT
static void resetCurrentNeighborhood(SCIP_HEURDATA *heurdata)
static SCIP_RETCODE getReward(SCIP *scip, SCIP_HEURDATA *heurdata, NH_STATS *runstats, SCIP_Real *rewardptr)
static SCIP_Real getVariableRedcostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real refsolval, SCIP_Bool uselocalredcost)
#define DEFAULT_SHOWNBSTATS
static SCIP_RETCODE alnsUnfixVariables(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **varbuf, SCIP_Real *valbuf, int *nfixings, int ntargetfixings, SCIP_Bool *success)
static SCIP_RETCODE neighborhoodExit(SCIP *scip, NH *neighborhood)
#define DEFAULT_ACTIVE_CROSSOVER
#define DEFAULT_USESUBSCIPHEURS
#define DEFAULT_PRIORITY_DINS
static void printNeighborhoodStatistics(SCIP *scip, SCIP_HEURDATA *heurdata, FILE *file)
static SCIP_RETCODE setupSubScip(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SOLVELIMITS *solvelimits, SCIP_HEUR *heur, SCIP_Bool objchgd)
#define DEFAULT_MAXFIXINGRATE_PROXIMITY
static SCIP_RETCODE neighborhoodChangeSubscip(SCIP *sourcescip, SCIP *targetscip, NH *neighborhood, SCIP_VAR **targetvars, int *ndomchgs, int *nchgobjs, int *naddedconss, SCIP_Bool *success)
#define DECL_VARFIXINGS(x)
#define DEFAULT_PRIORITY_LOCALBRANCHING
#define DEFAULT_MINFIXINGRATE_TRUSTREGION
#define DEFAULT_BESTSOLWEIGHT
#define DEFAULT_BANDITALGO
#define DEFAULT_MINFIXINGRATE_PROXIMITY
static SCIP_RETCODE createBandit(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Real *priorities, unsigned int initseed)
static SCIP_RETCODE neighborhoodFixVariables(SCIP *scip, SCIP_HEURDATA *heurdata, NH *neighborhood, SCIP_VAR **varbuf, SCIP_Real *valbuf, int *nfixings, SCIP_RESULT *result)
#define DEFAULT_USEPSCOST
static SCIP_RETCODE transferSolution(SCIP *subscip, SCIP_EVENTDATA *eventdata)
Adaptive large neighborhood search heuristic that orchestrates popular LNS heuristics.
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
methods commonly used by primal heuristics
static const char * paramname[]
memory allocation routines
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSclearMemory(ptr)
#define BMSfreeMemoryArray(ptr)
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for bandit algorithms
public methods for the epsilon greedy bandit selector
public methods for Exp.3-IX
public methods for UCB bandit selection
public methods for managing constraints
public methods for managing events
public methods for primal heuristics
public methods for message output
public data structures and miscellaneous methods
methods for selecting (weighted) k-medians
public methods for primal CIP solutions
public methods for problem variables
public methods for bandit algorithms
public methods for branching rule plugins and branching
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for event handler plugins and event handlers
public methods for primal heuristic plugins and divesets
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for node selector plugins
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for random numbers
public methods for solutions
public methods for querying solving statistics
public methods for statistics table plugins
public methods for timing
public methods for the branch-and-bound tree
public methods for SCIP variables
SCIP_Real targetfixingrate
int statushist[NHISTENTRIES]
SCIP_Longint nbestsolsfound
DECL_CHANGESUBSCIP((*changesubscip))
DATA_CROSSOVER * crossover
DECL_NHDEACTIVATE((*nhdeactivate))
DATA_TRUSTREGION * trustregion
DECL_VARFIXINGS((*varfixings))
DECL_NHREFSOL((*nhrefsol))
unsigned int usedistances
SCIP_Real * redcostscores
struct SCIP_EventData SCIP_EVENTDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_EVENTTYPE_BESTSOLFOUND
#define SCIP_EVENTTYPE_SOLFOUND
#define SCIP_EVENTTYPE_LPSOLVED
#define SCIP_DECL_HEURINITSOL(x)
#define SCIP_DECL_HEURCOPY(x)
struct SCIP_HeurData SCIP_HEURDATA
#define SCIP_DECL_HEURINIT(x)
#define SCIP_DECL_HEUREXIT(x)
#define SCIP_DECL_HEURFREE(x)
#define SCIP_DECL_HEUREXEC(x)
#define SCIP_DECL_SORTINDCOMP(x)
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_SOLORIGIN_ORIGINAL
@ SCIP_STATUS_TOTALNODELIMIT
@ SCIP_STATUS_BESTSOLLIMIT
@ SCIP_STATUS_PRIMALLIMIT
@ SCIP_STATUS_USERINTERRUPT
@ SCIP_STATUS_STALLNODELIMIT
@ SCIP_STATUS_RESTARTLIMIT
enum SCIP_Status SCIP_STATUS
#define SCIP_DECL_TABLEOUTPUT(x)
#define SCIP_HEURTIMING_DURINGLPLOOP