82#define EVENTHDLR_NAME "estim"
83#define EVENTHDLR_DESC "event handler for tree size estimation and restarts"
84#define EVENTTYPE_ESTIM (SCIP_EVENTTYPE_NODEDELETE | SCIP_EVENTTYPE_NODEBRANCHED)
101#define RESTARTPOLICY_CHAR_NEVER 'n'
102#define RESTARTPOLICY_CHAR_ALWAYS 'a'
103#define RESTARTPOLICY_CHAR_COMPLETION 'c'
104#define RESTARTPOLICY_CHAR_ESTIMATION 'e'
106#define DES_USETRENDINLEVEL TRUE
109#define TABLE_NAME "estim"
110#define TABLE_DESC "tree size estimations statistics table"
111#define TABLE_POSITION 18500
112#define TABLE_EARLIEST_STAGE SCIP_STAGE_INIT
115#define DISP_NAME "completed"
116#define DISP_DESC "completion of search in percent (based on tree size estimation)"
117#define DISP_HEADER "compl."
119#define DISP_PRIORITY 110000
120#define DISP_POSITION 30100
121#define DISP_STRIPLINE TRUE
123#define INITIALSIZE 100
127#define DES_ALPHA_TREEWEIGHT 0.65
128#define DES_BETA_TREEWEIGHT 0.15
130#define DES_ALPHA_GAP 0.6
131#define DES_BETA_GAP 0.15
133#define DES_ALPHA_LEAFFREQUENCY 0.3
134#define DES_BETA_LEAFFREQUENCY 0.33
136#define DES_ALPHA_SSG 0.6
137#define DES_BETA_SSG 0.15
139#define DES_ALPHA_OPENNODES 0.6
140#define DES_BETA_OPENNODES 0.15
142#define MAX_REGFORESTSIZE 10000000
147#define COMPLETIONTYPE_AUTO 'a'
148#define COMPLETIONTYPE_REGFOREST 'r'
149#define COMPLETIONTYPE_MONOREG 'm'
150#define COMPLETIONTYPE_TREEWEIGHT 'w'
151#define COMPLETIONTYPE_SSG 's'
152#define COMPLETIONTYPE_GAP 'g'
156#define ESTIMMETHOD_COMPL 'c'
157#define ESTIMMETHOD_WBE 'b'
158#define ESTIMMETHOD_ENSMBL 'e'
159#define ESTIMMETHOD_GAP 'g'
160#define ESTIMMETHOD_LFREQ 'l'
161#define ESTIMMETHOD_OPEN 'o'
162#define ESTIMMETHOD_SSG 's'
163#define ESTIMMETHOD_TPROF 't'
164#define ESTIMMETHOD_TREEWEIGHT 'w'
166#define ESTIMMETHODS "bceglostw"
169#define TREEPROFILE_MINSIZE 512
170#define SSG_STARTPRIMBOUND SCIP_INVALID
242#define DEFAULT_USELEAFTS TRUE
243#define DEFAULT_REPORTFREQ -1
244#define DEFAULT_REGFORESTFILENAME "-"
245#define DEFAULT_COEFMONOWEIGHT 0.3667
246#define DEFAULT_COEFMONOSSG 0.6333
247#define DEFAULT_COMPLETIONTYPE COMPLETIONTYPE_AUTO
248#define DEFAULT_ESTIMMETHOD ESTIMMETHOD_TREEWEIGHT
251#define DEFAULT_TREEPROFILE_ENABLED FALSE
252#define DEFAULT_TREEPROFILE_MINNODESPERDEPTH 20.0
253#define DEFAULT_RESTARTPOLICY 'e'
254#define DEFAULT_RESTARTLIMIT 1
255#define DEFAULT_MINNODES 1000L
256#define DEFAULT_COUNTONLYLEAVES FALSE
257#define DEFAULT_RESTARTFACTOR 50.0
258#define DEFAULT_RESTARTNONLINEAR FALSE
259#define DEFAULT_RESTARTACTPRICERS FALSE
260#define DEFAULT_HITCOUNTERLIM 50
261#define DEFAULT_SSG_NMAXSUBTREES -1
263#define DEFAULT_SSG_NMINNODESLASTSPLIT 0L
264#define DEFAULT_SHOWSTATS FALSE
267struct SCIP_EventhdlrData
273 char* regforestfilename;
281 int nrestartsperformed;
282 int restarthitcounter;
287 char restartpolicyparam;
291 char completiontypeparam;
330#define DECL_TIMESERIESUPDATE(x) SCIP_RETCODE x (\
333 TREEDATA* treedata, \
391 else if( num >= 1e+20 )
409 if( *regforest ==
NULL )
411 regforestptr = *regforest;
437 for( treeidx = 0; treeidx < regforest->
ntrees; ++treeidx )
439 int treepos = regforest->
nbegin[treeidx];
440 int* childtree = &(regforest->
child[2 * treepos]);
441 int* splitidxtree = &(regforest->
splitidx[treepos]);
448 while( splitidxtree[pos] != - 1 )
452 assert(splitidxtree[pos] < regforest->
dim);
454 goright = (datapoint[splitidxtree[pos]] > valuetree[pos]) ? 1 : 0;
455 pos = childtree[2 * pos + goright];
458 value += valuetree[pos];
501 SCIPerrorMessage(
"Could not read first line of regression file '%s'\n", filename);
506 sscanret = sscanf(buffer, firstlineformat, &ntrees, &dim, &size);
511 SCIPerrorMessage(
"Could not extract tree information from buffer line [%s]\n", buffer);
515 SCIPdebugMessage(
"Read ntrees=%d, dim=%d, size=%d (return value %d)\n", ntrees, dim, size, sscanret);
525 if( dim <= 0 || ntrees <= 0 || size <= 0 )
528 SCIPerrorMessage(
"Cannot create regression tree with negative size, dimension, or number of trees\n");
535 regforestptr = *regforest;
543 regforestptr->
dim = dim;
544 regforestptr->
size = size;
545 regforestptr->
ntrees = ntrees;
563 sscanret = sscanf(buffer, dataformat,
565 ®forestptr->
child[2 * pos],
566 ®forestptr->
child[2 * pos + 1],
581 assert(treepos < regforestptr->ntrees);
583 regforestptr->
nbegin[treepos++] = pos;
657 if( mindepth < treeprofile->profilesize )
696 (*treeprofile)->profile =
NULL;
697 (*treeprofile)->profilesize = 0;
703 (*treeprofile)->lastestimate = -1.0;
718 if( *treeprofile ==
NULL )
744 if( treeprofile ==
NULL )
756 nodedepthcnt = ++treeprofile->
profile[nodedepth];
761 nbits = 8*
sizeof(
unsigned int);
763 if( (
unsigned int)nodedepth < nbits && nodedepthcnt == (1U << nodedepth) )
778 if( nodedepthcnt > maxnodes )
784 else if( nodedepthcnt == maxnodes )
811 if( treeprofile ==
NULL )
837 estimate += growthfac;
838 growthfac *= gamma_d;
842 for( ; d < waist; ++d )
846 assert(1.0 <= gamma_d && gamma_d <= 2.0);
847 estimate += growthfac;
848 growthfac *= gamma_d;
855 assert(0.0 <= gamma_d && gamma_d <= 1.0);
857 estimate += growthfac;
858 growthfac *= gamma_d;
948 (*ssg)->nsubtrees = 0;
968 if( (*ssg)->nodes2info !=
NULL )
1000 assert(oldpos == -1 || oldpos == nodeinfo->
pos);
1001 nodeinfo->
pos = newpos;
1023 nodeinfo->
node = node;
1037 assert(subtreeidx < ssg->nsubtrees);
1073 nnewsubtrees = nopennodes[0] + nopennodes[1] + nopennodes[2] + (addfocusnode ? 1 : 0);
1098 for( t = 0; t < 3; ++t )
1101 int nnodes = nopennodes[t];
1105 for( n = 0; n <
nnodes; ++n )
1149 gap =
MIN(gap, 1.0);
1173 if( nodeinfo ==
NULL )
1181 if( nodeinfo ==
NULL )
1191 pos = nodeinfo->
pos;
1237 int parentnodelabel;
1248 if( nchildren == 0 )
1258 parentnode = focusnode;
1267 parentnode = focusnode;
1270 parentnodelabel = parentnodeinfo->
subtreeidx;
1273 for( n = 0; n < nchildren; ++n )
1291#ifdef SCIP_DISABLED_CODE
1335 for( t = 0; t < 3; ++t )
1339 for( n = 0; n < nopennodes[t]; ++n )
1349 assert(label >= 0 && label < ssg->nsubtrees);
1350 lowerbounds[label] =
MIN(lowerbounds[label], lowerbound);
1370 subtreegap =
MIN(subtreegap, 1.0);
1372 gapsum += subtreegap;
1432 gapsum += subtreegap;
1478 ((ssg->
nmaxsubtrees == -1 || nnewsubtrees <= ssg->nmaxsubtrees) &&
1490 SCIPdebugMsg(
scip,
"Keep split into %d subtrees because new split into %d subtrees exceeds limit %d\n",
1500 if( insertchildren )
1512 else if( insertchildren )
1518 if( nchildren == 0 )
1539 treedata->
nopen = 1;
1574 if( *treedata ==
NULL )
1597 if( nchildren == 0 )
1605 treedata->
nnodes += nchildren;
1606 treedata->
nopen += nchildren;
1645 "weight: %.4Lf, ssg %.4f",
1706 des->
level = newlevel;
1707 des->
trend = newtrend;
1732 timeseries->
nvals = 0;
1733 timeseries->
nobs = 0L;
1758 assert(beta >= 0.0 && beta <= 1);
1762 timeseriesptr = *timeseries;
1770 timeseriesptr->timeseriesupdate = timeseriesupdate;
1782 timeseriesptr->
des.
beta = beta;
1852 if( timeseries->
nobs == 0L )
1859 if(
EPSZ(val - targetval, tolerance) )
1867 if( (targetval > val && trend <= tolerance) || (targetval < val && trend >= -tolerance) )
1872 return timeseries->
useleafts ? 2.0 * estimated - 1.0 : estimated;
1911 des = ×eries->
des;
1915 for(
i = 0;
i < timeseries->
nvals / 2; ++
i )
1917 timeseries->
vals[
i] = timeseries->
vals[2 *
i];
1943 assert(timeseries->timeseriesupdate !=
NULL);
1944 SCIP_CALL( timeseries->timeseriesupdate(
scip, timeseries, treedata, &value) );
1961 tspos = timeseries->
nvals++;
1962 timeseries->
vals[tspos] = value;
1982 return timeseries->
name;
1991 TIMESERIES** tss = eventhdlrdata->timeseries;
2000 tss[t]->
useleafts = eventhdlrdata->useleafts;
2015 TIMESERIES** tss = eventhdlrdata->timeseries;
2077 treedata = eventhdlrdata->treedata;
2080 if( treedata->
weight <= 0.3 )
2083 coeffs = coeffs_early;
2087 else if( treedata->
weight <= 0.6 )
2089 coeffs = coeffs_intermediate;
2098 coeffs = coeffs_late;
2110 TSPOS tspos = tsposs[t];
2114 testim = treedata->
nnodes;
2116 estim += coeffs[t] * testim;
2119 if( estim < treedata->
nnodes )
2134 char completiontype;
2137 treedata = eventhdlrdata->treedata;
2138 completiontype = eventhdlrdata->completiontypeparam;
2152 SCIP_Bool useweight = eventhdlrdata->treeisbinary;
2155 if( eventhdlrdata->regforest !=
NULL )
2157 else if( useweight && usessg )
2159 else if( useweight )
2168 switch (completiontype)
2187 *completed = eventhdlrdata->coefmonoweight * (
SCIP_Real)treedata->
weight +
2188 eventhdlrdata->coefmonossg * (1.0 - treedata->
ssg->
value);
2200 *completed = 1.0 - treedata->
ssg->
value;
2225 completed =
MIN(completed, 1.0);
2227 if( completed > 0.0 )
2265 *value = 1.0 -
REALABS(primalbound - dualbound)/
MAX(abspb, absdb);
2269 *value =
MAX(*value, 0.0);
2358 switch (eventhdlrdata->restartpolicyparam)
2369 SCIPerrorMessage(
"Unknown restart policy %c\n", eventhdlrdata->restartpolicyparam);
2398 if( eventhdlrdata->restartlimit != -1 && eventhdlrdata->nrestartsperformed >= eventhdlrdata->restartlimit )
2402 if( eventhdlrdata->countonlyleaves )
2403 nnodes = eventhdlrdata->treedata->nleaves;
2405 nnodes = eventhdlrdata->treedata->nvisited;
2425 if( completion < 1.0 / eventhdlrdata->restartfactor )
2429 "Completion %.5f less than restart threshold %.5f\n",
2430 completion, 1.0 / eventhdlrdata->restartfactor);
2450 if( estimation < 0.0 )
2454 "Estimation %g is still unavailable\n",
2462 if( estimation > eventhdlrdata->treedata->nnodes * eventhdlrdata->restartfactor )
2466 "Estimation %g exceeds number of estimation tree nodes %" SCIP_LONGINT_FORMAT " by a factor of %.1f\n",
2467 estimation, eventhdlrdata->treedata->nnodes, estimation / eventhdlrdata->treedata->nnodes);
2488 applyrestart =
TRUE;
2491 applyrestart =
FALSE;
2503 return applyrestart;
2515 TIMESERIES** tss = eventhdlrdata->timeseries;
2524#ifdef SCIP_MORE_DEBUG
2526 "Update of time series '%s', current value %.4f (%" SCIP_LONGINT_FORMAT " observations)\n",
2543 TREEDATA* treedata = eventhdlrdata->treedata;
2560 completed =
MIN(1.0, completed);
2561 completed =
MAX(0.0, completed);
2570 "weight: %.4Lf completed %.4f\n",
2583 "estim",
"value",
"trend",
"resolution",
"smooth");
2588 real2String(wbeestim, wbeestimstr, 0),
"-",
"-",
"-",
"-");
2592 "-",
"-",
"-",
"-");
2599 TIMESERIES* ts = eventhdlrdata->timeseries[t];
2664 eventhdlrdata->lastrestartrun = 0;
2665 eventhdlrdata->nrestartsperformed = 0;
2693 eventhdlrdata->restarthitcounter = 0;
2694 eventhdlrdata->weightlastreport = 0.0;
2695 eventhdlrdata->nreports = 0;
2704 if( eventhdlrdata->treeprofile_enabled )
2709 eventhdlrdata->treeisbinary =
TRUE;
2723 if( eventhdlrdata->treeprofile !=
NULL )
2746 treedata = eventhdlrdata->treedata;
2769 if( nchildren != 2 )
2770 eventhdlrdata->treeisbinary =
FALSE;
2785 (eventhdlrdata->reportfreq == 0
2786 || treedata->
weight >= eventhdlrdata->weightlastreport + 1.0 / (
SCIP_Real)eventhdlrdata->reportfreq) )
2791 if( eventhdlrdata->reportfreq > 0 )
2809 eventhdlrdata->restarthitcounter++;
2811 if( eventhdlrdata->restarthitcounter >= eventhdlrdata->hitcounterlim )
2816 eventhdlrdata->nrestartsperformed++;
2819 "Restart triggered after %d consecutive estimations that the remaining tree will be large\n",
2820 eventhdlrdata->restarthitcounter);
2830 eventhdlrdata->restarthitcounter = 0;
2849 if( eventhdlrdata->showstats )
2877 treedata = eventhdlrdata->treedata;
2881 completed =
MIN(completed, 1.0);
2883 if( treedata->
weight >= 0.005 && completed > 0 )
2907 eventExecEstim, eventhdlrdata) );
2923 "tree size estimation method: (c)ompletion, (e)nsemble, "
2924 "time series forecasts on either (g)ap, (l)eaf frequency, (o)open nodes, tree (w)eight, (s)sg, "
2925 "or (t)ree profile or w(b)e",
2938 "factor by which the estimated number of nodes should exceed the current number of nodes",
2942 "whether to apply a restart when nonlinear constraints are present",
2946 "whether to apply a restart when active pricers are used",
2950 "coefficient of tree weight in monotone approximation of search completion",
2954 "coefficient of 1 - SSG in monotone approximation of search completion",
2957 SCIP_CALL(
SCIPaddIntParam(
scip,
"estimation/restarts/hitcounterlim",
"limit on the number of successive samples to really trigger a restart",
2961 "report frequency on estimation: -1: never, 0:always, k >= 1: k times evenly during search",
2968 "approximation of search tree completion: (a)uto, (g)ap, tree (w)eight, (m)onotone regression, (r)egression forest, (s)sg",
2972 "should the event handler collect data?",
2976 "minimum average number of nodes at each depth before producing estimations",
2980 "use leaf nodes as basic observations for time series, or all nodes?",
2984 "should statistics be shown at the end?",
2989 "the maximum number of individual SSG subtrees; -1: no limit",
2993 "minimum number of nodes to process between two consecutive SSG splits",
3032 if( eventhdlr ==
NULL )
3041 switch (eventhdlrdata->estimmethod)
3080 SCIPerrorMessage(
"Unknown estimation '%c' method specified, should be one of [%s]\n",
#define SCIP_STRINGEQ(name, reference, retcode)
#define SCIP_ALLOC_TERMINATE(retcode, x, TERM)
#define SCIP_CALL_ABORT(x)
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
#define SCIP_LONGINT_FORMAT
static void SCIPregForestFree(SCIP_REGFOREST **regforest)
static char * timeSeriesGetName(TIMESERIES *timeseries)
static SCIP_RETCODE subtreeSumGapComputeFromScratchEfficiently(SCIP *scip, SUBTREESUMGAP *ssg, SCIP_Bool updatescaling)
enum RestartPolicy RESTARTPOLICY
#define DEFAULT_COEFMONOWEIGHT
static SCIP_RETCODE subtreeSumGapSplit(SCIP *scip, SUBTREESUMGAP *ssg, SCIP_Bool addfocusnode)
#define DES_BETA_TREEWEIGHT
static void freeTreeProfile(SCIP *scip, TREEPROFILE **treeprofile)
static SCIP_RETCODE updateTreeData(SCIP *scip, TREEDATA *treedata, SCIP_NODE *node, int nchildren)
#define DEFAULT_SHOWSTATS
#define DEFAULT_RESTARTLIMIT
static SCIP_Real getEnsembleEstimation(SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_Bool shouldApplyRestart(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
#define DES_ALPHA_TREEWEIGHT
#define DES_ALPHA_OPENNODES
#define MAX_REGFORESTSIZE
#define RESTARTPOLICY_CHAR_ALWAYS
#define RESTARTPOLICY_CHAR_NEVER
struct TreeProfile TREEPROFILE
static SCIP_Bool isRestartApplicable(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
#define DEFAULT_REPORTFREQ
struct TimeSeries TIMESERIES
static void printReport(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata, char *strbuf, int reportnum)
static SCIP_Real timeSeriesGetSmoothEstimation(TIMESERIES *timeseries)
static SCIP_RETCODE subtreeSumGapCreate(SCIP *scip, SUBTREESUMGAP **ssg)
static void doubleExpSmoothUpdate(DOUBLEEXPSMOOTH *des, SCIP_Real xnew)
static void copyTreeProfileStats(TREEPROFILESTATS *dest, TREEPROFILESTATS *src)
#define DEFAULT_SSG_NMAXSUBTREES
#define DES_BETA_LEAFFREQUENCY
#define DEFAULT_SSG_NMINNODESLASTSPLIT
#define COMPLETIONTYPE_REGFOREST
#define DES_USETRENDINLEVEL
#define COMPLETIONTYPE_MONOREG
#define ESTIMMETHOD_TREEWEIGHT
#define COMPLETIONTYPE_TREEWEIGHT
#define ESTIMMETHOD_LFREQ
static SCIP_RETCODE timeSeriesUpdate(SCIP *scip, TIMESERIES *timeseries, TREEDATA *treedata, SCIP_Bool isleaf)
#define DEFAULT_TREEPROFILE_ENABLED
struct TreeProfileStats TREEPROFILESTATS
static SCIP_Real SCIPregForestPredict(SCIP_REGFOREST *regforest, SCIP_Real *datapoint)
static void freeTreeData(SCIP *scip, TREEDATA **treedata)
static SCIP_RETCODE resetTreeData(SCIP *scip, TREEDATA *treedata)
static SCIP_Real timeSeriesEstimate(TIMESERIES *timeseries, TREEDATA *treedata)
static SCIP_RETCODE includeTimeseries(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
#define ESTIMMETHOD_ENSMBL
#define COMPLETIONTYPE_GAP
#define COMPLETIONTYPE_SSG
static void timeSeriesUpdateSmoothEstimation(TIMESERIES *timeseries, SCIP_Real estimation)
#define DEFAULT_COUNTONLYLEAVES
static SCIP_RETCODE subtreeSumGapRemoveNode(SCIP *scip, SUBTREESUMGAP *ssg, SCIP_NODE *node)
static void timeSeriesResample(TIMESERIES *timeseries)
static SCIP_RETCODE subtreeSumGapReset(SCIP *scip, SUBTREESUMGAP *ssg)
static SCIP_RETCODE updateTreeProfile(SCIP *scip, TREEPROFILE *treeprofile, SCIP_NODE *node)
static SCIP_RETCODE createTreeData(SCIP *scip, TREEDATA **treedata)
static SCIP_RETCODE getEstimCompletion(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata, SCIP_Real *estim)
#define DEFAULT_HITCOUNTERLIM
#define DES_BETA_OPENNODES
static SCIP_Real calcGap(SCIP *scip, SCIP_Real lowerbound)
static SCIP_RETCODE timeSeriesCreate(SCIP *scip, TIMESERIES **timeseries, const char *name, SCIP_Real targetvalue, SCIP_Real initialvalue, SCIP_Real alpha, SCIP_Real beta,)
#define DEFAULT_RESTARTACTPRICERS
SCIP_Real SCIPgetTreesizeEstimation(SCIP *scip)
static void timeSeriesFree(SCIP *scip, TIMESERIES **timeseries)
#define DEFAULT_RESTARTFACTOR
#define DEFAULT_USELEAFTS
SCIP_RETCODE SCIPincludeEventHdlrEstim(SCIP *scip)
#define DES_ALPHA_LEAFFREQUENCY
static SCIP_RETCODE subtreeSumGapInsertChildren(SCIP *scip, SUBTREESUMGAP *ssg)
static SCIP_Real timeSeriesGetValue(TIMESERIES *timeseries)
@ RESTARTPOLICY_COMPLETION
@ RESTARTPOLICY_ESTIMATION
static SCIP_Bool shouldApplyRestartCompletion(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_RETCODE extendMemoryTreeProfile(SCIP *scip, TREEPROFILE *treeprofile, int mindepth)
static void subtreeSumGapFree(SCIP *scip, SUBTREESUMGAP **ssg)
#define DECL_TIMESERIESUPDATE(x)
static void timeSeriesReset(TIMESERIES *timeseries)
#define RESTARTPOLICY_CHAR_COMPLETION
#define TABLE_EARLIEST_STAGE
#define ESTIMMETHOD_TPROF
static void doubleExpSmoothInit(DOUBLEEXPSMOOTH *des, SCIP_Real x1)
#define DEFAULT_COEFMONOSSG
static SCIP_Bool isEqualTreeProfileStats(TREEPROFILESTATS *stats, TREEPROFILESTATS *other)
static int timeSeriesGetResolution(TIMESERIES *timeseries)
static SCIP_RETCODE createTreeProfile(SCIP *scip, TREEPROFILE **treeprofile)
static void subtreeSumGapDelSubtrees(SCIP *scip, SUBTREESUMGAP *ssg)
static SCIP_RETCODE updateTimeseries(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata, TREEDATA *treedata, SCIP_Bool isleaf)
static void resetTreeProfileStats(TREEPROFILESTATS *treeprofilestats)
static SCIP_Real treeDataGetWbe(TREEDATA *treedata)
static void resetTimeSeries(SCIP_EVENTHDLRDATA *eventhdlrdata)
#define DEFAULT_COMPLETIONTYPE
struct SubtreeSumGap SUBTREESUMGAP
static SCIP_RETCODE SCIPregForestFromFile(SCIP_REGFOREST **regforest, const char *filename)
static RESTARTPOLICY getRestartPolicy(SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_Real doubleExpSmoothGetTrend(DOUBLEEXPSMOOTH *des)
struct DoubleExpSmooth DOUBLEEXPSMOOTH
static void doubleExpSmoothReset(DOUBLEEXPSMOOTH *des, SCIP_Real initialvalue)
static char * real2String(SCIP_Real num, char *buf, int digits)
static SCIP_RETCODE subtreeSumGapUpdate(SCIP *scip, SUBTREESUMGAP *ssg, SCIP_NODE *node, int nchildren, SCIP_Longint nsolvednodes)
static void freeTimeSeries(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_Real predictTotalSizeTreeProfile(SCIP *scip, TREEPROFILE *treeprofile, SCIP_Real minnodesperdepth)
#define ESTIMMETHOD_COMPL
#define TREEPROFILE_MINSIZE
#define COMPLETIONTYPE_AUTO
static SCIP_RETCODE subtreeSumGapStoreNode(SCIP *scip, SUBTREESUMGAP *ssg, SCIP_NODE *node, int subtreeidx)
static SCIP_RETCODE getSearchCompletion(SCIP_EVENTHDLRDATA *eventhdlrdata, SCIP_Real *completed)
#define RESTARTPOLICY_CHAR_ESTIMATION
static SCIP_Real timeSeriesGetTargetValue(TIMESERIES *timeseries)
#define DEFAULT_ESTIMMETHOD
#define SSG_STARTPRIMBOUND
#define DEFAULT_RESTARTNONLINEAR
#define DEFAULT_RESTARTPOLICY
static SCIP_Bool shouldApplyRestartEstimation(SCIP *scip, SCIP_EVENTHDLRDATA *eventhdlrdata)
#define DEFAULT_TREEPROFILE_MINNODESPERDEPTH
struct SCIP_RegForest SCIP_REGFOREST
#define DEFAULT_REGFORESTFILENAME
event handler for tree size estimation and restarts
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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_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 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 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)
void ** SCIPpqueueElems(SCIP_PQUEUE *pqueue)
void SCIPpqueueDelPos(SCIP_PQUEUE *pqueue, int pos)
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)),)
void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
void * SCIPpqueueFirst(SCIP_PQUEUE *pqueue)
const char * SCIPdispGetName(SCIP_DISP *disp)
SCIP_RETCODE SCIPincludeDisp(SCIP *scip, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPsetEventhdlrInitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPsetEventhdlrCopy(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetEventhdlrExitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, 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_NODE * SCIPeventGetNode(SCIP_EVENT *event)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Bool SCIPisExact(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPreallocMemoryArray(scip, ptr, newnum)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocMemoryArray(scip, ptr, num)
#define SCIPallocClearBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocClearMemoryArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPfreeMemory(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_NODE * SCIPnodeGetParent(SCIP_NODE *node)
int SCIPnodeGetDepth(SCIP_NODE *node)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
SCIP_Bool SCIPisInRestart(SCIP *scip)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
int SCIPgetNRuns(SCIP *scip)
int SCIPgetNRootIntFixingsRun(SCIP *scip)
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_DECL_TABLECOLLECT((*tablecollect)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetNSiblings(SCIP *scip)
int SCIPgetNChildren(SCIP *scip)
SCIP_RETCODE SCIPgetOpenNodesData(SCIP *scip, SCIP_NODE ***leaves, SCIP_NODE ***children, SCIP_NODE ***siblings, int *nleaves, int *nchildren, int *nsiblings)
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
SCIP_NODE * SCIPgetFocusNode(SCIP *scip)
int SCIPgetNLeaves(SCIP *scip)
SCIP_Bool SCIPwasNodeLastBranchParent(SCIP *scip, SCIP_NODE *node)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
#define BMSfreeMemory(ptr)
#define BMSduplicateMemoryArray(ptr, source, num)
#define BMSclearMemory(ptr)
#define BMSallocMemoryArray(ptr, num)
#define BMSfreeMemoryArray(ptr)
#define BMSclearMemoryArray(ptr, num)
#define BMSfreeMemoryArrayNull(ptr)
#define BMSallocMemory(ptr)
propagator for symmetry handling
public methods for displaying runtime statistics
public methods for managing events
wrapper functions to map file i/o to standard or zlib file i/o
struct SCIP_File SCIP_FILE
public methods for message output
public data structures and miscellaneous methods
public methods for branch and bound tree
public methods for display handler plugins
public methods for event handler plugins and event handlers
public methods for memory management
public methods for message handling
public methods for nonlinear relaxation
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for variable pricer plugins
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
SCIP_Bool usetrendinlevel
SCIP_Longint nodelastsplit
SCIP_PQUEUE ** subtreepqueues
SCIP_HASHMAP * nodes2info
SCIP_Longint nminnodeslastsplit
DECL_TIMESERIESUPDATE((*timeseriesupdate))
SCIP_Real smoothestimation
TREEPROFILESTATS lastestimatestats
type definitions for displaying runtime statistics
#define SCIP_DECL_DISPOUTPUT(x)
type definitions for managing events
struct SCIP_Eventhdlr SCIP_EVENTHDLR
#define SCIP_DECL_EVENTINITSOL(x)
#define SCIP_DECL_EVENTEXIT(x)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_EVENTTYPE_NODEBRANCHED
#define SCIP_DECL_EVENTCOPY(x)
#define SCIP_DECL_EVENTINIT(x)
#define SCIP_DECL_EVENTFREE(x)
#define SCIP_DECL_EVENTEXITSOL(x)
#define SCIP_EVENTTYPE_NODEDELETE
type definitions for message output methods
type definitions for miscellaneous datastructures
#define SCIP_DECL_PQUEUEELEMCHGPOS(x)
struct SCIP_HashMap SCIP_HASHMAP
#define SCIP_DECL_SORTPTRCOMP(x)
struct SCIP_PQueue SCIP_PQUEUE
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
type definitions for problem statistics
type definitions for displaying statistics tables
#define SCIP_DECL_TABLEOUTPUT(x)
struct SCIP_Node SCIP_NODE