68#define CONSHDLR_NAME "cumulative"
69#define CONSHDLR_DESC "cumulative constraint handler"
70#define CONSHDLR_SEPAPRIORITY 2100000
71#define CONSHDLR_ENFOPRIORITY -2040000
72#define CONSHDLR_CHECKPRIORITY -3030000
73#define CONSHDLR_SEPAFREQ 1
74#define CONSHDLR_PROPFREQ 1
75#define CONSHDLR_EAGERFREQ 100
77#define CONSHDLR_MAXPREROUNDS -1
78#define CONSHDLR_DELAYSEPA FALSE
79#define CONSHDLR_DELAYPROP FALSE
80#define CONSHDLR_NEEDSCONS TRUE
82#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS
83#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP
95#define DEFAULT_USEBINVARS FALSE
96#define DEFAULT_LOCALCUTS FALSE
97#define DEFAULT_USECOVERCUTS TRUE
98#define DEFAULT_CUTSASCONSS TRUE
99#define DEFAULT_SEPAOLD TRUE
102#define DEFAULT_TTINFER TRUE
103#define DEFAULT_EFCHECK FALSE
104#define DEFAULT_EFINFER FALSE
105#define DEFAULT_USEADJUSTEDJOBS FALSE
106#define DEFAULT_TTEFCHECK TRUE
107#define DEFAULT_TTEFINFER TRUE
110#define DEFAULT_DUALPRESOLVE TRUE
111#define DEFAULT_COEFTIGHTENING FALSE
112#define DEFAULT_NORMALIZE TRUE
113#define DEFAULT_PRESOLPAIRWISE TRUE
114#define DEFAULT_DISJUNCTIVE TRUE
115#define DEFAULT_DETECTDISJUNCTIVE TRUE
116#define DEFAULT_DETECTVARBOUNDS TRUE
117#define DEFAULT_MAXNODES 10000LL
120#define DEFAULT_FILLBRANCHCANDS FALSE
123#define DEFAULT_USEBDWIDENING TRUE
132#define EVENTHDLR_NAME "cumulative"
133#define EVENTHDLR_DESC "bound change event handler for cumulative constraints"
145 SCIP_Bool* downlocks;
153 SCIP_Real resstrength1;
154 SCIP_Real resstrength2;
155 SCIP_Real cumfactor1;
156 SCIP_Real disjfactor1;
157 SCIP_Real disjfactor2;
158 SCIP_Real estimatedstrength;
172 unsigned int signature;
174 unsigned int validsignature:1;
175 unsigned int normalized:1;
176 unsigned int covercuts:1;
177 unsigned int propagated:1;
178 unsigned int varbounds:1;
179 unsigned int triedsolving:1;
187struct SCIP_ConshdlrData
191 SCIP_Bool usebinvars;
192 SCIP_Bool cutsasconss;
196 SCIP_Bool useadjustedjobs;
200 SCIP_Bool usecovercuts;
203 SCIP_Bool fillbranchcands;
205 SCIP_Bool dualpresolve;
206 SCIP_Bool coeftightening;
208 SCIP_Bool disjunctive;
209 SCIP_Bool detectdisjunctive;
210 SCIP_Bool detectvarbounds;
211 SCIP_Bool usebdwidening;
212 SCIP_Bool presolpairwise;
213 SCIP_Bool detectedredundant;
215 SCIP_Longint maxnodes;
221 SCIP_Longint nlbtimetable;
222 SCIP_Longint nubtimetable;
223 SCIP_Longint ncutofftimetable;
224 SCIP_Longint nlbedgefinder;
225 SCIP_Longint nubedgefinder;
226 SCIP_Longint ncutoffedgefinder;
227 SCIP_Longint ncutoffoverload;
228 SCIP_Longint nlbTTEF;
229 SCIP_Longint nubTTEF;
230 SCIP_Longint ncutoffoverloadTTEF;
238 int nallconsdualfixs;
240 int naddeddisjunctives;
276 unsigned int proprule:2;
277 unsigned int data1:15;
278 unsigned int data2:15;
293 inferinfo.val.asint =
i;
304 return inferinfo.val.asint;
313 return (
PROPRULE) inferinfo.val.asbits.proprule;
322 return (
int) inferinfo.val.asbits.data1;
331 return (
int) inferinfo.val.asbits.data2;
340 return (inferinfo.val.asint != 0);
355 if( proprule ==
PROPRULE_0_INVALID || data1 < 0 || data1 >= (1<<15) || data2 < 0 || data2 >= (1<<15) )
357 inferinfo.val.asint = 0;
363 inferinfo.val.asbits.proprule = proprule;
364 inferinfo.val.asbits.data1 = (
unsigned int) data1;
365 inferinfo.val.asbits.data2 = (
unsigned int) data2;
396 core =
MAX(0,
MIN(end, ect) -
MAX(lst, begin));
401#define computeCoreWithInterval(begin, end, ect, lst) (MAX(0, MIN((end), (ect)) - MAX((lst), (begin))))
413#ifdef SCIP_DISABLED_CODE
418 SCIP_Real* vbdconsts;
426#ifdef SCIP_DISABLED_CODE
434 for( v = 0; v < nvbdvars; ++v )
446 duration = (int)(
size_t)image;
453 if( duration >= vbdconst )
459 if( (*est) < impliedest )
483#ifdef SCIP_DISABLED_CODE
488 SCIP_Real* vbdconsts;
495#ifdef SCIP_DISABLED_CODE
503 for( v = 0; v < nvbdvars; ++v )
518 if( duration >= -vbdconst )
524 if( (*lct) > impliedlct )
558 startindex = nstarted - 1;
564 while( nstarted - nfinished > nrowvars )
573 varidx = startindices[startindex];
577 duration = consdata->durations[
varidx];
578 demand = consdata->demands[
varidx];
584 if( endtime > curtime )
602 start = curtime - duration + 1;
603 end =
MIN(curtime, endtime - duration);
607 if( vals[
b] < start )
623 (*vars)[*
nvars] = binvars[
b];
624 (*coefs)[*
nvars] = demand;
661 assert(curtime >= consdata->hmin);
662 assert(curtime < consdata->hmax);
669 startindex = nstarted - 1;
672 while( nstarted - nfinished > counter )
677 varidx = startindices[startindex];
681 duration = consdata->durations[
varidx];
690 endtime =
MIN(starttime + duration, consdata->hmax);
693 if( endtime > curtime )
695 (*activevars)[counter] =
var;
696 sumofstarts += starttime;
697 mindelta =
MIN(mindelta, endtime - curtime);
705 *lhs = lower ? sumofstarts + mindelta : sumofstarts - mindelta;
730 for ( j = 0; j <
nvars; ++j )
777 for ( j = 0; j <
nvars; ++j )
817 tmpnvars = consdata->nvars;
821 for ( j = 0; j < tmpnvars; ++j )
823 var = consdata->vars[j];
825 assert(consdata->durations[j] > 0);
826 assert(consdata->demands[j] > 0);
836 startindices[*
nvars] = j;
838 endtimes[*
nvars] = starttimes[*
nvars] + consdata->durations[j];
839 endindices[*
nvars] = j;
841 SCIPdebugMsg(
scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
843 consdata->durations[j],
844 starttimes[*
nvars], starttimes[*
nvars] + consdata->durations[startindices[*
nvars]],
845 consdata->demands[startindices[*
nvars]]);
856 startindices[*
nvars] = j;
858 endtimes[*
nvars] = starttimes[*
nvars] + consdata->durations[j];
859 endindices[*
nvars] = j;
861 SCIPdebugMsg(
scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
863 consdata->durations[j],
864 starttimes[*
nvars], starttimes[*
nvars] + consdata->durations[startindices[*
nvars]],
865 consdata->demands[startindices[*
nvars]]);
878 for ( j = 0; j < *
nvars; ++j )
880 SCIPdebugMsg(
scip,
"%d: job[%d] starttime %d, endtime = %d, demand = %d\n", j,
881 startindices[j], starttimes[j], starttimes[j] + consdata->durations[startindices[j]],
882 consdata->demands[startindices[j]]);
885 for ( j = 0; j < *
nvars; ++j )
887 SCIPdebugMsg(
scip,
"%d: job[%d] endtime %d, demand = %d\n", j, endindices[j], endtimes[j],
888 consdata->demands[endindices[j]]);
906 SCIP_Real** cumulativedemands,
909 SCIP_Real* minfreecapacity
917 SCIP_Real totaldemand;
946 (*timepoints)[0] = starttimes[0];
947 (*cumulativedemands)[0] = 0;
951 for( j = 0; j <
nvars; ++j )
956 curtime = starttimes[j];
958 if( curtime >= hmax )
962 while( endindex <
nvars && endtimes[endindex] <= curtime )
966 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
969 (*timepoints)[*ntimepoints] = endtimes[endindex];
970 (*cumulativedemands)[*ntimepoints] = 0;
973 idx = endindices[endindex];
975 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
978 (*cumulativedemands)[*ntimepoints] = totaldemand;
981 idx = startindices[j];
983 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
985 if( (*timepoints)[*ntimepoints] < curtime )
988 (*timepoints)[*ntimepoints] = curtime;
989 (*cumulativedemands)[*ntimepoints] = 0;
992 (*cumulativedemands)[*ntimepoints] = totaldemand;
995 while( j+1 <
nvars && starttimes[j+1] == curtime )
998 idx = startindices[j];
1000 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
1002 (*cumulativedemands)[*ntimepoints] = totaldemand;
1007 while( endindex <
nvars)
1012 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
1015 (*timepoints)[*ntimepoints] = endtimes[endindex];
1016 (*cumulativedemands)[*ntimepoints] = 0;
1019 idx = endindices[endindex];
1021 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
1022 (*cumulativedemands)[*ntimepoints] = totaldemand;
1029 (*minfreecapacity) = INT_MAX;
1030 for( j = 0; j < *ntimepoints; ++j )
1032 if( (*timepoints)[j] >= hmin && (*timepoints)[j] < hmax )
1033 *minfreecapacity =
MIN( *minfreecapacity, (SCIP_Real)capacity - (*cumulativedemands)[j] );
1058 SCIP_Real disjfactor2;
1059 SCIP_Real cumfactor1;
1060 SCIP_Real resstrength1;
1061 SCIP_Real resstrength2;
1064 SCIP_Real globalpeak;
1065 SCIP_Real globalmaxdemand;
1071 nvars = consdata->nvars;
1072 capacity = consdata->capacity;
1074 globalmaxdemand = 0.0;
1081 for( v = 0; v <
nvars; ++v )
1084 SCIP_Real maxdemand;
1085 SCIP_Real deltademand;
1092 peak = consdata->demands[v];
1097 if( consdata->demands[v] > capacity / 3 )
1100 for( j = 0; j <
nvars; ++j )
1110 if( lb <= timepoint && lb + consdata->durations[j] > timepoint )
1112 peak += consdata->demands[j];
1115 if( consdata->demands[j] > consdata->capacity / 3 )
1120 deltademand = (
SCIP_Real)peak / (SCIP_Real)ndemands;
1121 globalpeak =
MAX(globalpeak, peak);
1122 globalmaxdemand =
MAX(globalmaxdemand, maxdemand);
1124 if( peak > capacity )
1126 disjfactor2 =
MAX( disjfactor2, (peak-(SCIP_Real)capacity)/peak * (nlarge/(SCIP_Real)ndemands) );
1127 cumfactor1 =
MAX( cumfactor1, (peak-capacity)/peak * (capacity-deltademand)/(SCIP_Real)capacity );
1128 resstrength2 =
MAX(resstrength2, (capacity-maxdemand)/(peak-maxdemand) );
1132 resstrength1 = (capacity-globalmaxdemand) / (globalpeak-globalmaxdemand);
1135 consdata->disjfactor2 = disjfactor2;
1136 consdata->cumfactor1 = cumfactor1;
1137 consdata->resstrength2 = resstrength2;
1138 consdata->resstrength1 = resstrength1;
1143 SCIP_Real* estimateddemands;
1146 SCIP_Real minfreecapacity;
1152 minfreecapacity = INT_MAX;
1155 consdata->durations, consdata->demands,
1156 capacity, consdata->hmin, consdata->hmax, &timepoints, &estimateddemands,
1157 &ntimepoints, &maxdemand, &minfreecapacity) );
1163 consdata->estimatedstrength = (
SCIP_Real)(capacity - minfreecapacity) / (
SCIP_Real) capacity;
1166 SCIPstatisticPrintf(
"cumulative constraint<%s>: DISJ1=%g, DISJ2=%g, CUM=%g, RS1 = %g, RS2 = %g, EST = %g\n",
1167 SCIPconsGetName(cons), consdata->disjfactor1, disjfactor2, cumfactor1, resstrength1, resstrength2,
1168 consdata->estimatedstrength);
1185 SCIP_Real realscalar;
1186 SCIP_Real realconstant;
1198 if( realconstant < 0.0 )
1203 if( realscalar < 0.0 )
1227 SCIP_Longint energy;
1232 for( j = 0; j < njobs; ++j )
1233 energy += (SCIP_Longint) durations[j] * demands[j];
1256 SCIP_Longint maxnodes,
1257 SCIP_Real timelimit,
1258 SCIP_Real memorylimit,
1261 SCIP_Bool* infeasible,
1262 SCIP_Bool* unbounded,
1285 for( v = 0; v < njobs; ++v )
1292 if( objvals ==
NULL )
1303 njobs, subvars, durations, demands, capacity) );
1348 (*infeasible) =
TRUE;
1352 (*unbounded) =
TRUE;
1363 for( v = 0; v < njobs; ++v )
1380 for( v = 0; v < njobs; ++v )
1402 for( v = 0; v < njobs; ++v )
1423 (*infeasible) =
FALSE;
1424 (*unbounded) =
FALSE;
1427 SCIPdebugMessage(
"solve independent cumulative condition with %d variables\n", njobs);
1434 njobs, capacity, hmin, hmax,
1435 maxnodes, timelimit, memorylimit,
1437 infeasible, unbounded, solved, error);
1447#ifdef SCIP_DISABLED_CODE
1466 (*infeasible) =
FALSE;
1467 (*unbounded) =
FALSE;
1470 SCIPdebugMsg(
scip,
"solve independent cumulative condition with %d variables\n", njobs);
1489 for( v = 0; v < njobs; ++v )
1497 if( objvals ==
NULL )
1506 timeinterval = lst - est + 1;
1507 assert(timeinterval > 0);
1510 minest =
MIN(minest, est);
1511 maxlct =
MAX(maxlct, lst + durations[v]);
1520 for( t = 0; t < timeinterval; ++t )
1533 binvars[v][t] = binvar;
1542 hmin =
MAX(hmin, minest);
1543 hmax =
MIN(hmax, maxlct);
1549 for( t = hmin; t < hmax; ++t )
1560 for( v = 0; v < njobs; ++v )
1573 duration = durations[v];
1577 if( t < est || t >= lst + duration )
1580 demand = demands[v];
1583 start =
MAX(t - duration + 1, est);
1588 for( k = start; k <= end; ++k )
1625 (*infeasible) =
TRUE;
1629 (*unbounded) =
TRUE;
1639 for( v = 0; v < njobs; ++v )
1649 timeinterval = lst - est + 1;
1652 for( t = 0; t < timeinterval; ++t )
1672 for( v = 0; v < njobs; ++v )
1682 timeinterval = lst - est + 1;
1685 for( t = 0; t < timeinterval; ++t )
1695 for( t = timeinterval - 1; t >= 0; --t )
1718 for( v = 0; v < njobs; ++v )
1728 timeinterval = lst - est + 1;
1730 for( t = 0; t < timeinterval; ++t )
1771 (*conshdlrdata)->eventhdlr = eventhdlr;
1774 (*conshdlrdata)->solveCumulative = solveCumulativeViaScipCp;
1776#ifdef SCIP_STATISTIC
1777 (*conshdlrdata)->nlbtimetable = 0;
1778 (*conshdlrdata)->nubtimetable = 0;
1779 (*conshdlrdata)->ncutofftimetable = 0;
1780 (*conshdlrdata)->nlbedgefinder = 0;
1781 (*conshdlrdata)->nubedgefinder = 0;
1782 (*conshdlrdata)->ncutoffedgefinder = 0;
1783 (*conshdlrdata)->ncutoffoverload = 0;
1784 (*conshdlrdata)->ncutoffoverloadTTEF = 0;
1786 (*conshdlrdata)->nirrelevantjobs = 0;
1787 (*conshdlrdata)->nalwaysruns = 0;
1788 (*conshdlrdata)->nremovedlocks = 0;
1789 (*conshdlrdata)->ndualfixs = 0;
1790 (*conshdlrdata)->ndecomps = 0;
1791 (*conshdlrdata)->ndualbranchs = 0;
1792 (*conshdlrdata)->nallconsdualfixs = 0;
1793 (*conshdlrdata)->naddedvarbounds = 0;
1794 (*conshdlrdata)->naddeddisjunctives = 0;
1836 for( v = 0; v < consdata->nvars; ++v )
1880 for( v = 0; v < consdata->nvars; ++v )
1898 nvars = consdata->nvars;
1901 for( v = 0; v <
nvars; ++v )
1903 consdata->downlocks[v] = locked;
1904 consdata->uplocks[v] = locked;
1938 (*consdata)->hmin = hmin;
1939 (*consdata)->hmax = hmax;
1941 (*consdata)->capacity = capacity;
1942 (*consdata)->demandrows =
NULL;
1943 (*consdata)->demandrowssize = 0;
1944 (*consdata)->ndemandrows = 0;
1945 (*consdata)->scoverrows =
NULL;
1946 (*consdata)->nscoverrows = 0;
1947 (*consdata)->scoverrowssize = 0;
1948 (*consdata)->bcoverrows =
NULL;
1949 (*consdata)->nbcoverrows = 0;
1950 (*consdata)->bcoverrowssize = 0;
1951 (*consdata)->nvars =
nvars;
1952 (*consdata)->varssize =
nvars;
1953 (*consdata)->signature = 0;
1954 (*consdata)->validsignature =
FALSE;
1955 (*consdata)->normalized =
FALSE;
1956 (*consdata)->covercuts =
FALSE;
1957 (*consdata)->propagated =
FALSE;
1958 (*consdata)->varbounds =
FALSE;
1959 (*consdata)->triedsolving =
FALSE;
1968 (*consdata)->linkingconss =
NULL;
1976 if( linkingconss !=
NULL )
1992 for( v = 0; v <
nvars; ++v )
1997 if( linkingconss !=
NULL )
2002 for( v = 0; v <
nvars; ++v )
2011 for( v = 0; v < (*consdata)->nvars; ++v )
2017 (*consdata)->vars =
NULL;
2018 (*consdata)->downlocks =
NULL;
2019 (*consdata)->uplocks =
NULL;
2020 (*consdata)->demands =
NULL;
2021 (*consdata)->durations =
NULL;
2022 (*consdata)->linkingconss =
NULL;
2026 (*consdata)->resstrength1 = -1.0;
2027 (*consdata)->resstrength2 = -1.0;
2028 (*consdata)->cumfactor1 = -1.0;
2029 (*consdata)->disjfactor1 = -1.0;
2030 (*consdata)->disjfactor2 = -1.0;
2031 (*consdata)->estimatedstrength = -1.0;
2050 for(
r = 0;
r < (*consdata)->ndemandrows; ++
r )
2058 (*consdata)->ndemandrows = 0;
2059 (*consdata)->demandrowssize = 0;
2062 for(
r = 0;
r < (*consdata)->nscoverrows; ++
r )
2070 (*consdata)->nscoverrows = 0;
2071 (*consdata)->scoverrowssize = 0;
2073 for(
r = 0;
r < (*consdata)->nbcoverrows; ++
r )
2081 (*consdata)->nbcoverrows = 0;
2082 (*consdata)->bcoverrowssize = 0;
2084 (*consdata)->covercuts =
FALSE;
2102 nvars = (*consdata)->nvars;
2103 varssize = (*consdata)->varssize;
2113 if( (*consdata)->linkingconss !=
NULL )
2115 for( v =
nvars-1; v >= 0; --v )
2117 assert((*consdata)->linkingconss[v] !=
NULL );
2153 for( v = 0; v < consdata->nvars; ++v )
2160 consdata->durations[v], consdata->demands[v]);
2162 SCIPinfoMessage(
scip, file,
")[%d,%d) <= %d", consdata->hmin, consdata->hmax, consdata->capacity);
2189 consdata->downlocks[pos] =
FALSE;
2190 consdata->uplocks[pos] =
FALSE;
2192 if( consdata->linkingconss !=
NULL )
2207 SCIPdebugMsg(
scip,
"remove variable <%s>[%g,%g] from cumulative constraint <%s>\n",
2213 if( pos != consdata->nvars - 1 )
2215 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
2216 consdata->downlocks[pos] = consdata->downlocks[consdata->nvars-1];
2217 consdata->uplocks[pos] = consdata->uplocks[consdata->nvars-1];
2218 consdata->demands[pos] = consdata->demands[consdata->nvars-1];
2219 consdata->durations[pos] = consdata->durations[consdata->nvars-1];
2221 if( consdata->linkingconss !=
NULL )
2223 consdata->linkingconss[pos]= consdata->linkingconss[consdata->nvars-1];
2228 consdata->validsignature =
FALSE;
2229 consdata->normalized =
FALSE;
2247 nvars = consdata->nvars;
2253 for( v = 0; v <
nvars; ++v )
2258 var = consdata->vars[v];
2274 consdata->linkingconss[v] = cons;
2313 SCIP_Bool* violated,
2315 SCIP_Bool printreason
2318 int* startsolvalues;
2334 (*violated) =
FALSE;
2350 for ( j = 0; j <
nvars; ++j )
2362 startsolvalues[j] =
MAX(solvalue, hmin);
2363 startindices[j] = j;
2365 endsolvalues[j] =
MAX(solvalue + durations[j], hmin);
2376 freecapacity = capacity;
2381 for( j = 0; j <
nvars; ++j )
2384 curtime = startsolvalues[j];
2386 if( curtime >= hmax )
2390 freecapacity -= demands[startindices[j]];
2391 while( j+1 <
nvars && startsolvalues[j+1] == curtime )
2394 freecapacity -= demands[startindices[j]];
2398 while( endindex < nvars && curtime >= endsolvalues[endindex] )
2400 freecapacity += demands[endindices[endindex]];
2403 assert(freecapacity <= capacity);
2406 if( absviol < (SCIP_Real) (-freecapacity) )
2408 absviol = -freecapacity;
2409 relviol =
SCIPrelDiff((SCIP_Real)(capacity - freecapacity), (SCIP_Real)capacity);
2413 if( freecapacity < 0 && curtime >= hmin )
2427 ";\nviolation: at time point %d available capacity = %d, needed capacity = %d\n",
2428 curtime, capacity, capacity - freecapacity);
2430 for(
i = 0;
i <= j; ++
i )
2432 if( startsolvalues[
i] + durations[startindices[
i]] > curtime )
2436 demands[startindices[
i]]);
2465 SCIP_Bool* violated,
2466 SCIP_Bool printreason
2482 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
2483 violated, cons, printreason) );
2511 SCIP_Bool usebdwidening,
2513 SCIP_Bool* explanation
2517 SCIP_Bool* reported;
2527 SCIPdebugMsg(
scip,
"variable <%s>: (demand %d) resolve propagation of core time algorithm (peak %d)\n",
2532 capacity -= inferdemand;
2542 for( j = 0; j < nvars && capacity >= 0; ++j )
2548 if(
var == infervar )
2551 duration = durations[j];
2560 SCIPdebugMsg(
scip,
"variable <%s>: glb=[%g,%g] conflict=[%g,%g] (duration %d, demand %d)\n",
2570 if( inferpeak < ect && lst <= inferpeak )
2572 capacity -= demands[j];
2575 maxlst =
MAX(maxlst, lst);
2576 minect =
MIN(minect, ect);
2579 if( explanation !=
NULL )
2580 explanation[j] =
TRUE;
2597 if( inferpeak < ect && lst <= inferpeak )
2599 capacity -= demands[j];
2602 maxlst =
MAX(maxlst, lst);
2603 minect =
MIN(minect, ect);
2606 if( explanation !=
NULL )
2607 explanation[j] =
TRUE;
2623 for( j = 0; j <
nvars; ++j )
2629 if(
var == infervar || reported[j] )
2632 duration = durations[j];
2645 SCIPdebugMsg(
scip,
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
2650 if( inferpeak < ect && lst <= inferpeak )
2653 canddemands[ncands] = demands[j];
2656 capacity -= demands[j];
2667 while( capacity + canddemands[ncands-1] < 0 )
2670 capacity += canddemands[ncands];
2675 for(
c = 0;
c < ncands; ++
c )
2680 duration = durations[cands[
c]];
2685 maxlst =
MAX(maxlst, lst);
2686 minect =
MIN(minect, ect);
2690 SCIPdebugMsg(
scip,
"infer peak %d, relaxed peak %d, lst %d, ect %d\n", inferpeak, relaxedpeak, maxlst, minect);
2691 assert(inferpeak >= maxlst);
2692 assert(inferpeak < minect);
2695 if( relaxedpeak < inferpeak )
2697 inferpeak =
MAX(maxlst, relaxedpeak);
2699 else if( relaxedpeak > inferpeak )
2701 inferpeak =
MIN(minect-1, relaxedpeak);
2703 assert(inferpeak >= hmin);
2704 assert(inferpeak < hmax);
2705 assert(inferpeak >= maxlst);
2706 assert(inferpeak < minect);
2709 for(
c = 0;
c < ncands; ++
c )
2716 duration = durations[cands[
c]];
2727 if( explanation !=
NULL )
2728 explanation[cands[
c]] =
TRUE;
2737 if( provedpeak !=
NULL )
2738 *provedpeak = inferpeak;
2758 ect = est + duration;
2759 lct = lst + duration;
2762 if( lct <= end && est >= begin )
2765 assert(lst <= end && ect >= begin);
2773 return MIN3(left, right, end - begin);
2794 SCIP_Real relaxedbd,
2795 SCIP_Bool usebdwidening,
2796 SCIP_Bool* explanation
2803 SCIP_Longint requiredenergy;
2811 requiredenergy = ((
SCIP_Longint) end - begin) * capacity;
2818 for( v = 0; v <
nvars; ++v )
2834 demand = demands[v];
2837 duration = durations[v];
2841 if( infervar ==
var )
2849 SCIPdebugMsg(
scip,
"inference variable <%s>[%g,%g] %s %g (duration %d, demand %d)\n",
2872 right =
MIN3(end - lst, end - begin, duration);
2882 left =
MIN(lct - begin + 1, end - begin);
2886 overlap =
MIN(left, right);
2888 assert(overlap <= end - begin);
2889 assert(overlap <= duration);
2919 left =
MIN3(ect - begin, end - begin, duration);
2929 right =
MIN(end - est + 1, end - begin);
2933 overlap =
MIN(left, right);
2935 assert(overlap <= end - begin);
2936 assert(overlap <= duration);
2952 if( explanation !=
NULL )
2953 explanation[v] =
TRUE;
2967 if( est + duration > begin && lst < end )
2970 glbenergy =
computeOverlap(begin, end, est, lst, duration) * demand;
2973 requiredenergy -= glbenergy;
2975 if( explanation !=
NULL )
2976 explanation[v] =
TRUE;
2986 if( est + duration > begin && lst < end )
2991 locenergies[v] = overlaps[v] * demand - glbenergy;
2992 assert(locenergies[v] >= 0);
3000 for( v = 0; v < nvars && requiredenergy >= 0; ++v )
3016 duration = durations[idx];
3019 overlap = overlaps[v];
3022 requiredenergy -= locenergies[v];
3024 if( requiredenergy < -1 )
3028 demand = demands[idx];
3031 overlap += (int)((requiredenergy + 1) / demand);
3034 requiredenergy += locenergies[v];
3036 assert(requiredenergy < 0);
3041 relaxlb = begin - duration + overlap;
3042 relaxub = end - overlap;
3044 SCIPdebugMsg(
scip,
"variable <%s> glb=[%g,%g] loc=[%g,%g], conf=[%g,%g], added=[%d,%d] (demand %d, duration %d)\n",
3049 relaxlb, relaxub, demands[idx], duration);
3054 if( explanation !=
NULL )
3055 explanation[idx] =
TRUE;
3058 assert(requiredenergy < 0);
3082 SCIP_Real relaxedbd,
3083 SCIP_Bool usebdwidening,
3084 SCIP_Bool* explanation,
3101 if( inferpos >=
nvars ||
vars[inferpos] != infervar )
3104 for( inferpos = 0; inferpos <
nvars &&
vars[inferpos] != infervar; ++inferpos )
3110 inferdemand = demands[inferpos];
3111 inferduration = durations[inferpos];
3120 SCIPdebugMsg(
scip,
"variable <%s>: upper bound changed from %g to %g (relaxed %g)\n",
3133 relaxedpeak =
MIN(relaxedpeak, hmax-1);
3139 relaxedpeak =
MAX(relaxedpeak, inferpeak);
3140 assert(relaxedpeak >= inferpeak);
3141 assert(relaxedpeak >= hmin);
3147 SCIPdebugMsg(
scip,
"variable <%s>: lower bound changed from %g to %g (relaxed %g)\n",
3160 relaxedpeak =
MAX(relaxedpeak, hmin);
3166 relaxedpeak =
MIN(relaxedpeak, inferpeak);
3167 assert(relaxedpeak < hmax);
3172 infervar, inferdemand, inferpeak, relaxedpeak, bdchgidx, usebdwidening, &provedpeak, explanation) );
3201 if( explanation !=
NULL )
3202 explanation[inferpos] =
TRUE;
3216 begin =
MAX(begin, hmin);
3217 end =
MIN(end, hmax);
3220 begin, end, infervar, boundtype, bdchgidx, relaxedbd, usebdwidening, explanation) );
3251 int* alternativelbs,
3252 int* alternativeubs,
3260 for( v = 0; v <
nvars; ++v )
3276 if( alternativelbs[v] <= ub )
3294 if( alternativeubs[v] >= lb )
3322#if defined SCIP_DEBUG && !defined NDEBUG
3334 assert(starttimes[*idx] == curtime);
3336 assert(freecapacity != idx);
3339 (*freecapacity) -= consdata->demands[startindices[*idx]];
3341 while( (*idx)+1 <
nvars && starttimes[(*idx)+1] == curtime )
3344 (*freecapacity) -= consdata->demands[startindices[(*idx)]];
3345 assert(freecapacity != idx);
3364#if defined SCIP_DEBUG && !defined NDEBUG
3370 while( endtimes[*idx] <= curtime && *idx <
nvars)
3372 (*freecapacity) += consdata->demands[endindices[*idx]];
3407 nvars = consdata->nvars;
3410 *timepoint = consdata->hmax;
3421 starttimes, endtimes, startindices, endindices);
3424 freecapacity = consdata->capacity;
3425 hmin = consdata->hmin;
3426 hmax = consdata->hmax;
3429 for( j = 0; j <
nvars; ++j )
3431 curtime = starttimes[j];
3434 if( curtime >= hmax )
3443 assert(freecapacity <= consdata->capacity);
3450 if( freecapacity < 0 && curtime >= hmin )
3452 *timepoint = curtime;
3484 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3489 for(
c = 0;
c < nconss; ++
c )
3509 if( curtime < consdata->hmin || curtime >= consdata->hmax )
3513 for( j = 0; j < consdata->nvars; ++j )
3519 var = consdata->vars[j];
3529 if( lb <= curtime && ub + consdata->durations[j] > curtime && lb < ub )
3535 score =
MIN(solval - lb, ub - solval) / ((
SCIP_Real)ub-lb);
3571 if( nbranchcands > 0 )
3582 for(
c = 0;
c < nconss && !violated; ++
c )
3614 SCIP_Bool* downlocks;
3622 nvars = consdata->nvars;
3623 vars = consdata->vars;
3624 downlocks = consdata->downlocks;
3625 uplocks = consdata->uplocks;
3628 for( v = 0; v <
nvars; ++v )
3650 SCIP_Longint maxnodes,
3655 SCIP_Bool* unbounded
3663 SCIP_Real timelimit;
3664 SCIP_Real memorylimit;
3693 if( ncheckconss == 1 )
3743 if( consdata->triedsolving )
3753 consdata->triedsolving =
TRUE;
3755 SCIPdebugMsg(
scip,
"the cumulative constraint <%s> is independent from rest of the problem (%d variables, %d constraints)\n",
3759 nvars = consdata->nvars;
3760 vars = consdata->vars;
3766 for( v = 0; v <
nvars; ++v )
3797 consdata->hmin, consdata->hmax, timelimit, memorylimit, maxnodes, &solved,
cutoff, unbounded, &error) );
3799 if( !(*
cutoff) && !(*unbounded) && !error )
3801 SCIP_Bool infeasible;
3802 SCIP_Bool tightened;
3807 for( v = 0; v <
nvars; ++v )
3810 if( lbs[v] + 0.5 > ubs[v] )
3818 consdata->triedsolving =
FALSE;
3829 consdata->triedsolving =
FALSE;
3838 consdata->triedsolving =
FALSE;
3875 SCIP_Bool usebdwidening,
3876 SCIP_Bool* initialized,
3877 SCIP_Bool* explanation
3880 SCIPdebugMsg(
scip,
"detected infeasibility due to adding a core to the core resource profile\n");
3890 infervar, inferdemand, inferpeak, inferpeak,
NULL, usebdwidening,
NULL, explanation) );
3906 *initialized =
TRUE;
3931 SCIP_Bool usebdwidening,
3932 SCIP_Bool* initialized,
3933 SCIP_Bool* explanation,
3934 SCIP_Bool* infeasible
3950 duration = durations[idx];
3953 demand = demands[idx];
3965 SCIPdebugMsg(
scip,
"propagate earliest start time (lower bound) (pos %d)\n", pos);
3971 SCIP_Bool tightened;
3983 ect = est + duration;
4011 newlb =
MIN(newlb, ect);
4020 var, duration, demand, newlb-1, usebdwidening, initialized, explanation) );
4022 if( explanation !=
NULL )
4023 explanation[idx] =
TRUE;
4112 lct = lst + duration;
4130 SCIP_Bool tightened;
4131 SCIP_Bool infeasible;
4170 newub =
MAX(newub, lst) - duration;
4204 lct = lst + duration;
4226 int* coreEnergyAfterEst,
4227 int* coreEnergyAfterLct
4236 t = ntimepoints - 1;
4240 for( v =
nvars-1; v >= 0; --v )
4258 coreEnergyAfterEst[v] = energy;
4261 t = ntimepoints - 1;
4265 for( v =
nvars-1; v >= 0; --v )
4283 coreEnergyAfterLct[v] = energy;
4308 for( v = 0; v <
nvars; ++ v)
4319 duration = durations[v];
4324 ect = est + duration;
4325 lct = lst + duration;
4336 leftadjust =
MAX(0, hmin - est);
4339 rightadjust =
MAX(0, lct - hmax);
4342 flexenergies[v] = duration - leftadjust - rightadjust - core;
4343 flexenergies[v] =
MAX(0, flexenergies[v]);
4344 flexenergies[v] *= demands[v];
4345 assert(flexenergies[v] >= 0);
4348 ects[v] =
MIN(ect, lst);
4351 lsts[v] =
MAX(ect, lst);
4375 SCIP_Longint energy,
4378 SCIP_Bool* initialized,
4379 SCIP_Bool* explanation,
4389 if( !conshdlrdata->ttefinfer )
4393 if( est >= end || ect <= begin )
4399 if( est >= begin && ect <= end )
4405 if( energy >= demand * ((SCIP_Longint)
MAX(begin, est) -
MIN(end, ect)) )
4420 newlb = end - (int) (energy / demand);
4425 if( newlb > lct - duration )
4430 SCIP_Real relaxedbd;
4447 (*initialized) =
TRUE;
4452 else if( newlb > (*bestlb) )
4488 SCIP_Longint energy,
4491 SCIP_Bool* initialized,
4492 SCIP_Bool* explanation,
4503 if( !conshdlrdata->ttefinfer )
4507 if( lst >= end || lct <= begin )
4513 if( lst >= begin && lct <= end )
4517 if( energy >= demand * ((SCIP_Longint)
MIN(end, lct) -
MAX(begin, lst)) )
4534 newub = begin - duration + (int) (energy / demand);
4544 SCIP_Real relaxedbd;
4561 (*initialized) =
TRUE;
4566 else if( newub < (*bestub) )
4603 int* coreEnergyAfterEst,
4604 int* coreEnergyAfterLct,
4605 SCIP_Bool* initialized,
4606 SCIP_Bool* explanation,
4610 int coreEnergyAfterEnd;
4611 SCIP_Longint maxavailable;
4612 SCIP_Longint minavailable;
4613 SCIP_Longint totalenergy;
4625 for( v = 0; v <
nvars; ++v )
4630 est =
MIN(est, start);
4631 lct =
MAX(lct, end);
4635 hmin =
MAX(hmin, est);
4636 hmax =
MIN(hmax, lct);
4639 coreEnergyAfterEnd = -1;
4641 maxavailable = ((
SCIP_Longint) hmax - hmin) * capacity;
4642 minavailable = maxavailable;
4646 if( ((SCIP_Longint) lcts[0] - ests[
nvars-1]) * capacity >= totalenergy )
4654 for( v =
nvars-1; v >= 0 && !(*cutoff); --v )
4673 assert(v == 0 || lcts[v-1] <= lcts[v]);
4689 if( !conshdlrdata->ttefinfer && end <= hmax && minavailable < maxavailable )
4691 SCIP_Longint freeenergy;
4693 assert(coreEnergyAfterLct[v] >= coreEnergyAfterEnd);
4694 assert(coreEnergyAfterEnd >= 0);
4697 freeenergy = capacity * ((
SCIP_Longint) end - lct) - coreEnergyAfterLct[v] + coreEnergyAfterEnd;
4699 if( freeenergy <= minavailable )
4709 coreEnergyAfterEnd = coreEnergyAfterLct[v];
4712 minavailable = maxavailable;
4721 for(
i = nests-1;
i >= 0; --
i )
4724 SCIP_Longint freeenergy;
4751 if( ((SCIP_Longint) end - est) * capacity >= totalenergy )
4757 duration = durations[idx];
4760 demand = demands[idx];
4772 if( minavailable < maxavailable && est < minbegin )
4778 var, duration, demand, est, lst, lct, minbegin, end, minavailable, &(newubs[idx]), &(ubinferinfos[idx]),
4779 initialized, explanation,
cutoff) );
4785 SCIPdebugMsg(
scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, lst of free part <%d>\n",
4802 assert(flexenergies[idx] >= 0);
4803 flexenergy += flexenergies[idx];
4816 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (end - lst)));
4817 assert(end - lst < duration);
4821 flexenergy += energy;
4824 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
4828 if( candenergy > lbenergy )
4830 lbenergy = candenergy;
4835 SCIPdebugMsg(
scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
4836 assert(coreEnergyAfterEst[
i] >= coreEnergyAfterEnd);
4839 freeenergy = capacity * ((
SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterEst[
i] + coreEnergyAfterEnd;
4842 if( freeenergy < 0 )
4844 SCIPdebugMsg(
scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
4854 conshdlrdata->usebdwidening, explanation) );
4856 (*initialized) =
TRUE;
4868 if( lbenergy > 0 && freeenergy < lbenergy )
4870 SCIP_Longint energy;
4878 energy = freeenergy + (
computeCoreWithInterval(begin, end, ect, lst) +
MAX(0, (SCIP_Longint) end - lsts[lbcand])) * demands[lbcand];
4880 newlb = end - (int)(energy / demands[lbcand]);
4887 SCIP_Real relaxedbd;
4892 relaxedbd = lst + 1.0;
4899 conshdlrdata->usebdwidening, explanation) );
4901 (*initialized) =
TRUE;
4907 else if( newlb > newlbs[lbcand] )
4916 newlbs[lbcand] = newlb;
4921 if( minavailable > freeenergy )
4923 minavailable = freeenergy;
4926 assert(minavailable >= 0);
4954 int* coreEnergyAfterEst,
4955 int* coreEnergyAfterLct,
4956 SCIP_Bool* initialized,
4957 SCIP_Bool* explanation,
4961 int coreEnergyAfterStart;
4962 SCIP_Longint maxavailable;
4963 SCIP_Longint minavailable;
4964 SCIP_Longint totalenergy;
4982 for( v = 0; v <
nvars; ++v )
4987 minest =
MIN(minest, start);
4988 maxlct =
MAX(maxlct, end);
4992 hmin =
MAX(hmin, minest);
4993 hmax =
MIN(hmax, maxlct);
4995 maxavailable = ((
SCIP_Longint) hmax - hmin) * capacity;
4999 if( ((SCIP_Longint) lcts[0] - ests[
nvars-1]) * capacity >= totalenergy )
5007 for( v = 0; v <
nvars; ++v )
5039 coreEnergyAfterStart = coreEnergyAfterEst[v];
5042 minavailable = maxavailable;
5053 SCIP_Longint freeenergy;
5080 if( ((SCIP_Longint) lct - begin) * capacity >= totalenergy )
5086 duration = durations[idx];
5089 demand = demands[idx];
5101 if( minavailable < maxavailable && lct > minend )
5107 var, duration, demand, est, ect, lct, begin, minend, minavailable, &(newlbs[idx]), &(lbinferinfos[idx]),
5108 initialized, explanation,
cutoff) );
5114 SCIPdebugMsg(
scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, ect of free part <%d>\n",
5131 assert(flexenergies[idx] >= 0);
5132 flexenergy += flexenergies[idx];
5145 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (ect - begin)));
5146 assert(ect - begin < duration);
5150 flexenergy += energy;
5153 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
5157 if( candenergy > ubenergy )
5159 ubenergy = candenergy;
5164 SCIPdebugMsg(
scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
5165 assert(coreEnergyAfterLct[
i] <= coreEnergyAfterStart);
5168 freeenergy = capacity * ((
SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterStart + coreEnergyAfterLct[
i];
5171 if( freeenergy < 0 )
5173 SCIPdebugMsg(
scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
5183 conshdlrdata->usebdwidening, explanation) );
5185 (*initialized) =
TRUE;
5197 if( ubenergy > 0 && freeenergy < ubenergy )
5199 SCIP_Longint energy;
5203 duration = durations[ubcand];
5210 energy = freeenergy + (
computeCoreWithInterval(begin, end, ect, lst) +
MAX(0, (SCIP_Longint) ects[ubcand] - begin)) * demands[ubcand];
5212 newub = begin - duration + (int)(energy / demands[ubcand]);
5214 if( newub < ect - duration )
5219 SCIP_Real relaxedbd;
5223 relaxedbd = ect - duration - 1.0;
5230 conshdlrdata->usebdwidening, explanation) );
5232 (*initialized) =
TRUE;
5238 else if( newub < newubs[ubcand] )
5247 newubs[ubcand] = newub;
5252 if( minavailable > freeenergy )
5254 minavailable = freeenergy;
5257 assert(minavailable >= 0);
5288 SCIP_Bool* initialized,
5289 SCIP_Bool* explanation,
5293 int* coreEnergyAfterEst;
5294 int* coreEnergyAfterLct;
5315 if( !conshdlrdata->ttefcheck )
5336 for( v = 0; v <
nvars; ++v )
5340 lbinferinfos[v] = 0;
5341 ubinferinfos[v] = 0;
5345 collectDataTTEF(
scip,
nvars,
vars, durations, demands, hmin, hmax, permests, ests, permlcts, lcts, ects, lsts, flexenergies);
5358 newlbs, newubs, lbinferinfos, ubinferinfos, lsts, flexenergies,
5359 permests, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation,
cutoff) );
5363 newlbs, newubs, lbinferinfos, ubinferinfos, ects, flexenergies,
5364 permlcts, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation,
cutoff) );
5367 for( v = 0; v <
nvars && !(*cutoff); ++v )
5369 SCIP_Bool infeasible;
5370 SCIP_Bool tightened;
5375 TRUE, &infeasible, &tightened) );
5396 TRUE, &infeasible, &tightened) );
5439 conshdlrdata->usebdwidening, explanation) );
5441 (*initialized) =
TRUE;
5497 SCIP_Bool* initialized,
5498 SCIP_Bool* explanation,
5502 SCIP_Bool infeasible;
5515 if( !conshdlrdata->ttinfer )
5520 SCIPdebugMsg(
scip,
"propagate cores of cumulative condition of constraint <%s>[%d,%d) <= %d\n",
5530 for( v = 0; v <
nvars; ++v )
5543 duration = durations[v];
5555 if( lst + duration <= hmin || est >= hmax )
5559 begin =
MAX(hmin, lst);
5560 end =
MIN(hmax, est + duration);
5562 demand = demands[v];
5568 SCIPdebugMsg(
scip,
"variable <%s>[%g,%g] (duration %d, demand %d): remove core [%d,%d)\n",
5576 profile, v, nchgbds, conshdlrdata->usebdwidening, initialized, explanation,
cutoff) );
5583 profile, v, nchgbds) );
5593 begin =
MAX(hmin, lst);
5594 end =
MIN(hmax, est + duration);
5601 SCIPdebugMsg(
scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
5610 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
5612 if( explanation !=
NULL )
5613 explanation[v] =
TRUE;
5640 SCIP_Longint enveloptheta;
5643 SCIP_Longint enveloplambda;
5663 SCIPdebugMsg(
scip,
"update envelop starting from node <%p>\n", (
void*)node);
5668 while( node !=
NULL )
5687 if( leftdata->enveloptheta >= 0 )
5689 assert(rightdata->energytheta != -1);
5690 nodedata->enveloptheta =
MAX(leftdata->enveloptheta + rightdata->energytheta, rightdata->enveloptheta);
5693 nodedata->enveloptheta = rightdata->enveloptheta;
5695 assert(leftdata->energytheta != -1);
5696 assert(rightdata->energytheta != -1);
5697 nodedata->energytheta = leftdata->energytheta + rightdata->energytheta;
5699 if( leftdata->enveloplambda >= 0 )
5701 assert(rightdata->energytheta != -1);
5702 nodedata->enveloplambda =
MAX(leftdata->enveloplambda + rightdata->energytheta, rightdata->enveloplambda);
5705 nodedata->enveloplambda = rightdata->enveloplambda;
5707 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0 )
5708 nodedata->enveloplambda =
MAX(
nodedata->enveloplambda, leftdata->enveloptheta + rightdata->energylambda);
5712 if( leftdata->energylambda >= 0 && rightdata->energylambda >= 0 )
5714 assert(rightdata->energytheta != -1);
5715 assert(leftdata->energytheta != -1);
5716 nodedata->energylambda =
MAX(leftdata->energylambda + rightdata->energytheta, leftdata->energytheta + rightdata->energylambda);
5718 else if( rightdata->energylambda >= 0 )
5720 assert(leftdata->energytheta != -1);
5721 nodedata->energylambda = leftdata->energytheta + rightdata->energylambda;
5723 else if( leftdata->energylambda >= 0 )
5725 assert(rightdata->energytheta != -1);
5726 nodedata->energylambda = leftdata->energylambda + rightdata->energytheta;
5807 if( grandparent !=
NULL )
5917 if(
nodedata->key < leafdata->key )
5930 newnodedata = &nodedatas[*nnodedatas];
5931 nodedataidx[*nnodedatas] = *nnodedatas;
5935 newnodedata->var =
NULL;
5937 newnodedata->est = INT_MIN;
5938 newnodedata->lct = INT_MAX;
5939 newnodedata->duration = 0;
5940 newnodedata->demand = 0;
5941 newnodedata->enveloptheta = -1;
5942 newnodedata->energytheta = 0;
5943 newnodedata->enveloplambda = -1;
5944 newnodedata->energylambda = -1;
5945 newnodedata->idx = -1;
5946 newnodedata->intheta =
TRUE;
5954 if( parent !=
NULL )
5971 if(
nodedata->key < leafdata->key )
5983 newnodedata->key = leafdata->key;
6033 assert(rightdata->energytheta != -1);
6035 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6038 assert(leftdata->energytheta != -1);
6039 assert(rightdata->energylambda != -1);
6040 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6082 assert(rightdata->energytheta != -1);
6085 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6087 else if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6088 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6091 assert(rightdata->enveloplambda != -1);
6124 omegaset[*nelements] = node;
6177 assert(rightdata->energytheta != -1);
6179 if( leftdata->enveloptheta >= 0 &&
nodedata->enveloptheta == leftdata->enveloptheta + rightdata->energytheta )
6186 assert(rightdata->enveloptheta != -1);
6232 assert(rightdata->energytheta != -1);
6234 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6241 assert(leftdata->energytheta != -1);
6242 assert(rightdata->energylambda != -1);
6243 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6292 assert(rightdata->energytheta != -1);
6294 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6301 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6302 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6309 assert(rightdata->enveloplambda != -1);
6332 SCIPdebugMessage(
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
6337 return nodedata->demand * duration;
6350 return (est1 - est2);
6360 return (nodedatas[ind1].lct - nodedatas[ind2].lct);
6379 SCIP_Bool usebdwidening,
6380 SCIP_Bool* initialized,
6381 SCIP_Bool* explanation
6384 SCIP_Longint energy;
6391 SCIPdebugMsg(
scip,
"est=%d, lct=%d, propest %u, reportedenergy %d, shift %d\n", est, lct, propest, reportedenergy, shift);
6402 for( j = 0; j < nleaves && reportedenergy <= energy; ++j )
6418 assert(reportedenergy > energy);
6446 for( j = nleaves-1; j >= 0; --j )
6466 if( explanation !=
NULL )
6470 (*initialized) =
TRUE;
6495 if( energy > ((SCIP_Longint) capacity - demand) * ((SCIP_Longint) lct - est) )
6497 if( energy + (SCIP_Longint) demand * duration > capacity * ((SCIP_Longint) lct - est) )
6499 newest = (int)
SCIPfeasCeil(
scip, (energy - (SCIP_Real)(capacity - demand) * (lct - est)) / (SCIP_Real)demand);
6523 SCIP_Bool* initialized,
6524 SCIP_Bool* explanation,
6538 for( j = ncands-1; j >= 0 && !(*cutoff); --j )
6549 while( !(*
cutoff) && rootdata->enveloplambda > (SCIP_Longint) capacity *
nodedata->lct )
6569 assert(!leafdata->intheta);
6570 assert(leafdata->duration > 0);
6571 assert(leafdata->est >= 0);
6574 if( leafdata->est + leafdata->duration >=
nodedata->lct )
6596 assert(nelements < ncands);
6603 SCIPdebugMsg(
scip,
"an overload was detected duration edge-finder propagattion\n");
6607 conshdlrdata->usebdwidening, initialized, explanation) );
6613 else if( newest > 0 )
6615 SCIP_Bool infeasible;
6616 SCIP_Bool tightened;
6635 TRUE, &infeasible, &tightened) );
6657 TRUE, &infeasible, &tightened) );
6667 leafdata->est = newest;
6686 if( explanation !=
NULL )
6687 explanation[leafdata->idx] =
TRUE;
6690 for(
i = 0;
i < nelements; ++
i )
6698 if( explanation !=
NULL )
6702 (*initialized) =
TRUE;
6749 SCIP_Bool* initialized,
6750 SCIP_Bool* explanation,
6796 for( j = 0; j <
nvars; ++j )
6801 shift =
MAX(shift, lct);
6808 for( j = 0; j <
nvars; ++j )
6822 duration = durations[j];
6834 if( conshdlrdata->useadjustedjobs )
6838 leftadjust = (hmin - est);
6843 rightadjust = (lct - hmax);
6850 if( duration - leftadjust - rightadjust <= 0 )
6853 else if( est < hmin || lct > hmax )
6856 energy = demands[j] * (duration - leftadjust - rightadjust);
6859 totalenergy += energy;
6882 nodedataidx[ncands] = ncands;
6894 nodedata->rightadjust = rightadjust;
6909 nnodedatas = ncands;
6912 SCIPsortInd(nodedataidx, compNodedataLct, (
void*)nodedatas, ncands);
6919 for( j = 0; j < ncands; ++j )
6924 idx = nodedataidx[j];
6929 if( ((SCIP_Longint) nodedatas[idx].lct - nodedatas[idx].est) * capacity >= totalenergy )
6932 nodedatas[idx].est = -1;
6944 leaves[ninsertcands] = leaf;
6952 if( rootdata->enveloptheta > (SCIP_Longint) capacity * nodedatas[idx].lct )
6954 SCIPdebugMsg(
scip,
"detects cutoff due to overload in time window [?,%d) (ncands %d)\n", nodedatas[idx].lct, j);
6973 est = nodedatas[idx].est;
6974 lct = nodedatas[idx].lct;
6979 for( j = j+1; j < ncands; ++j )
6986 idx = nodedataidx[j];
6998 duration -= (est - glbest);
7001 duration -= (glblct - lct);
7005 glbenery +=
nodedata->demand * duration;
7007 if( explanation !=
NULL )
7014 conshdlrdata->usebdwidening, initialized, explanation) );
7016 else if( ninsertcands > 1 && conshdlrdata->efinfer )
7020 propest, shift, initialized, explanation, nchgbds,
cutoff) );
7052 SCIP_Bool* initialized,
7053 SCIP_Bool* explanation,
7063 if( !conshdlrdata->efcheck )
7068 cons,
TRUE, initialized, explanation, nchgbds,
cutoff) );
7075 if( !conshdlrdata->efinfer )
7080 cons,
FALSE, initialized, explanation, nchgbds,
cutoff) );
7099 SCIP_Bool* redundant
7119 (*redundant) =
TRUE;
7135 for( j = 0; j <
nvars; ++j )
7137 assert(durations[j] > 0);
7147 if( lb >= hmax || ub + durations[j] <= hmin )
7150 starttimes[njobs] =
MAX(lb, hmin);
7151 startindices[njobs] = j;
7153 endtimes[njobs] =
MIN(ub + durations[j], hmax);
7154 endindices[njobs] = j;
7155 assert(starttimes[njobs] <= endtimes[njobs]);
7164 freecapacity = capacity;
7167 for( j = 0; j < njobs; ++j )
7169 curtime = starttimes[j];
7172 if( curtime >= hmax )
7176 freecapacity -= demands[startindices[j]];
7177 while( j+1 < njobs && starttimes[j+1] == curtime )
7180 freecapacity -= demands[startindices[j]];
7184 while( endtimes[endindex] <= curtime )
7186 freecapacity += demands[endindices[endindex]];
7189 assert(freecapacity <= capacity);
7192 if( freecapacity < 0 && curtime >= hmin )
7194 (*redundant) =
FALSE;
7223 SCIP_Bool* initialized,
7224 SCIP_Bool* explanation,
7231 for( v = 0; v <
nvars; ++v )
7234 SCIP_Bool infeasible;
7248 duration = durations[v];
7251 demand = demands[v];
7259 if( lst + duration <= hmin || est >= hmax )
7263 begin =
MAX(hmin, lst);
7264 end =
MIN(hmax, est + duration);
7270 SCIPdebugMsg(
scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
7284 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
7286 if( explanation !=
NULL )
7287 explanation[v] =
TRUE;
7316 SCIP_Bool* redundant,
7317 SCIP_Bool* initialized,
7318 SCIP_Bool* explanation,
7343 SCIP_CALL_TERMINATE( retcode,
createCoreProfile(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax,
7344 initialized, explanation,
cutoff), TERMINATE );
7349 SCIP_CALL_TERMINATE( retcode,
propagateTimetable(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
7350 nchgbds, initialized, explanation,
cutoff), TERMINATE );
7356 SCIP_CALL_TERMINATE( retcode,
propagateEdgeFinding(
scip, conshdlrdata,
nvars,
vars, durations, demands, capacity, hmin, hmax,
7357 cons, initialized, explanation, nchgbds,
cutoff), TERMINATE );
7363 SCIP_CALL_TERMINATE( retcode,
propagateTTEF(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
7364 nchgbds, initialized, explanation,
cutoff), TERMINATE );
7386 SCIP_Bool initialized;
7387 SCIP_Bool redundant;
7396 oldnchgbds = *nchgbds;
7397 initialized =
FALSE;
7411 consdata->nvars, consdata->vars, consdata->durations, consdata->demands, consdata->capacity,
7412 consdata->hmin, consdata->hmax, cons,
7413 nchgbds, &redundant, &initialized,
NULL,
cutoff) );
7417 SCIPdebugMsg(
scip,
"%s deletes cumulative constraint <%s> since it is redundant\n",
7437 if( *
cutoff || *nchgbds > oldnchgbds )
7444 consdata->propagated =
TRUE;
7463 SCIP_Real* leftimpllbs,
7464 SCIP_Real* leftimplubs,
7465 SCIP_Real* leftproplbs,
7466 SCIP_Real* leftpropubs,
7467 SCIP_Real* rightimpllbs,
7468 SCIP_Real* rightimplubs,
7469 SCIP_Real* rightproplbs,
7470 SCIP_Real* rightpropubs,
7477 SCIP_Bool tightened;
7498 leftimpllbs, leftimplubs, leftproplbs, leftpropubs,
cutoff) );
7533 rightimpllbs, rightimplubs, rightproplbs, rightpropubs,
cutoff) );
7557 SCIP_Bool* roundable
7606 SCIP_Bool* roundable
7661 int* alternativelbs,
7662 int* alternativeubs,
7671 for(
c = 0;
c < nconss; ++
c )
7688 assert(consdata->nvars > 1);
7713 hmin = consdata->hmin;
7714 hmax = consdata->hmax;
7720 nvars = consdata->nvars;
7722 for( v = 0; v <
nvars; ++v )
7728 var = consdata->vars[v];
7743 if( consdata->downlocks[v] )
7750 ect = est + consdata->durations[v];
7752 if( ect <= hmin || hmin >= hmax )
7754 else if( est < hmin && alternativelbs[idx] >= (hmin + 1 - constant) / scalar )
7756 alternativelbs[idx] = (hmin + 1 - constant) / scalar;
7762 if( consdata->uplocks[v] )
7768 duration = consdata->durations[v];
7772 lct = lst + duration;
7774 if( lst >= hmax || hmin >= hmax )
7776 else if( lct > hmax && alternativeubs[idx] <= ((hmax - 1 - constant) / scalar) - duration )
7778 alternativeubs[idx] = ((hmax - 1 - constant) / scalar) - duration;
7794 int* alternativelbs,
7795 int* alternativeubs,
7802 SCIP_Real* downimpllbs;
7803 SCIP_Real* downimplubs;
7804 SCIP_Real* downproplbs;
7805 SCIP_Real* downpropubs;
7806 SCIP_Real* upimpllbs;
7807 SCIP_Real* upimplubs;
7808 SCIP_Real* upproplbs;
7809 SCIP_Real* uppropubs;
7822 for( v = 0; v <
nvars; ++v )
7825 SCIP_Bool infeasible;
7827 SCIP_Bool roundable;
7835 if( alternativelbs[v] == INT_MAX && alternativeubs[v] == INT_MIN )
7851 if( alternativelbs[v] > ub )
7873 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7874 nfixedvars, &success,
cutoff) );
7897 if( alternativeubs[v] < lb )
7919 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7920 nfixedvars, &success,
cutoff) );
7959 int* alternativelbs;
7960 int* alternativeubs;
7969 oldnfixedvars = *nfixedvars;
7978 for( v = 0; v <
nvars; ++v )
7982 alternativelbs[v] = INT_MAX;
7983 alternativeubs[v] = INT_MIN;
7993 if( !(*
cutoff) && oldnfixedvars == *nfixedvars && branched !=
NULL )
8046 nvars = consdata->nvars;
8053 remainingcap = consdata->capacity;
8056 for( j = 0; j <
nvars; ++j )
8063 if( startvalues[j] <= time && ub + consdata->durations[j] > time )
8066 if( startvalues[j] == ub )
8068 remainingcap -= consdata->demands[j];
8072 demands[nflexible] = consdata->demands[j];
8073 flexibleids[nflexible] = j;
8078 assert(remainingcap >= 0);
8094 while( j < nflexible && sumdemand <= remainingcap )
8096 sumdemand += demands[j];
8102 assert(sumdemand > remainingcap);
8103 assert(bigcoversize < nflexible);
8115 for( j = 0; j < nflexible; ++j )
8127 idx = flexibleids[j];
8140 start = time - consdata->durations[idx] + 1;
8141 end =
MIN(time, ub);
8146 if( vals[
b] < start || vals[
b] < lb )
8160 if( consdata->bcoverrowssize == 0 )
8162 consdata->bcoverrowssize = 10;
8165 if( consdata->nbcoverrows == consdata->bcoverrowssize )
8167 consdata->bcoverrowssize *= 2;
8171 consdata->bcoverrows[consdata->nbcoverrows] = row;
8172 consdata->nbcoverrows++;
8182 while( sumdemand <= remainingcap )
8185 sumdemand += demands[j];
8189 smallcoversize = nflexible - (j + 1) - 1;
8190 while( j > 0 && demands[j] == demands[nflexible-1] )
8193 assert(smallcoversize < nflexible);
8195 if( smallcoversize != 1 || smallcoversize != nflexible - (j + 1) - 1 )
8204 for( j = j + 1; j < nflexible; ++j )
8216 idx = flexibleids[j];
8229 start = time - consdata->durations[idx] + 1;
8230 end =
MIN(time, ub);
8235 if( vals[
b] < start || vals[
b] < lb )
8248 if( consdata->scoverrowssize == 0 )
8250 consdata->scoverrowssize = 10;
8253 if( consdata->nscoverrows == consdata->scoverrowssize )
8255 consdata->scoverrowssize *= 2;
8259 consdata->scoverrows[consdata->nscoverrows] = row;
8260 consdata->nscoverrows++;
8281 int* startvaluessorted;
8282 int* endvaluessorted;
8304 if( consdata->vars ==
NULL )
8307 nvars = consdata->nvars;
8308 hmin = consdata->hmin;
8309 hmax = consdata->hmax;
8319 for ( j = 0; j <
nvars; ++j )
8322 startvaluessorted[j] = startvalues[j];
8325 endvaluessorted[j] = endvalues[j];
8327 startindices[j] = j;
8337 freecapacity = consdata->capacity;
8340 for( j = 0; j <
nvars; ++j )
8342 curtime = startvaluessorted[j];
8343 if( curtime >= hmax )
8347 freecapacity -= consdata->demands[startindices[j]];
8349 while( j+1 <
nvars && startvaluessorted[j+1] == curtime )
8352 freecapacity -= consdata->demands[startindices[j]];
8356 while( endidx < nvars && curtime >= endvaluessorted[endidx] )
8358 freecapacity += consdata->demands[endindices[endidx]];
8362 assert(freecapacity <= consdata->capacity);
8372 if( freecapacity < 0 && curtime >= hmin )
8374 int nextprofilechange;
8378 nextprofilechange =
MIN( startvaluessorted[j+1], endvaluessorted[endidx] );
8380 nextprofilechange = endvaluessorted[endidx];
8382 nextprofilechange =
MIN(nextprofilechange, hmax);
8384 for( t = curtime; t < nextprofilechange; ++t )
8394 consdata->covercuts =
TRUE;
8418 SCIP_Bool cutsasconss
8429 assert(nstarted > nfinished);
8433 assert(consdata->nvars > 0);
8435 capacity = consdata->capacity;
8476 if( consdata->demandrowssize == 0 )
8478 consdata->demandrowssize = 10;
8481 if( consdata->ndemandrows == consdata->demandrowssize )
8483 consdata->demandrowssize *= 2;
8487 consdata->demandrows[consdata->ndemandrows] = row;
8488 consdata->ndemandrows++;
8504 SCIP_Bool cutsasconss
8530 nvars = consdata->nvars;
8543 SCIPdebugMsg(
scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
8548 starttimes, endtimes, startindices, endindices,
FALSE);
8551 freecapacity = consdata->capacity;
8552 hmin = consdata->hmin;
8553 hmax = consdata->hmax;
8556 for( j = 0; j <
nvars; ++j )
8558 curtime = starttimes[j];
8561 if( curtime >= hmax )
8570 assert(freecapacity <= consdata->capacity);
8577 if( freecapacity < 0 && curtime >= hmin )
8584 nextstarttime = starttimes[j+1];
8586 nextstarttime = endtimes[
nvars-1];
8588 nextstarttime =
MIN(nextstarttime, hmax);
8595 for( t = curtime+1 ; t < nextstarttime; ++t )
8600 if( freecapacity < 0 )
8635 SCIP_Bool cutsasconss
8643 assert(consdata->ndemandrows == 0);
8646 if( consdata->linkingconss ==
NULL )
8678 SCIP_Bool cutsasconss,
8679 SCIP_Bool* infeasible
8688 if( consdata->demandrows ==
NULL )
8690 assert(consdata->ndemandrows == 0);
8697 for(
r = 0;
r < consdata->ndemandrows && !(*infeasible); ++
r )
8715 SCIP_Bool* separated,
8736 if( consdata->demandrows ==
NULL )
8738 assert(consdata->ndemandrows == 0);
8748 for(
r = 0;
r < consdata->ndemandrows; ++
r )
8752 SCIP_Real feasibility;
8779 (*separated) =
TRUE;
8791 SCIP_Bool* separated,
8797 SCIP_Real minfeasibility;
8814 if( consdata->linkingconss ==
NULL )
8819 if( !consdata->covercuts )
8828 for(
r = 0;
r < consdata->nscoverrows; ++
r )
8832 SCIP_Real feasibility;
8840 if( minfeasibility > feasibility )
8842 minfeasibility = feasibility;
8843 row = consdata->scoverrows[
r];
8852 SCIPdebugMsg(
scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8859 (*separated) =
TRUE;
8866 for(
r = 0;
r < consdata->nbcoverrows; ++
r )
8870 SCIP_Real feasibility;
8878 if( minfeasibility > feasibility )
8880 minfeasibility = feasibility;
8881 row = consdata->bcoverrows[
r];
8890 SCIPdebugMsg(
scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8898 (*separated) =
TRUE;
8926 assert(nstarted > nfinished);
8930 assert(consdata->nvars > 0);
8952 for( v = 0; v < nstarted - nfinished; ++v )
8977 SCIP_Bool* separated,
9003 nvars = consdata->nvars;
9016 SCIPdebugMsg(
scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
9025 freecapacity = consdata->capacity;
9026 hmin = consdata->hmin;
9027 hmax = consdata->hmax;
9030 for( j = 0; j <
nvars && !(*cutoff); ++j )
9032 curtime = starttimes[j];
9034 if( curtime >= hmax )
9043 assert(freecapacity <= consdata->capacity);
9050 if( freecapacity < 0 && curtime >= hmin)
9096 nvars = consdata->nvars;
9103 capacity = consdata->capacity;
9106 for ( j = 0; j <
nvars; ++j )
9108 if( consdata->demands[j] > capacity )
9136 if( consdata->nvars == 0 )
9143 else if( consdata->nvars == 1 )
9145 if( consdata->demands[0] > consdata->capacity )
9184 hmin = consdata->hmin;
9185 hmax = consdata->hmax;
9187 SCIPdebugMsg(
scip,
"check for irrelevant jobs within cumulative constraint <%s>[%d,%d)\n",
9190 for( j = consdata->nvars-1; j >= 0; --j )
9192 var = consdata->vars[j];
9193 demand = consdata->demands[j];
9194 duration = consdata->durations[j];
9200 if( demand == 0 || duration == 0 )
9209 else if( est >= hmax || lct <= hmin )
9237 SCIP_Bool tightened;
9245 assert(consdata->durations[pos] > 0);
9246 assert(consdata->demands[pos] > 0);
9248 var = consdata->vars[pos];
9250 duration = consdata->durations[pos];
9253 SCIPdebugMsg(
scip,
" variable <%s>: demand <%d> is larger than the capacity <%d>\n",
9261 if( ect - duration >= consdata->hmax || lst + duration <= consdata->hmin)
9264 if( ect > consdata->hmin && lst < consdata->hmax )
9269 else if( lst < consdata->hmax )
9277 else if( ect > consdata->hmin )
9296 SCIP_Real boundtuple[2];
9302 leftbound = consdata->hmin - duration;
9303 rightbound = consdata->hmax;
9353 capacity = consdata->capacity;
9355 for( j = consdata->nvars-1; j >= 0 && !(*
cutoff); --j )
9357 if( consdata->demands[j] > capacity )
9381 SCIP_Bool infeasible;
9382 SCIP_Bool tightened;
9383 SCIP_Bool roundable;
9433 SCIP_Bool infeasible;
9434 SCIP_Bool tightened;
9435 SCIP_Bool roundable;
9487 if( *capacity == 1 ||
nvars <= 1 )
9497 for( v =
nvars-2; v >= 0 && (gcd >= 2 || mindemand1 + mindemand2 > *capacity); --v )
9499 assert(mindemand1 <= mindemand2);
9500 assert(demands[v] <= *capacity);
9504 if( mindemand1 > demands[v] )
9506 mindemand2 = mindemand1;
9507 mindemand1 = demands[v];
9509 else if( mindemand2 > demands[v] )
9510 mindemand2 = demands[v];
9513 if( mindemand1 + mindemand2 > *capacity )
9515 SCIPdebugMsg(
scip,
"update cumulative condition (%d + %d > %d) to unary cumulative condition\n", mindemand1, mindemand2, *capacity);
9517 for( v = 0; v <
nvars; ++v )
9522 (*nchgcoefs) +=
nvars;
9529 for( v = 0; v <
nvars; ++v )
9530 demands[v] /= (
int) gcd;
9532 (*capacity) /= (int) gcd;
9534 (*nchgcoefs) +=
nvars;
9561 if( consdata->normalized )
9564 capacity = consdata->capacity;
9570 consdata->normalized =
TRUE;
9572 if( capacity > consdata->capacity )
9573 consdata->varbounds =
FALSE;
9629 for( t = 0; t < ntimepoints; ++t )
9632 if( timepoints[t] <= *hmin )
9636 if( timepoints[t] >= *hmax )
9642 if( loads[t] <= capacity )
9644 (*split) = timepoints[t];
9680 SCIP_Bool modifiable,
9686 SCIP_Bool removable,
9688 SCIP_Bool stickingatnode
9697 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
9728 if( consdata->nvars <= 1 )
9732 consdata->durations, consdata->demands, consdata->capacity, &hmin, &hmax, &split) );
9735 if( consdata->hmin < hmin )
9739 consdata->hmin = hmin;
9744 if( consdata->hmax > hmax )
9747 consdata->hmax = hmax;
9752 if( consdata->hmax <= consdata->hmin )
9754 SCIPdebugMsg(
scip,
"constraint <%s> is redundant since hmax(%d) <= hmin(%d)\n",
9760 else if( consdata->hmin < split && split < consdata->hmax )
9765 SCIPdebugMsg(
scip,
"split cumulative constraint <%s>[%d,%d) with %d jobs at time point %d\n",
9766 SCIPconsGetName(cons), consdata->hmin, consdata->hmax, consdata->nvars, split);
9768 assert(split < consdata->hmax);
9772 consdata->durations, consdata->demands, consdata->capacity, split, consdata->hmax,
9777 consdata->hmax = split;
9779 assert(consdata->hmin < consdata->hmax);
9823 SCIP_Bool* downlocks,
9826 SCIP_Bool* irrelevants,
9832 SCIP_Real* downimpllbs;
9833 SCIP_Real* downimplubs;
9834 SCIP_Real* downproplbs;
9835 SCIP_Real* downpropubs;
9836 SCIP_Real* upimpllbs;
9837 SCIP_Real* upimplubs;
9838 SCIP_Real* upproplbs;
9839 SCIP_Real* uppropubs;
9859 SCIPdebugMsg(
scip,
"check for irrelevant variable for cumulative condition (hmin %d) w.r.t. earlier start time\n", hmin);
9861 firstminect = INT_MAX;
9862 secondminect = INT_MAX;
9865 for( v = 0; v <
nvars; ++v )
9871 if( ect < firstminect )
9873 secondminect = firstminect;
9876 else if( ect < secondminect )
9881 for( v = 0; v <
nvars; ++v )
9896 duration = durations[v];
9903 ect = est + duration;
9905 lct = lst + duration;
9908 if( ect == firstminect )
9909 minect = secondminect;
9911 minect = firstminect;
9914 alternativelb =
MAX(hmin+1, minect);
9915 alternativelb =
MIN(alternativelb, hmax);
9922 SCIPdebugMsg(
scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
9926 irrelevants[v] =
TRUE;
9949 SCIPdebugMsg(
scip,
" variables <%s>[%d,%d] (duration <%d>) is irrelevant due to no up lock\n",
9953 irrelevants[v] =
TRUE;
9961 SCIPdebugMsg(
scip,
" remove down lock of variable <%s>[%g,%g] with duration <%d>\n",
9965 downlocks[v] =
FALSE;
9972 else if( ect <= hmin )
9990 SCIPdebugMsg(
scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt EST\n",
9997 irrelevants[v] =
TRUE;
10014 SCIP_Bool roundable;
10020 if( alternativelb > lst )
10022 SCIP_Bool infeasible;
10045 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10046 nfixedvars, &success,
cutoff) );
10057 SCIPdebugMsg(
scip,
"********* check variable <%s>[%g,%g] with duration <%d> (hmin %d)\n",
10108 SCIP_Bool* downlocks,
10109 SCIP_Bool* uplocks,
10111 SCIP_Bool* irrelevants,
10117 SCIP_Real* downimpllbs;
10118 SCIP_Real* downimplubs;
10119 SCIP_Real* downproplbs;
10120 SCIP_Real* downpropubs;
10121 SCIP_Real* upimpllbs;
10122 SCIP_Real* upimplubs;
10123 SCIP_Real* upproplbs;
10124 SCIP_Real* uppropubs;
10144 SCIPdebugMsg(
scip,
"check for irrelevant variable for cumulative condition (hmax %d) w.r.t. latest completion time\n", hmax);
10146 firstmaxlst = INT_MIN;
10147 secondmaxlst = INT_MIN;
10150 for( v = 0; v <
nvars; ++v )
10156 if( lst > firstmaxlst )
10158 secondmaxlst = firstmaxlst;
10161 else if( lst > secondmaxlst )
10162 secondmaxlst = lst;
10166 for( v = 0; v <
nvars; ++v )
10180 duration = durations[v];
10187 ect = est + duration;
10191 if( lst == firstmaxlst )
10192 maxlst = secondmaxlst;
10194 maxlst = firstmaxlst;
10197 alternativeub =
MIN(hmax - 1, maxlst) - duration;
10198 alternativeub =
MAX(alternativeub, hmin);
10205 SCIPdebugMsg(
scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
10209 irrelevants[v] =
TRUE;
10223 if( !downlocks[v] )
10229 SCIPdebugMsg(
scip,
" variables <%s>[%d,%d] with duration <%d> is irrelevant due to no down lock\n",
10233 irrelevants[v] =
TRUE;
10241 SCIPdebugMsg(
scip,
" remove up lock of variable <%s>[%g,%g] with duration <%d>\n",
10245 uplocks[v] =
FALSE;
10252 else if( lst >= hmax )
10270 SCIPdebugMsg(
scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt LCT\n",
10277 irrelevants[v] =
TRUE;
10294 SCIP_Bool roundable;
10300 if( alternativeub < est )
10302 SCIP_Bool infeasible;
10325 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10326 nfixedvars, &success,
cutoff) );
10363 SCIP_Bool* irrelevants;
10374 nvars = consdata->nvars;
10384 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10385 irrelevants, nfixedvars, nchgsides,
cutoff) );
10389 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10390 irrelevants, nfixedvars, nchgsides,
cutoff) );
10395 for( v =
nvars-1; v >= 0; --v )
10397 if( irrelevants[v] )
10403 var = consdata->vars[v];
10410 if( lst <= consdata->hmin && ect >= consdata->hmax )
10412 if( consdata->capacity < consdata->demands[v] )
10418 consdata->capacity -= consdata->demands[v];
10419 consdata->varbounds =
FALSE;
10441 SCIP_Longint** demands,
10452 startindex = nstarted - 1;
10457 while( nstarted - nfinished > ncountedvars )
10464 varidx = startindices[startindex];
10473 if( endtime > curtime )
10475 if( consdata->demands[
varidx] < consdata->capacity )
10477 (*demands)[*ndemands] = consdata->demands[
varidx];
10502 SCIP_Longint* demands;
10503 SCIP_Real* profits;
10509 assert(nstarted > nfinished);
10513 assert(consdata->nvars > 0);
10514 assert(consdata->capacity > 0);
10520 collectDemands(
scip, consdata, startindices, curtime, nstarted, nfinished, &demands, &ndemands);
10525 for( j = 0; j < ndemands; ++j )
10581 nvars = consdata->nvars;
10589 SCIPdebugMsg(
scip,
"try to tighten capacity for cumulative constraint <%s> with capacity %d\n",
10599 starttimes, endtimes, startindices, endindices,
FALSE);
10603 freecapacity = consdata->capacity;
10606 for( j = 0; j <
nvars && bestcapacity < consdata->capacity; ++j )
10608 curtime = starttimes[j];
10617 assert(freecapacity <= consdata->capacity);
10624 if( freecapacity < 0 )
10634 bestcapacity =
MAX(bestcapacity, newcapacity);
10635 SCIPdebugMsg(
scip,
"after highest cap usage: bestcapacity = %d\n", bestcapacity);
10639 if( freecapacity > 0 && freecapacity != consdata->capacity )
10641 bestcapacity =
MAX(bestcapacity, consdata->capacity - freecapacity);
10642 SCIPdebugMsg(
scip,
"after peak < cap: bestcapacity = %d\n", bestcapacity);
10646 if( freecapacity == 0 && consdata->demands[startindices[j]] < consdata->capacity)
10649 SCIPdebugMsg(
scip,
"--> cannot decrease capacity since sum equals capacity\n");
10650 bestcapacity = consdata->capacity;
10662 if( bestcapacity < consdata->capacity )
10664 SCIPdebug(
int oldnchgcoefs = *nchgcoefs; )
10666 SCIPdebugMsg(
scip,
"+-+-+-+-+-+ --> CHANGE capacity of cons<%s> from %d to %d\n",
10669 for( j = 0; j <
nvars; ++j )
10671 if( consdata->demands[j] == consdata->capacity )
10673 consdata->demands[j] = bestcapacity;
10678 consdata->capacity = bestcapacity;
10683 consdata->varbounds =
FALSE;
10714 nvars = consdata->nvars;
10715 oldnchgcoefs = *nchgcoefs;
10724 mindemand = consdata->demands[0];
10725 for( j = 0; j <
nvars; ++j )
10727 mindemand =
MIN(mindemand, consdata->demands[j]);
10731 for( j = 0; j <
nvars; ++j )
10733 if( mindemand + consdata->demands[j] > consdata->capacity && consdata->demands[j] < consdata->capacity )
10736 consdata->demands[j], consdata->capacity);
10737 consdata->demands[j] = consdata->capacity;
10746 for( j = 0; j <
nvars; ++j )
10753 assert(consdata->demands[j] <= consdata->capacity);
10755 if( consdata->demands[j] == consdata->capacity )
10774 if( est_i >= lct_j || est_j >= lct_i )
10777 if( consdata->demands[j] + consdata->demands[
i] <= consdata->capacity )
10787 consdata->demands[j], consdata->capacity);
10788 consdata->demands[j] = consdata->capacity;
10793 if( (*nchgcoefs) > oldnchgcoefs )
10795 SCIPdebugMsg(
scip,
"+-+-+-+-+-+changed %d coefficients of variables of cumulative constraint<%s>\n",
10802#ifdef SCIP_DISABLED_CODE
10822 nvars = consdata->nvars;
10825 hmin = consdata->hmin;
10826 hmax = consdata->hmax;
10829 for( v = 0; v <
nvars; ++v )
10838 var = consdata->vars[v];
10841 duration = consdata->durations[v];
10844 ect = est + duration;
10846 lct = lst + duration;
10849 assert(lst > hmin || ect < hmax);
10851 if( lst <= hmin && est < hmin - lct +
MIN(hmin, ect) )
10855 SCIP_Bool infeasible;
10856 SCIP_Bool redundant;
10857 SCIP_Bool aggregated;
10860 shift = est - (hmin - lct +
MIN(hmin, ect));
10863 duration = hmin - lct;
10879 consdata->durations[v] = duration;
10880 consdata->vars[v] = aggrvar;
10917 capacity = consdata->capacity;
10919 if( capacity == 1 )
10926 halfcapacity = capacity / 2;
10927 mindemand = consdata->capacity;
10931 for( v = 0; v < consdata->nvars; ++v )
10933 if( consdata->demands[v] > halfcapacity )
10936 demands[
nvars] = 1;
10937 durations[
nvars] = consdata->durations[v];
10940 mindemand =
MIN(mindemand, consdata->demands[v]);
10949 for( v = 0; v < consdata->nvars; ++v )
10951 if( consdata->demands[v] > halfcapacity )
10954 if( mindemand + consdata->demands[v] > capacity )
10956 demands[
nvars] = 1;
10957 durations[
nvars] = consdata->durations[v];
10993 SCIP_Bool* unbounded
11031 if( conshdlrdata->normalize )
11043 if( conshdlrdata->coeftightening )
11054#ifdef SCIP_DISABLED_CODE
11068struct TCLIQUE_Graph
11072 SCIP_Bool** precedencematrix;
11073 SCIP_Bool** demandmatrix;
11088 return tcliquegraph->nnodes;
11097 return tcliquegraph->weights;
11109 if( tcliquegraph->precedencematrix[node1][node2] || tcliquegraph->precedencematrix[node2][node1] )
11113 if( tcliquegraph->demandmatrix[node1][node2] )
11138 assert(0 <= nodes[
i] && nodes[
i] < tcliquegraph->nnodes);
11139 assert(
i == 0 || nodes[
i-1] < nodes[
i]);
11142 if( tcliqueIsedgeClique(tcliquegraph, node, nodes[
i]) )
11145 adjnodes[nadjnodes] = nodes[
i];
11175 SCIP_Real vlbconst,
11191 bound = (duration - vlbcoef) / (vlbcoef - 1.0);
11230 SCIP_Real vubconst,
11235 SCIP_Real vlbconst;
11238 vlbcoef = 1.0 / vubcoef;
11239 vlbconst = -vubconst / vubcoef;
11271 if( tcliquegraph->size == tcliquegraph->nnodes )
11276 tcliquegraph->size = size;
11284 for( v = 0; v < tcliquegraph->nnodes; ++v )
11290 assert(tcliquegraph->nnodes < tcliquegraph->size);
11292 pos = tcliquegraph->nnodes;
11295 tcliquegraph->durations[pos] = 0;
11296 tcliquegraph->weights[pos] = 0;
11297 tcliquegraph->vars[pos] =
var;
11307 tcliquegraph->nnodes++;
11309 for( v = 0; v < tcliquegraph->nnodes; ++v )
11311 tcliquegraph->precedencematrix[v][pos] = 0;
11312 tcliquegraph->demandmatrix[v][pos] = 0;
11315 (*idx) = tcliquegraph->nnodes;
11352 for( v = 0; v <
nvars; ++v )
11356 SCIP_Real* vbdcoefs;
11357 SCIP_Real* vbdconsts;
11368 if( tcliquegraph->durations[idx1] == 0 )
11376 for(
b = 0;
b < nvbdvars; ++
b )
11383 if( tcliquegraph->durations[idx2] == 0 )
11387 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11395 for(
b = 0;
b < nvbdvars; ++
b )
11402 if( tcliquegraph->durations[idx2] == 0 )
11406 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11416 if( tcliquegraph->durations[idx2] == 0 )
11421 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11425 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11435 SCIP_Bool** adjmatrix,
11447 for( j = 0; j <
nnodes; ++j )
11449 if( adjmatrix[
i][j] )
11454 for( k = 0; k <
nnodes; ++k )
11456 if( adjmatrix[j][k] )
11457 adjmatrix[
i][k] =
TRUE;
11476 for(
c = 0;
c < nconss; ++
c )
11488 vars = consdata->vars;
11489 demands = consdata->demands;
11491 nvars = consdata->nvars;
11492 capacity = consdata->capacity;
11505 if( tcliquegraph->durations[idx1] == 0 || tcliquegraph->durations[idx1] > consdata->durations[
i] )
11508 for( j =
i+1; j <
nvars; ++j )
11510 assert(consdata->durations[j] > 0);
11512 if( demands[
i] + demands[j] > capacity )
11525 if( est1 < consdata->hmin && est2 < consdata->hmin )
11532 if( lct1 > consdata->hmax && lct2 > consdata->hmax )
11539 if( tcliquegraph->durations[idx2] == 0 || tcliquegraph->durations[idx2] > consdata->durations[j] )
11544 assert(tcliquegraph->durations[idx1] > 0);
11545 assert(tcliquegraph->durations[idx2] > 0);
11547 tcliquegraph->demandmatrix[idx1][idx2] =
TRUE;
11548 tcliquegraph->demandmatrix[idx2][idx1] =
TRUE;
11575 transitiveClosure(tcliquegraph->precedencematrix, tcliquegraph->ninarcs, tcliquegraph->noutarcs, tcliquegraph->nnodes);
11606 for( v = 0; v < ncliquenodes; ++v )
11608 durations[v] = tcliquegraph->durations[cliquenodes[v]];
11609 assert(durations[v] > 0);
11611 vars[v] = tcliquegraph->vars[cliquenodes[v]];
11638 SCIP_Bool* precedencerow;
11639 SCIP_Bool* precedencecol;
11640 SCIP_Bool* demandrow;
11641 SCIP_Bool* demandcol;
11651 nnodes = tcliquegraph->nnodes;
11655 for( v = 0; v <
nnodes; ++v )
11657 tcliquegraph->weights[v] = tcliquegraph->durations[v];
11668 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
11677 if( tcliquegraph->durations[v] == 0 )
11689 precedencerow[
c] = tcliquegraph->precedencematrix[v][
c];
11690 precedencecol[
c] = tcliquegraph->precedencematrix[
c][v];
11692 demandrow[
c] = tcliquegraph->demandmatrix[v][
c];
11693 demandcol[
c] = tcliquegraph->demandmatrix[
c][v];
11695 tcliquegraph->precedencematrix[
c][v] =
FALSE;
11696 tcliquegraph->precedencematrix[v][
c] =
FALSE;
11700 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11701 tcliquegraph, tcliqueNewsolClique,
NULL,
11702 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11703 10000, 1000, 1000, v, &ntreenodes, &tcliquestatus);
11705 SCIPdebugMsg(
scip,
"tree nodes %d clique size %d (weight %d, status %d)\n", ntreenodes, ncliquenodes, cliqueweight, tcliquestatus);
11707 if( ncliquenodes == 1 )
11717 for(
c = 0;
c < ncliquenodes; ++
c )
11725 tcliquegraph->precedencematrix[v][
c] = precedencerow[
c];
11726 tcliquegraph->precedencematrix[
c][v] = precedencecol[
c];
11728 tcliquegraph->demandmatrix[v][
c] = demandrow[
c];
11729 tcliquegraph->demandmatrix[
c][v] = demandcol[
c];
11741 (*naddconss) += nconss;
11797 if( !tcliquegraph->precedencematrix[source][sink] )
11800 nnodes = tcliquegraph->nnodes;
11801 vars = tcliquegraph->vars;
11819 duration = tcliquegraph->durations[
i];
11821 if(
i == source ||
i == sink )
11824 tcliquegraph->weights[
i] = 0;
11826 else if( tcliquegraph->precedencematrix[source][
i] && tcliquegraph->precedencematrix[
i][sink] )
11829 tcliquegraph->weights[
i] = duration;
11835 tcliquegraph->weights[
i] = duration;
11838 tcliquegraph->weights[
i] = 0;
11844 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11845 tcliquegraph, tcliqueNewsolClique,
NULL,
11846 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11847 10000, 1000, 1000, -1, &ntreenodes, &tcliquestatus);
11849 if( ncliquenodes > 1 )
11860 distance = cliqueweight + tcliquegraph->durations[source];
11891 nnodes = tcliquegraph->nnodes;
11903 if( tcliquegraph->ninarcs[
i] == 0 )
11905 sources[nsources] =
i;
11909 if( tcliquegraph->ninarcs[
i] == 0 )
11932 (*naddconss) += nconss;
11955 for(
c = 0;
c < nconss; ++
c )
11965 vars = consdata->vars;
11966 nvars = consdata->nvars;
11968 for( v = 0; v <
nvars; ++v )
11979 tcliquegraph->durations[idx] =
MAX(tcliquegraph->durations[idx], consdata->durations[v]);
11980 assert(tcliquegraph->durations[idx] > 0);
11996 SCIP_Bool** precedencematrix;
11997 SCIP_Bool** demandmatrix;
12037 for( v = 0; v <
nvars; ++v )
12055 (*tcliquegraph)->nnodes =
nvars;
12056 (*tcliquegraph)->varmap = varmap;
12057 (*tcliquegraph)->precedencematrix = precedencematrix;
12058 (*tcliquegraph)->demandmatrix = demandmatrix;
12059 (*tcliquegraph)->weights = weights;
12060 (*tcliquegraph)->ninarcs = ninarcs;
12061 (*tcliquegraph)->noutarcs = noutarcs;
12062 (*tcliquegraph)->durations = durations;
12063 (*tcliquegraph)->size =
nvars;
12077 for( v = (*tcliquegraph)->nnodes-1; v >= 0; --v )
12119 if( conshdlrdata->detectvarbounds )
12125 if( conshdlrdata->detectdisjunctive )
12146 if( consdata->validsignature )
12149 vars = consdata->vars;
12150 nvars = consdata->nvars;
12152 for( v = 0; v <
nvars; ++v )
12154 consdata->signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(
vars[v]) % (
sizeof(
unsigned int) * 8)));
12157 consdata->validsignature =
TRUE;
12170 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
12185 for(
i = 0;
i < nconss; ++
i )
12197 assert(consdata0->validsignature);
12199 for( j =
i+1; j < nconss; ++j )
12210 if( consdata0->capacity != consdata1->capacity )
12214 assert(consdata1->validsignature);
12216 if( (consdata1->signature & (~consdata0->signature)) == 0 )
12220 assert((consdata0->signature & (~consdata1->signature)) == 0);
12223 if( (consdata0->signature & (~consdata1->signature)) == 0 )
12230 if( consdata0->nvars > consdata1->nvars )
12233 if( consdata0->hmin < consdata1->hmin )
12236 if( consdata0->hmax > consdata1->hmax )
12243 SCIPsort(perm0, consdataCompVar, (
void*)consdata0, consdata0->nvars);
12244 SCIPsort(perm1, consdataCompVar, (
void*)consdata1, consdata1->nvars);
12246 for( v0 = 0, v1 = 0; v0 < consdata0->nvars && v1 < consdata1->nvars; )
12257 var0 = consdata0->vars[idx0];
12259 var1 = consdata1->vars[idx1];
12270 demand0 = consdata0->demands[idx0];
12271 duration0 = consdata0->durations[idx0];
12273 demand1 = consdata1->demands[idx1];
12274 duration1 = consdata1->durations[idx1];
12276 if( demand0 != demand1 )
12279 if( duration0 != duration1 )
12285 else if( comp > 0 )
12291 if( v0 == consdata0->nvars )
12336 if( consdata->varbounds )
12339 vars = consdata->vars;
12340 durations = consdata->durations;
12341 demands = consdata->demands;
12342 capacity = consdata->capacity;
12343 nvars = consdata->nvars;
12351 SCIP_Real* vbdcoefs;
12352 SCIP_Real* vbdconsts;
12357 var = consdata->vars[
i];
12365 for(
b = 0;
b < nvbdvars; ++
b )
12371 for( j = 0; j <
nvars; ++j )
12373 if(
vars[j] == vbdvars[
b] )
12381 SCIP_Bool infeasible;
12396 (*nchgbds) += nlocalbdchgs;
12403 (*naddconss) += nconss;
12405 consdata->varbounds =
TRUE;
12419 SCIP_Bool solinfeasible,
12430 if( solinfeasible )
12436 SCIPdebugMsg(
scip,
"constraint enforcing %d useful cumulative constraints of %d constraints for %s solution\n", nusefulconss, nconss,
12437 sol ==
NULL ?
"LP" :
"relaxation");
12444 if( conshdlrdata->usebinvars )
12446 SCIP_Bool separated;
12453 for(
c = 0;
c < nusefulconss; ++
c )
12456 SCIP_Bool violated;
12474 for( ;
c < nconss && !separated; ++
c )
12477 SCIP_Bool violated;
12544#ifdef SCIP_STATISTIC
12545 if( !conshdlrdata->iscopy )
12549 conshdlrdata->nlbtimetable, conshdlrdata->nubtimetable, conshdlrdata->ncutofftimetable);
12551 conshdlrdata->nlbedgefinder, conshdlrdata->nubedgefinder, conshdlrdata->ncutoffedgefinder);
12553 conshdlrdata->ncutoffoverload, conshdlrdata->ncutoffoverloadTTEF);
12575 conshdlrdata->detectedredundant =
FALSE;
12577 for(
c = 0;
c < nconss; ++
c )
12590#ifdef SCIP_STATISTIC
12600 for(
c = 0;
c < nconss; ++
c )
12604#ifdef SCIP_DISABLED_CODE
12609 if( !conshdlrdata->iscopy )
12611 SCIPstatisticPrintf(
"@11 added variables bounds constraints %d\n", conshdlrdata->naddedvarbounds);
12612 SCIPstatisticPrintf(
"@22 added disjunctive constraints %d\n", conshdlrdata->naddeddisjunctives);
12638 for(
c = 0;
c < nconss; ++
c )
12702 sourcedata->durations, sourcedata->demands, sourcedata->nvars, sourcedata->capacity,
12730 *infeasible =
FALSE;
12732 SCIPdebugMsg(
scip,
"initialize LP relaxation for %d cumulative constraints\n", nconss);
12734 if( conshdlrdata->usebinvars )
12737 for(
c = 0;
c < nconss && !(*infeasible); ++
c )
12742 if( conshdlrdata->cutsasconss )
12761 SCIP_Bool separated;
12773 SCIPdebugMsg(
scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12784 if( conshdlrdata->usebinvars )
12787 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
12792 if( !
cutoff && conshdlrdata->usecovercuts )
12794 for(
c = 0;
c < nusefulconss; ++
c )
12801 if( conshdlrdata->sepaold )
12804 for(
c = 0;
c < nusefulconss; ++
c )
12813 else if( separated )
12825 SCIP_Bool separated;
12839 SCIPdebugMsg(
scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12845 if( conshdlrdata->usebinvars )
12848 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
12853 if( !
cutoff && conshdlrdata->usecovercuts )
12855 for(
c = 0;
c < nusefulconss; ++
c )
12861 if( conshdlrdata->sepaold )
12864 for(
c = 0;
c < nusefulconss; ++
c )
12873 else if( separated )
12910 if( objinfeasible )
12943 SCIP_Bool violated =
FALSE;
12964 SCIPdebugMsg(
scip,
"propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss);
12980 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
12990 &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &
cutoff, &
cutoff) );
13002 if( !
cutoff && nchgbds == 0 )
13005 for(
c = nusefulconss;
c < nconss && !
cutoff; ++
c )
13016 else if( nchgbds > 0 )
13018 SCIPdebugMsg(
scip,
"delete (locally) %d constraints and changed %d variable bounds\n", ndelconss, nchgbds);
13034 SCIP_Bool unbounded;
13056 oldnfixedvars = *nfixedvars;
13057 oldnchgbds = *nchgbds;
13058 oldnchgsides = *nchgsides;
13059 oldnchgcoefs = *nchgcoefs;
13060 oldnupgdconss = *nupgdconss;
13061 oldndelconss = *ndelconss;
13062 oldnaddconss = *naddconss;
13067 for(
c = 0;
c < nconss && !
cutoff; ++
c )
13079 nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &
cutoff, &unbounded) );
13081 if(
cutoff || unbounded )
13089 if( nrounds == 1 &&
SCIPgetNRuns(
scip) == 1 && conshdlrdata->disjunctive )
13112 && (conshdlrdata->detectvarbounds || conshdlrdata->detectdisjunctive)
13119 conshdlrdata->detectedredundant =
TRUE;
13127 SCIPdebugMsg(
scip,
"delete %d constraints and changed %d variable bounds (cutoff %u)\n",
13128 *ndelconss - oldndelconss, *nchgbds - oldnchgbds,
cutoff);
13132 else if( unbounded )
13134 else if( *nchgbds > oldnchgbds || *nfixedvars > oldnfixedvars || *nchgsides > oldnchgsides
13135 || *nchgcoefs > oldnchgcoefs || *nupgdconss > oldnupgdconss || *ndelconss > oldndelconss || *naddconss > oldnaddconss )
13166 SCIPdebugMsg(
scip,
"resolve propagation: variable <%s>, cumulative constraint <%s> (capacity %d, propagation %d, H=[%d,%d))\n",
13171 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
13172 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, conshdlrdata->usebdwidening,
NULL,
result) );
13194 vars = consdata->vars;
13197 for( v = 0; v < consdata->nvars; ++v )
13199 if( consdata->downlocks[v] && consdata->uplocks[v] )
13204 else if( consdata->downlocks[v] )
13208 else if( consdata->uplocks[v] )
13238 const char* consname;
13247 nvars = sourceconsdata->nvars;
13248 sourcevars = sourceconsdata->vars;
13274 sourceconsdata->durations, sourceconsdata->demands, sourceconsdata->capacity,
13275 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
13278 if( sourceconsdata->hmin > 0 )
13284 if( sourceconsdata->hmax < INT_MAX )
13338 endptr = strchr(endptr,
')');
13340 if( endptr ==
NULL )
13350 duration = atoi(strvalue);
13354 demand = atoi(strvalue);
13360 demands[
nvars] = demand;
13361 durations[
nvars] = duration;
13364 while( *str !=
')' );
13370 hmin = atoi(strvalue);
13375 hmax = (int)(value);
13383 capacity = (int)value;
13387 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
13413 if( varssize < consdata->
nvars )
13414 (*success) =
FALSE;
13435 (*nvars) = consdata->nvars;
13465 consdata->propagated =
FALSE;
13494 consEnfolpCumulative, consEnfopsCumulative, consCheckCumulative, consLockCumulative,
13502#ifdef SCIP_STATISTIC
13526 "should time-table (core-times) propagator be used to infer bounds?",
13530 "should edge-finding be used to detect an overload?",
13534 "should edge-finding be used to infer bounds?",
13537 "constraints/" CONSHDLR_NAME "/useadjustedjobs",
"should edge-finding be executed?",
13541 "should time-table edge-finding be used to detect an overload?",
13545 "should time-table edge-finding be used to infer bounds?",
13549 "constraints/" CONSHDLR_NAME "/usebinvars",
"should the binary representation be used?",
13552 "constraints/" CONSHDLR_NAME "/localcuts",
"should cuts be added only locally?",
13555 "constraints/" CONSHDLR_NAME "/usecovercuts",
"should covering cuts be added every node?",
13559 "should the cumulative constraint create cuts as knapsack constraints?",
13563 "shall old sepa algo be applied?",
13567 "constraints/" CONSHDLR_NAME "/fillbranchcands",
"should branching candidates be added to storage?",
13572 "constraints/" CONSHDLR_NAME "/dualpresolve",
"should dual presolving be applied?",
13575 "constraints/" CONSHDLR_NAME "/coeftightening",
"should coefficient tightening be applied?",
13578 "constraints/" CONSHDLR_NAME "/normalize",
"should demands and capacity be normalized?",
13582 "should pairwise constraint comparison be performed in presolving?",
13585 "constraints/" CONSHDLR_NAME "/disjunctive",
"extract disjunctive constraints?",
13590 "number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit)?",
13593 "constraints/" CONSHDLR_NAME "/detectdisjunctive",
"search for conflict set via maximal cliques to detect disjunctive constraints",
13596 "constraints/" CONSHDLR_NAME "/detectvarbounds",
"search for conflict set via maximal cliques to detect variable bound constraints",
13601 "constraints/" CONSHDLR_NAME "/usebdwidening",
"should bound widening be used during the conflict analysis?",
13619 SCIP_Bool separate,
13629 SCIP_Bool modifiable,
13635 SCIP_Bool removable,
13637 SCIP_Bool stickingatnode
13649 if( conshdlr ==
NULL )
13658 SCIP_CALL(
consdataCreate(
scip, &consdata,
vars,
NULL, durations, demands,
nvars, capacity, 0, INT_MAX, check) );
13662 initial, separate, enforce, check,
propagate,
13663 local, modifiable, dynamic, removable, stickingatnode) );
13725 assert(hmin <= consdata->hmax);
13727 consdata->hmin = hmin;
13749 return consdata->hmin;
13769 assert(hmax >= consdata->hmin);
13771 consdata->hmax = hmax;
13793 return consdata->hmax;
13814 return consdata->vars;
13835 return consdata->nvars;
13856 return consdata->capacity;
13877 return consdata->durations;
13898 return consdata->demands;
13914 SCIP_Bool* violated,
13916 SCIP_Bool printreason
13923 violated, cons, printreason) );
13959 hmin, hmax, split) );
13972 SCIP_Bool* downlocks,
13973 SCIP_Bool* uplocks,
13975 SCIP_Bool* irrelevants,
13986 irrelevants, nfixedvars, nchgsides,
cutoff) );
13990 irrelevants, nfixedvars, nchgsides,
cutoff) );
14008 SCIP_Bool* initialized,
14009 SCIP_Bool* explanation,
14015 SCIP_Bool redundant;
14026 if( conshdlr ==
NULL )
14038 nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
14039 nchgbds, &redundant, initialized, explanation,
cutoff) );
14058 SCIP_Real relaxedbd,
14059 SCIP_Bool* explanation,
14087 file = fopen(filename,
"w");
14100 nvars = consdata->nvars;
14103 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL), TERMINATE );
14108 for( v = 0; v <
nvars; ++v )
14112 var = consdata->vars[v];
14119 else if( !consdata->downlocks[v] || !consdata->uplocks[v] )
14127 for( v = 0; v <
nvars; ++v )
14133 var = consdata->vars[v];
14139 for(
b = 0;
b < nvbdvars; ++
b )
14147#ifdef SCIP_MORE_OUTPUT
14152 for(
b = 0;
b < nvbdvars; ++
b )
14184 if( conshdlr ==
NULL )
14209 SCIP_Real* objvals,
14215 SCIP_Real timelimit,
14216 SCIP_Real memorylimit,
14217 SCIP_Longint maxnodes,
14219 SCIP_Bool* infeasible,
14220 SCIP_Bool* unbounded,
14228 (*infeasible) =
FALSE;
14229 (*unbounded) =
FALSE;
14237 if( conshdlr ==
NULL )
14248 if( timelimit > 0.0 && memorylimit > 10 )
14250 SCIP_CALL( conshdlrdata->solveCumulative(njobs, ests, lsts, objvals, durations, demands, capacity,
14251 hmin, hmax, timelimit, memorylimit, maxnodes, solved, infeasible, unbounded, error) );
14287 for( v = 0; v <
nvars; ++v )
14289 copydemands[v] = demands[v];
14295 for( v = 0; v <
nvars; ++v )
14305 duration = durations[idx];
14314 if( impliedest < impliedlct )
14316 SCIP_Bool infeasible;
14324 if( est == impliedest && lct == impliedlct )
14355 for( t = 0; t < ntimepoints - 1; ++t )
14358 if( loads[t] > capacity )
14360 assert(t == 0 || loads[t-1] <= capacity);
14361 return timepoints[t];
14385 for( t = ntimepoints - 1; t >= 0; --t )
14388 if( loads[t] > capacity )
14390 assert(t == ntimepoints-1 || loads[t+1] <= capacity);
14391 return timepoints[t+1];
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_RESULT *result)
static SCIP_RETCODE adjustOversizedJobBounds(SCIP *scip, SCIP_CONSDATA *consdata, int pos, int *nchgbds, int *naddconss, SCIP_Bool *cutoff)
static int inferInfoGetData1(INFERINFO inferinfo)
static SCIP_RETCODE createTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
#define DEFAULT_USEBDWIDENING
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_SEPAFREQ
static void createSortedEventpointsSol(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices)
static void createSortedEventpoints(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices, SCIP_Bool local)
static void consdataCalcSignature(SCIP_CONSDATA *consdata)
static SCIP_RETCODE propagateUbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, int *newlbs, int *newubs, int *lbinferinfos, int *ubinferinfos, int *lsts, int *flexenergies, int *perm, int *ests, int *lcts, int *coreEnergyAfterEst, int *coreEnergyAfterLct, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
#define DEFAULT_NORMALIZE
static PROPRULE inferInfoGetProprule(INFERINFO inferinfo)
static SCIP_RETCODE collectIntVars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR ***activevars, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool lower, int *lhs)
static SCIP_RETCODE getActiveVar(SCIP *scip, SCIP_VAR **var, int *scalar, int *constant)
#define DEFAULT_DETECTVARBOUNDS
static SCIP_RETCODE createConsCumulative(SCIP *scip, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, 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)
#define CONSHDLR_CHECKPRIORITY
static SCIP_RETCODE presolveConsEst(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int hmin, int hmax, SCIP_Bool *downlocks, SCIP_Bool *uplocks, SCIP_CONS *cons, SCIP_Bool *irrelevants, int *nfixedvars, int *nchgsides, SCIP_Bool *cutoff)
#define DEFAULT_TTEFINFER
static void subtractStartingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *starttimes, int *startindices, int *freecapacity, int *idx, int nvars)
static SCIP_RETCODE varMayRoundUp(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
#define DEFAULT_USECOVERCUTS
static SCIP_Longint computeCoreWithInterval(int begin, int end, int ect, int lst)
static SCIP_RETCODE applyAlternativeBoundsFixing(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, int *nfixedvars, SCIP_Bool *cutoff)
#define DEFAULT_LOCALCUTS
static SCIP_RETCODE checkOverloadViaThetaTree(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, SCIP_Bool propest, SCIP_Bool *initialized, SCIP_Bool *explanation, int *nchgbds, SCIP_Bool *cutoff)
#define DEFAULT_COEFTIGHTENING
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PRESOLTIMING presoltiming, int *nchgbds, int *ndelconss, SCIP_Bool *cutoff)
static SCIP_RETCODE createPrecedenceCons(SCIP *scip, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, int distance)
static SCIP_Bool isConsIndependently(SCIP_CONS *cons)
#define CONSHDLR_PROP_TIMING
static SCIP_RETCODE separateConsOnIntegerVariables(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool lower, SCIP_Bool *separated, SCIP_Bool *cutoff)
static SCIP_RETCODE analyzeConflictOverload(SCIP *scip, SCIP_BTNODE **leaves, int capacity, int nleaves, int est, int lct, int reportedenergy, SCIP_Bool propest, int shift, SCIP_Bool usebdwidening, SCIP_Bool *initialized, SCIP_Bool *explanation)
static void conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
static void freeTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
static SCIP_Bool checkDemands(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE createCoverCuts(SCIP *scip, SCIP_CONS *cons)
static void consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
#define CONSHDLR_MAXPREROUNDS
static SCIP_RETCODE tightenUbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *var, int duration, int demand, int est, int lst, int lct, int begin, int end, SCIP_Longint energy, int *bestub, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE propagateTimetable(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, int *nchgbds, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE computeImpliedEst(SCIP *scip, SCIP_VAR *var, SCIP_HASHMAP *addedvars, int *est)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
static SCIP_RETCODE collectBranchingCands(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, int *nbranchcands)
static SCIP_RETCODE presolveCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PRESOLTIMING presoltiming, int *nfixedvars, int *nchgbds, int *ndelconss, int *naddconss, int *nchgcoefs, int *nchgsides, SCIP_Bool *cutoff, SCIP_Bool *unbounded)
static int computeEnergyContribution(SCIP_BTNODE *node)
#define DEFAULT_PRESOLPAIRWISE
static SCIP_RETCODE inferboundsEdgeFinding(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS *cons, SCIP_BT *tree, SCIP_BTNODE **leaves, int capacity, int ncands, SCIP_Bool propest, int shift, SCIP_Bool *initialized, SCIP_Bool *explanation, int *nchgbds, SCIP_Bool *cutoff)
static SCIP_RETCODE presolveConsEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *nchgcoefs, int *nchgsides, SCIP_Bool *cutoff)
#define CONSHDLR_SEPAPRIORITY
static SCIP_RETCODE constraintNonOverlappingGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
static SCIP_RETCODE createCoreProfile(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE consCheckRedundancy(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *redundant)
static SCIP_RETCODE detectRedundantConss(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS **conss, int nconss, int *naddconss)
static SCIP_RETCODE getNodeIdx(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_VAR *var, int *idx)
static SCIP_RETCODE computeAlternativeBounds(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool local, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks)
static SCIP_RETCODE removeRedundantConss(SCIP *scip, SCIP_CONS **conss, int nconss, int *ndelconss)
static SCIP_RETCODE findPrecedenceConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
static SCIP_RETCODE fixIntegerVariableUb(SCIP *scip, SCIP_VAR *var, SCIP_Bool uplock, int *nfixedvars)
static SCIP_RETCODE createCapacityRestriction(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool cutsasconss)
#define DEFAULT_DETECTDISJUNCTIVE
static void addEndingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *endtimes, int *endindices, int *freecapacity, int *idx, int nvars)
static INFERINFO getInferInfo(PROPRULE proprule, int data1, int data2)
static SCIP_RETCODE setupAndSolveCumulativeSubscip(SCIP *subscip, SCIP_Real *objvals, int *durations, int *demands, int njobs, int capacity, int hmin, int hmax, SCIP_Longint maxnodes, SCIP_Real timelimit, SCIP_Real memorylimit, SCIP_Real *ests, SCIP_Real *lsts, SCIP_Bool *infeasible, SCIP_Bool *unbounded, SCIP_Bool *solved, SCIP_Bool *error)
static int computeOverlap(int begin, int end, int est, int lst, int duration)
static SCIP_Longint computeTotalEnergy(int *durations, int *demands, int njobs)
static SCIP_RETCODE strengthenVarbounds(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *naddconss)
static SCIP_RETCODE respropCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *infervar, INFERINFO inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_Bool usebdwidening, SCIP_Bool *explanation, SCIP_RESULT *result)
static SCIP_RETCODE removeIrrelevantJobs(SCIP *scip, SCIP_CONS *cons)
static INFERINFO intToInferInfo(int i)
static void createSelectedSortedEventpointsSol(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, int *starttimes, int *endtimes, int *startindices, int *endindices, int *nvars, SCIP_Bool lower)
static void updateEnvelope(SCIP *scip, SCIP_BTNODE *node)
static SCIP_RETCODE propagateEdgeFinding(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, SCIP_Bool *initialized, SCIP_Bool *explanation, int *nchgbds, SCIP_Bool *cutoff)
struct SCIP_NodeData SCIP_NODEDATA
#define DEFAULT_CUTSASCONSS
#define DEFAULT_DUALPRESOLVE
static SCIP_RETCODE analyzeEnergyRequirement(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int begin, int end, SCIP_VAR *infervar, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_Bool usebdwidening, SCIP_Bool *explanation)
static SCIP_RETCODE applyAlternativeBoundsBranching(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, SCIP_Bool *branched)
static SCIP_RETCODE applyProbingVar(SCIP *scip, SCIP_VAR **vars, int nvars, int probingpos, SCIP_Real leftub, SCIP_Real rightlb, SCIP_Real *leftimpllbs, SCIP_Real *leftimplubs, SCIP_Real *leftproplbs, SCIP_Real *leftpropubs, SCIP_Real *rightimpllbs, SCIP_Real *rightimplubs, SCIP_Real *rightproplbs, SCIP_Real *rightpropubs, int *nfixedvars, SCIP_Bool *success, SCIP_Bool *cutoff)
#define DEFAULT_TTEFCHECK
static void normalizeDemands(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
static SCIP_Bool inferInfoIsValid(INFERINFO inferinfo)
static void computeCoreEnergyAfter(SCIP_PROFILE *profile, int nvars, int *ests, int *lcts, int *coreEnergyAfterEst, int *coreEnergyAfterLct)
static SCIP_RETCODE consCapacityConstraintsFinder(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
static SCIP_RETCODE createCumulativeCons(SCIP *scip, const char *name, TCLIQUE_GRAPH *tcliquegraph, int *cliquenodes, int ncliquenodes)
static void collectDataTTEF(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int hmin, int hmax, int *permests, int *ests, int *permlcts, int *lcts, int *ects, int *lsts, int *flexenergies)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_VAR **vars, SCIP_CONS **linkingconss, int *durations, int *demands, int nvars, int capacity, int hmin, int hmax, SCIP_Bool check)
static SCIP_RETCODE createCoverCutsTimepoint(SCIP *scip, SCIP_CONS *cons, int *startvalues, int time)
static SCIP_RETCODE tightenLbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *var, int duration, int demand, int est, int ect, int lct, int begin, int end, SCIP_Longint energy, int *bestlb, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE consdataDeletePos(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons, int pos)
static SCIP_RETCODE propagateAllConss(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool local, int *nfixedvars, SCIP_Bool *cutoff, SCIP_Bool *branched)
static SCIP_RETCODE presolveConsLct(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int hmin, int hmax, SCIP_Bool *downlocks, SCIP_Bool *uplocks, SCIP_CONS *cons, SCIP_Bool *irrelevants, int *nfixedvars, int *nchgsides, SCIP_Bool *cutoff)
static int inferInfoGetData2(INFERINFO inferinfo)
static void traceThetaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
static SCIP_RETCODE propagateCumulativeCondition(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PRESOLTIMING presoltiming, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, int *nchgbds, SCIP_Bool *redundant, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE resolvePropagationCoretimes(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *infervar, int inferdemand, int inferpeak, int relaxedpeak, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool usebdwidening, int *provedpeak, SCIP_Bool *explanation)
static SCIP_RETCODE consdataDropAllEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE collectBinaryVars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR ***vars, int **coefs, int *nvars, int *startindices, int curtime, int nstarted, int nfinished)
#define DEFAULT_USEADJUSTEDJOBS
static SCIP_RETCODE projectVbd(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph)
static SCIP_RETCODE createDisjuctiveCons(SCIP *scip, SCIP_CONS *cons, int *naddconss)
static SCIP_RETCODE deleteLambdaLeaf(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
static SCIP_RETCODE computeEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss, int *nchgsides)
static SCIP_RETCODE enforceSolution(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool branch, SCIP_RESULT *result)
static SCIP_RETCODE deleteTrivilCons(SCIP *scip, SCIP_CONS *cons, int *ndelconss, SCIP_Bool *cutoff)
static SCIP_RETCODE computeMinDistance(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int source, int sink, int *naddconss)
static SCIP_RETCODE varMayRoundDown(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
static void collectDemands(SCIP *scip, SCIP_CONSDATA *consdata, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Longint **demands, int *ndemands)
#define CONSHDLR_PROPFREQ
static SCIP_RETCODE createCapacityRestrictionIntvars(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool lower, SCIP_Bool *cutoff)
static SCIP_RETCODE computeImpliedLct(SCIP *scip, SCIP_VAR *var, int duration, SCIP_HASHMAP *addedvars, int *lct)
static SCIP_RETCODE findCumulativeConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
static SCIP_RETCODE tightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs)
static SCIP_RETCODE tightenCapacity(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnergy(SCIP_BTNODE *node)
static SCIP_RETCODE analyseInfeasibelCoreInsertion(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *infervar, int inferduration, int inferdemand, int inferpeak, SCIP_Bool usebdwidening, SCIP_Bool *initialized, SCIP_Bool *explanation)
static SCIP_RETCODE consdataFreeRows(SCIP *scip, SCIP_CONSDATA **consdata)
#define CONSHDLR_PRESOLTIMING
static SCIP_RETCODE initializeDurations(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
static SCIP_Bool impliesVlbPrecedenceCondition(SCIP *scip, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconst, int duration)
static SCIP_RETCODE separateCoverCutsCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
static SCIP_RETCODE coretimesUpdateLb(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, SCIP_PROFILE *profile, int idx, int *nchgbds, SCIP_Bool usebdwidening, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *infeasible)
static SCIP_RETCODE solveIndependentCons(SCIP *scip, SCIP_CONS *cons, SCIP_Longint maxnodes, int *nchgbds, int *nfixedvars, int *ndelconss, SCIP_Bool *cutoff, SCIP_Bool *unbounded)
static void initializeLocks(SCIP_CONSDATA *consdata, SCIP_Bool locked)
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnvelop(SCIP_BTNODE *node)
static SCIP_RETCODE fixIntegerVariableLb(SCIP *scip, SCIP_VAR *var, SCIP_Bool downlock, int *nfixedvars)
#define CONSHDLR_EAGERFREQ
#define DEFAULT_USEBINVARS
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE coretimesUpdateUb(SCIP *scip, SCIP_VAR *var, int duration, int demand, int capacity, SCIP_CONS *cons, SCIP_PROFILE *profile, int idx, int *nchgbds)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated, SCIP_Bool printreason)
static void collectThetaSubtree(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
static int computeEstOmegaset(SCIP *scip, int duration, int demand, int capacity, int est, int lct, int energy)
#define CONSHDLR_ENFOPRIORITY
struct InferInfo INFERINFO
static SCIP_RETCODE propagateTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, int *nchgbds, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static SCIP_RETCODE insertThetanode(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node, SCIP_NODEDATA *nodedatas, int *nodedataidx, int *nnodedatas)
static void traceLambdaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
#define CONSHDLR_DELAYSEPA
static SCIP_RETCODE computePeak(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, int *timepoint)
#define DEFAULT_FILLBRANCHCANDS
static SCIP_RETCODE consdataCollectLinkingCons(SCIP *scip, SCIP_CONSDATA *consdata)
static SCIP_RETCODE propagateLbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, int *newlbs, int *newubs, int *lbinferinfos, int *ubinferinfos, int *ects, int *flexenergies, int *perm, int *ests, int *lcts, int *coreEnergyAfterEst, int *coreEnergyAfterLct, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static void transitiveClosure(SCIP_Bool **adjmatrix, int *ninarcs, int *noutarcs, int nnodes)
static SCIP_RETCODE getHighestCapacityUsage(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, int *bestcapacity)
static SCIP_RETCODE constructIncompatibilityGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
static SCIP_RETCODE removeOversizedJobs(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *nchgcoefs, int *naddconss, SCIP_Bool *cutoff)
static void updateKeyOnTrace(SCIP_BTNODE *node, SCIP_Real key)
static int inferInfoToInt(INFERINFO inferinfo)
static SCIP_RETCODE consdataDropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos)
static void traceLambdaEnergy(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
static SCIP_RETCODE computeEffectiveHorizonCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int *hmin, int *hmax, int *split)
static SCIP_RETCODE separateConsBinaryRepresentation(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
static void normalizeCumulativeCondition(SCIP *scip, int nvars, int *demands, int *capacity, int *nchgcoefs, int *nchgsides)
static SCIP_Bool impliesVubPrecedenceCondition(SCIP *scip, SCIP_VAR *var, SCIP_Real vubcoef, SCIP_Real vubconst, int duration)
#define CONSHDLR_DELAYPROP
static SCIP_RETCODE moveNodeToLambda(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
#define DEFAULT_DISJUNCTIVE
static SCIP_RETCODE consdataCatchEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss, SCIP_Bool *infeasible)
static SCIP_RETCODE checkCumulativeCondition(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *violated, SCIP_CONS *cons, SCIP_Bool printreason)
constraint handler for cumulative constraints
Constraint handler for knapsack constraints of the form , x binary and .
constraint handler for linking binary variables to a linking (continuous or integer) variable
static SCIP_RETCODE solveCumulative(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool local, SCIP_Real *ests, SCIP_Real *lsts, SCIP_Longint maxnodes, SCIP_Bool *solved, SCIP_Bool *infeasible, SCIP_Bool *unbounded, SCIP_Bool *error)
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
#define SCIP_LONGINT_FORMAT
#define SCIP_CALL_FINALLY(x, y)
static const NodeData nodedata[]
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
void * SCIPbtnodeGetData(SCIP_BTNODE *node)
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
SCIP_BTNODE * SCIPbtnodeGetParent(SCIP_BTNODE *node)
void SCIPbtFree(SCIP_BT **tree)
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
void SCIPbtSetRoot(SCIP_BT *tree, SCIP_BTNODE *root)
SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
int SCIPgetHminCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPpropCumulativeCondition(SCIP *scip, SCIP_PRESOLTIMING presoltiming, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_CONS *cons, int *nchgbds, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPgetBinvarsLinking(SCIP *scip, SCIP_CONS *cons, SCIP_VAR ***binvars, int *nbinvars)
SCIP_RETCODE SCIPcreateConsBasicSetpart(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
int * SCIPgetDurationsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPexistsConsLinking(SCIP *scip, SCIP_VAR *linkvar)
SCIP_RETCODE SCIPsplitCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int *hmin, int *hmax, int *split)
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
SCIP_RETCODE SCIPvisualizeConsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicCumulative(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity)
#define SCIP_DECL_SOLVECUMULATIVE(x)
int SCIPcomputeHmax(SCIP *scip, SCIP_PROFILE *profile, int capacity)
SCIP_CONS * SCIPgetConsLinking(SCIP *scip, SCIP_VAR *linkvar)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, 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 SCIPpresolveCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int hmin, int hmax, SCIP_Bool *downlocks, SCIP_Bool *uplocks, SCIP_CONS *cons, SCIP_Bool *irrelevants, int *nfixedvars, int *nchgsides, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPcheckCumulativeCondition(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *violated, SCIP_CONS *cons, SCIP_Bool printreason)
SCIP_RETCODE SCIPsetSolveCumulative(SCIP *scip,)
SCIP_VAR ** SCIPgetVarsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
int * SCIPgetDemandsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsolveCumulative(SCIP *scip, int njobs, SCIP_Real *ests, SCIP_Real *lsts, SCIP_Real *objvals, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Real timelimit, SCIP_Real memorylimit, SCIP_Longint maxnodes, SCIP_Bool *solved, SCIP_Bool *infeasible, SCIP_Bool *unbounded, SCIP_Bool *error)
SCIP_RETCODE SCIPcreateConsLinking(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *linkvar, SCIP_VAR **binvars, SCIP_Real *vals, int nbinvars, 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 SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success)
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
SCIP_RETCODE SCIPcreateConsKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity, 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)
int SCIPgetHmaxCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPrespropCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_Bool *explanation, SCIP_RESULT *result)
int SCIPgetCapacityCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPnormalizeCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int *capacity, int *nchgcoefs, int *nchgsides)
SCIP_RETCODE SCIPcreateWorstCaseProfile(SCIP *scip, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands)
SCIP_RETCODE SCIPcreateConsVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, 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_Real * SCIPgetValsLinking(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetHminCumulative(SCIP *scip, SCIP_CONS *cons, int hmin)
int SCIPgetNVarsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetHmaxCumulative(SCIP *scip, SCIP_CONS *cons, int hmax)
SCIP_RETCODE SCIPcreateConsCumulative(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, 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)
int SCIPcomputeHmin(SCIP *scip, SCIP_PROFILE *profile, int capacity)
SCIP_RETCODE SCIPincludeConshdlrCumulative(SCIP *scip)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
void SCIPgmlWriteClosing(FILE *file)
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
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)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
int SCIPgetNCheckConss(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPapplyProbingVar(SCIP *scip, SCIP_VAR **vars, int nvars, int probingpos, SCIP_BOUNDTYPE boundtype, SCIP_Real bound, int maxproprounds, SCIP_Real *impllbs, SCIP_Real *implubs, SCIP_Real *proplbs, SCIP_Real *propubs, SCIP_Bool *cutoff)
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 SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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 SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, 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)
void SCIPswapInts(int *value1, int *value2)
void SCIPswapPointers(void **pointer1, void **pointer2)
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, 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_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
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_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONS *cons, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
int SCIPgetNRuns(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
SCIP_Bool SCIPinRepropagation(SCIP *scip)
int SCIPgetDepth(SCIP *scip)
SCIP_Bool SCIPvarIsInitial(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPaddVarLocksType(SCIP *scip, SCIP_VAR *var, SCIP_LOCKTYPE locktype, int nlocksdown, int nlocksup)
SCIP_RETCODE SCIPaddVarVlb(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
int SCIPvarGetNVubs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsRemovable(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Bool SCIPallowStrongDualReds(SCIP *scip)
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
void SCIPprofileFree(SCIP_PROFILE **profile)
int SCIPprofileGetLoad(SCIP_PROFILE *profile, int pos)
int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
int SCIPprofileGetTime(SCIP_PROFILE *profile, int pos)
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int demand)
SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int demand, int *pos, SCIP_Bool *infeasible)
void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
void SCIPsortDownIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortDownIntIntInt(int *intarray1, int *intarray2, int *intarray3, int len)
void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
void SCIPsortInt(int *intarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
void SCIPprintSysError(const char *message)
assert(minobj< SCIPgetCutoffbound(scip))
static SCIP_Bool propagate
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPdebugPrintCons(x, y, z)
#define SCIPstatisticPrintf
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
#define TCLIQUE_GETWEIGHTS(x)
#define TCLIQUE_GETNNODES(x)
#define TCLIQUE_ISEDGE(x)
#define TCLIQUE_SELECTADJNODES(x)
enum TCLIQUE_Status TCLIQUE_STATUS
void tcliqueMaxClique(TCLIQUE_GETNNODES((*getnnodes)), TCLIQUE_GETWEIGHTS((*getweights)), TCLIQUE_ISEDGE((*isedge)), TCLIQUE_SELECTADJNODES((*selectadjnodes)), TCLIQUE_GRAPH *tcliquegraph, TCLIQUE_NEWSOL((*newsol)), TCLIQUE_DATA *tcliquedata, int *maxcliquenodes, int *nmaxcliquenodes, TCLIQUE_WEIGHT *maxcliqueweight, TCLIQUE_WEIGHT maxfirstnodeweight, TCLIQUE_WEIGHT minweight, int maxntreenodes, int backtrackfreq, int maxnzeroextensions, int fixednode, int *ntreenodes, TCLIQUE_STATUS *status)
struct TCLIQUE_Graph TCLIQUE_GRAPH
#define TCLIQUE_NEWSOL(x)
@ SCIP_CONFTYPE_PROPAGATION
#define SCIP_DECL_CONSENFOLP(x)
#define SCIP_DECL_CONSINITPRE(x)
#define SCIP_DECL_CONSDELETE(x)
#define SCIP_DECL_CONSGETVARS(x)
#define SCIP_DECL_CONSPRINT(x)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
#define SCIP_DECL_CONSSEPALP(x)
#define SCIP_DECL_CONSENFORELAX(x)
#define SCIP_DECL_CONSPROP(x)
#define SCIP_DECL_CONSGETNVARS(x)
#define SCIP_DECL_CONSRESPROP(x)
#define SCIP_DECL_CONSENFOPS(x)
#define SCIP_DECL_CONSPARSE(x)
#define SCIP_DECL_CONSTRANS(x)
#define SCIP_DECL_CONSPRESOL(x)
#define SCIP_DECL_CONSINITLP(x)
#define SCIP_DECL_CONSEXITPRE(x)
#define SCIP_DECL_CONSLOCK(x)
#define SCIP_DECL_CONSCOPY(x)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_DECL_CONSCHECK(x)
#define SCIP_DECL_CONSHDLRCOPY(x)
#define SCIP_DECL_CONSEXITSOL(x)
#define SCIP_DECL_CONSFREE(x)
#define SCIP_DECL_CONSSEPASOL(x)
struct SCIP_EventData SCIP_EVENTDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
enum SCIP_BoundType SCIP_BOUNDTYPE
#define SCIP_DECL_SORTPTRCOMP(x)
#define SCIP_DECL_SORTINDCOMP(x)
@ SCIP_PARAMEMPHASIS_CPSOLVER
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_TRANSFORMING
@ SCIP_STATUS_TOTALNODELIMIT
@ SCIP_STATUS_BESTSOLLIMIT
@ SCIP_STATUS_PRIMALLIMIT
@ SCIP_STATUS_USERINTERRUPT
@ SCIP_STATUS_STALLNODELIMIT
@ SCIP_STATUS_RESTARTLIMIT
#define SCIP_PRESOLTIMING_ALWAYS
#define SCIP_PRESOLTIMING_MEDIUM
unsigned int SCIP_PRESOLTIMING
#define SCIP_PRESOLTIMING_FAST
#define SCIP_PRESOLTIMING_EXHAUSTIVE
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED