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))))
417 SCIP_Real* vbdconsts;
433 for( v = 0; v < nvbdvars; ++v )
445 duration = (int)(
size_t)image;
452 if( duration >= vbdconst )
458 if( (*est) < impliedest )
486 SCIP_Real* vbdconsts;
501 for( v = 0; v < nvbdvars; ++v )
516 if( duration >= -vbdconst )
522 if( (*lct) > impliedlct )
556 startindex = nstarted - 1;
562 while( nstarted - nfinished > nrowvars )
571 varidx = startindices[startindex];
575 duration = consdata->durations[
varidx];
576 demand = consdata->demands[
varidx];
582 if( endtime > curtime )
600 start = curtime - duration + 1;
601 end =
MIN(curtime, endtime - duration);
605 if( vals[
b] < start )
621 (*vars)[*
nvars] = binvars[
b];
622 (*coefs)[*
nvars] = demand;
659 assert(curtime >= consdata->hmin);
660 assert(curtime < consdata->hmax);
667 startindex = nstarted - 1;
670 while( nstarted - nfinished > counter )
675 varidx = startindices[startindex];
679 duration = consdata->durations[
varidx];
688 endtime =
MIN(starttime + duration, consdata->hmax);
691 if( endtime > curtime )
693 (*activevars)[counter] =
var;
694 sumofstarts += starttime;
695 mindelta =
MIN(mindelta, endtime - curtime);
703 *lhs = lower ? sumofstarts + mindelta : sumofstarts - mindelta;
728 for ( j = 0; j <
nvars; ++j )
775 for ( j = 0; j <
nvars; ++j )
815 tmpnvars = consdata->nvars;
819 for ( j = 0; j < tmpnvars; ++j )
821 var = consdata->vars[j];
823 assert(consdata->durations[j] > 0);
824 assert(consdata->demands[j] > 0);
834 startindices[*
nvars] = j;
836 endtimes[*
nvars] = starttimes[*
nvars] + consdata->durations[j];
837 endindices[*
nvars] = j;
839 SCIPdebugMsg(
scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
841 consdata->durations[j],
842 starttimes[*
nvars], starttimes[*
nvars] + consdata->durations[startindices[*
nvars]],
843 consdata->demands[startindices[*
nvars]]);
854 startindices[*
nvars] = j;
856 endtimes[*
nvars] = starttimes[*
nvars] + consdata->durations[j];
857 endindices[*
nvars] = j;
859 SCIPdebugMsg(
scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
861 consdata->durations[j],
862 starttimes[*
nvars], starttimes[*
nvars] + consdata->durations[startindices[*
nvars]],
863 consdata->demands[startindices[*
nvars]]);
876 for ( j = 0; j < *
nvars; ++j )
878 SCIPdebugMsg(
scip,
"%d: job[%d] starttime %d, endtime = %d, demand = %d\n", j,
879 startindices[j], starttimes[j], starttimes[j] + consdata->durations[startindices[j]],
880 consdata->demands[startindices[j]]);
883 for ( j = 0; j < *
nvars; ++j )
885 SCIPdebugMsg(
scip,
"%d: job[%d] endtime %d, demand = %d\n", j, endindices[j], endtimes[j],
886 consdata->demands[endindices[j]]);
904 SCIP_Real** cumulativedemands,
907 SCIP_Real* minfreecapacity
915 SCIP_Real totaldemand;
944 (*timepoints)[0] = starttimes[0];
945 (*cumulativedemands)[0] = 0;
949 for( j = 0; j <
nvars; ++j )
954 curtime = starttimes[j];
956 if( curtime >= hmax )
960 while( endindex <
nvars && endtimes[endindex] <= curtime )
964 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
967 (*timepoints)[*ntimepoints] = endtimes[endindex];
968 (*cumulativedemands)[*ntimepoints] = 0;
971 idx = endindices[endindex];
973 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
976 (*cumulativedemands)[*ntimepoints] = totaldemand;
979 idx = startindices[j];
981 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
983 if( (*timepoints)[*ntimepoints] < curtime )
986 (*timepoints)[*ntimepoints] = curtime;
987 (*cumulativedemands)[*ntimepoints] = 0;
990 (*cumulativedemands)[*ntimepoints] = totaldemand;
993 while( j+1 <
nvars && starttimes[j+1] == curtime )
996 idx = startindices[j];
998 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
1000 (*cumulativedemands)[*ntimepoints] = totaldemand;
1005 while( endindex <
nvars)
1010 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
1013 (*timepoints)[*ntimepoints] = endtimes[endindex];
1014 (*cumulativedemands)[*ntimepoints] = 0;
1017 idx = endindices[endindex];
1019 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
1020 (*cumulativedemands)[*ntimepoints] = totaldemand;
1027 (*minfreecapacity) = INT_MAX;
1028 for( j = 0; j < *ntimepoints; ++j )
1030 if( (*timepoints)[j] >= hmin && (*timepoints)[j] < hmax )
1031 *minfreecapacity =
MIN( *minfreecapacity, (SCIP_Real)capacity - (*cumulativedemands)[j] );
1056 SCIP_Real disjfactor2;
1057 SCIP_Real cumfactor1;
1058 SCIP_Real resstrength1;
1059 SCIP_Real resstrength2;
1062 SCIP_Real globalpeak;
1063 SCIP_Real globalmaxdemand;
1069 nvars = consdata->nvars;
1070 capacity = consdata->capacity;
1072 globalmaxdemand = 0.0;
1079 for( v = 0; v <
nvars; ++v )
1082 SCIP_Real maxdemand;
1083 SCIP_Real deltademand;
1090 peak = consdata->demands[v];
1095 if( consdata->demands[v] > capacity / 3 )
1098 for( j = 0; j <
nvars; ++j )
1108 if( lb <= timepoint && lb + consdata->durations[j] > timepoint )
1110 peak += consdata->demands[j];
1113 if( consdata->demands[j] > consdata->capacity / 3 )
1118 deltademand = (
SCIP_Real)peak / (SCIP_Real)ndemands;
1119 globalpeak =
MAX(globalpeak, peak);
1120 globalmaxdemand =
MAX(globalmaxdemand, maxdemand);
1122 if( peak > capacity )
1124 disjfactor2 =
MAX( disjfactor2, (peak-(SCIP_Real)capacity)/peak * (nlarge/(SCIP_Real)ndemands) );
1125 cumfactor1 =
MAX( cumfactor1, (peak-capacity)/peak * (capacity-deltademand)/(SCIP_Real)capacity );
1126 resstrength2 =
MAX(resstrength2, (capacity-maxdemand)/(peak-maxdemand) );
1130 resstrength1 = (capacity-globalmaxdemand) / (globalpeak-globalmaxdemand);
1133 consdata->disjfactor2 = disjfactor2;
1134 consdata->cumfactor1 = cumfactor1;
1135 consdata->resstrength2 = resstrength2;
1136 consdata->resstrength1 = resstrength1;
1141 SCIP_Real* estimateddemands;
1144 SCIP_Real minfreecapacity;
1150 minfreecapacity = INT_MAX;
1153 consdata->durations, consdata->demands,
1154 capacity, consdata->hmin, consdata->hmax, &timepoints, &estimateddemands,
1155 &ntimepoints, &maxdemand, &minfreecapacity) );
1161 consdata->estimatedstrength = (
SCIP_Real)(capacity - minfreecapacity) / (
SCIP_Real) capacity;
1164 SCIPstatisticPrintf(
"cumulative constraint<%s>: DISJ1=%g, DISJ2=%g, CUM=%g, RS1 = %g, RS2 = %g, EST = %g\n",
1165 SCIPconsGetName(cons), consdata->disjfactor1, disjfactor2, cumfactor1, resstrength1, resstrength2,
1166 consdata->estimatedstrength);
1183 SCIP_Real realscalar;
1184 SCIP_Real realconstant;
1196 if( realconstant < 0.0 )
1201 if( realscalar < 0.0 )
1225 SCIP_Longint energy;
1230 for( j = 0; j < njobs; ++j )
1231 energy += (SCIP_Longint) durations[j] * demands[j];
1254 SCIP_Longint maxnodes,
1255 SCIP_Real timelimit,
1256 SCIP_Real memorylimit,
1259 SCIP_Bool* infeasible,
1260 SCIP_Bool* unbounded,
1283 for( v = 0; v < njobs; ++v )
1290 if( objvals ==
NULL )
1301 njobs, subvars, durations, demands, capacity) );
1346 (*infeasible) =
TRUE;
1350 (*unbounded) =
TRUE;
1361 for( v = 0; v < njobs; ++v )
1378 for( v = 0; v < njobs; ++v )
1400 for( v = 0; v < njobs; ++v )
1421 (*infeasible) =
FALSE;
1422 (*unbounded) =
FALSE;
1425 SCIPdebugMessage(
"solve independent cumulative condition with %d variables\n", njobs);
1432 njobs, capacity, hmin, hmax,
1433 maxnodes, timelimit, memorylimit,
1435 infeasible, unbounded, solved, error);
1462 (*infeasible) =
FALSE;
1463 (*unbounded) =
FALSE;
1466 SCIPdebugMsg(
scip,
"solve independent cumulative condition with %d variables\n", njobs);
1485 for( v = 0; v < njobs; ++v )
1493 if( objvals ==
NULL )
1502 timeinterval = lst - est + 1;
1503 assert(timeinterval > 0);
1506 minest =
MIN(minest, est);
1507 maxlct =
MAX(maxlct, lst + durations[v]);
1516 for( t = 0; t < timeinterval; ++t )
1529 binvars[v][t] = binvar;
1538 hmin =
MAX(hmin, minest);
1539 hmax =
MIN(hmax, maxlct);
1545 for( t = hmin; t < hmax; ++t )
1556 for( v = 0; v < njobs; ++v )
1569 duration = durations[v];
1573 if( t < est || t >= lst + duration )
1576 demand = demands[v];
1579 start =
MAX(t - duration + 1, est);
1584 for( k = start; k <= end; ++k )
1621 (*infeasible) =
TRUE;
1625 (*unbounded) =
TRUE;
1635 for( v = 0; v < njobs; ++v )
1645 timeinterval = lst - est + 1;
1648 for( t = 0; t < timeinterval; ++t )
1668 for( v = 0; v < njobs; ++v )
1678 timeinterval = lst - est + 1;
1681 for( t = 0; t < timeinterval; ++t )
1691 for( t = timeinterval - 1; t >= 0; --t )
1714 for( v = 0; v < njobs; ++v )
1724 timeinterval = lst - est + 1;
1726 for( t = 0; t < timeinterval; ++t )
1767 (*conshdlrdata)->eventhdlr = eventhdlr;
1770 (*conshdlrdata)->solveCumulative = solveCumulativeViaScipCp;
1772#ifdef SCIP_STATISTIC
1773 (*conshdlrdata)->nlbtimetable = 0;
1774 (*conshdlrdata)->nubtimetable = 0;
1775 (*conshdlrdata)->ncutofftimetable = 0;
1776 (*conshdlrdata)->nlbedgefinder = 0;
1777 (*conshdlrdata)->nubedgefinder = 0;
1778 (*conshdlrdata)->ncutoffedgefinder = 0;
1779 (*conshdlrdata)->ncutoffoverload = 0;
1780 (*conshdlrdata)->ncutoffoverloadTTEF = 0;
1782 (*conshdlrdata)->nirrelevantjobs = 0;
1783 (*conshdlrdata)->nalwaysruns = 0;
1784 (*conshdlrdata)->nremovedlocks = 0;
1785 (*conshdlrdata)->ndualfixs = 0;
1786 (*conshdlrdata)->ndecomps = 0;
1787 (*conshdlrdata)->ndualbranchs = 0;
1788 (*conshdlrdata)->nallconsdualfixs = 0;
1789 (*conshdlrdata)->naddedvarbounds = 0;
1790 (*conshdlrdata)->naddeddisjunctives = 0;
1832 for( v = 0; v < consdata->nvars; ++v )
1876 for( v = 0; v < consdata->nvars; ++v )
1894 nvars = consdata->nvars;
1897 for( v = 0; v <
nvars; ++v )
1899 consdata->downlocks[v] = locked;
1900 consdata->uplocks[v] = locked;
1934 (*consdata)->hmin = hmin;
1935 (*consdata)->hmax = hmax;
1937 (*consdata)->capacity = capacity;
1938 (*consdata)->demandrows =
NULL;
1939 (*consdata)->demandrowssize = 0;
1940 (*consdata)->ndemandrows = 0;
1941 (*consdata)->scoverrows =
NULL;
1942 (*consdata)->nscoverrows = 0;
1943 (*consdata)->scoverrowssize = 0;
1944 (*consdata)->bcoverrows =
NULL;
1945 (*consdata)->nbcoverrows = 0;
1946 (*consdata)->bcoverrowssize = 0;
1947 (*consdata)->nvars =
nvars;
1948 (*consdata)->varssize =
nvars;
1949 (*consdata)->signature = 0;
1950 (*consdata)->validsignature =
FALSE;
1951 (*consdata)->normalized =
FALSE;
1952 (*consdata)->covercuts =
FALSE;
1953 (*consdata)->propagated =
FALSE;
1954 (*consdata)->varbounds =
FALSE;
1955 (*consdata)->triedsolving =
FALSE;
1964 (*consdata)->linkingconss =
NULL;
1972 if( linkingconss !=
NULL )
1988 for( v = 0; v <
nvars; ++v )
1993 if( linkingconss !=
NULL )
1998 for( v = 0; v <
nvars; ++v )
2007 for( v = 0; v < (*consdata)->nvars; ++v )
2013 (*consdata)->vars =
NULL;
2014 (*consdata)->downlocks =
NULL;
2015 (*consdata)->uplocks =
NULL;
2016 (*consdata)->demands =
NULL;
2017 (*consdata)->durations =
NULL;
2018 (*consdata)->linkingconss =
NULL;
2022 (*consdata)->resstrength1 = -1.0;
2023 (*consdata)->resstrength2 = -1.0;
2024 (*consdata)->cumfactor1 = -1.0;
2025 (*consdata)->disjfactor1 = -1.0;
2026 (*consdata)->disjfactor2 = -1.0;
2027 (*consdata)->estimatedstrength = -1.0;
2046 for(
r = 0;
r < (*consdata)->ndemandrows; ++
r )
2054 (*consdata)->ndemandrows = 0;
2055 (*consdata)->demandrowssize = 0;
2058 for(
r = 0;
r < (*consdata)->nscoverrows; ++
r )
2066 (*consdata)->nscoverrows = 0;
2067 (*consdata)->scoverrowssize = 0;
2069 for(
r = 0;
r < (*consdata)->nbcoverrows; ++
r )
2077 (*consdata)->nbcoverrows = 0;
2078 (*consdata)->bcoverrowssize = 0;
2080 (*consdata)->covercuts =
FALSE;
2098 nvars = (*consdata)->nvars;
2099 varssize = (*consdata)->varssize;
2109 if( (*consdata)->linkingconss !=
NULL )
2111 for( v =
nvars-1; v >= 0; --v )
2113 assert((*consdata)->linkingconss[v] !=
NULL );
2149 for( v = 0; v < consdata->nvars; ++v )
2156 consdata->durations[v], consdata->demands[v]);
2158 SCIPinfoMessage(
scip, file,
")[%d,%d) <= %d", consdata->hmin, consdata->hmax, consdata->capacity);
2185 consdata->downlocks[pos] =
FALSE;
2186 consdata->uplocks[pos] =
FALSE;
2188 if( consdata->linkingconss !=
NULL )
2203 SCIPdebugMsg(
scip,
"remove variable <%s>[%g,%g] from cumulative constraint <%s>\n",
2209 if( pos != consdata->nvars - 1 )
2211 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
2212 consdata->downlocks[pos] = consdata->downlocks[consdata->nvars-1];
2213 consdata->uplocks[pos] = consdata->uplocks[consdata->nvars-1];
2214 consdata->demands[pos] = consdata->demands[consdata->nvars-1];
2215 consdata->durations[pos] = consdata->durations[consdata->nvars-1];
2217 if( consdata->linkingconss !=
NULL )
2219 consdata->linkingconss[pos]= consdata->linkingconss[consdata->nvars-1];
2224 consdata->validsignature =
FALSE;
2225 consdata->normalized =
FALSE;
2243 nvars = consdata->nvars;
2249 for( v = 0; v <
nvars; ++v )
2254 var = consdata->vars[v];
2270 consdata->linkingconss[v] = cons;
2309 SCIP_Bool* violated,
2311 SCIP_Bool printreason
2314 int* startsolvalues;
2330 (*violated) =
FALSE;
2346 for ( j = 0; j <
nvars; ++j )
2358 startsolvalues[j] =
MAX(solvalue, hmin);
2359 startindices[j] = j;
2361 endsolvalues[j] =
MAX(solvalue + durations[j], hmin);
2372 freecapacity = capacity;
2377 for( j = 0; j <
nvars; ++j )
2380 curtime = startsolvalues[j];
2382 if( curtime >= hmax )
2386 freecapacity -= demands[startindices[j]];
2387 while( j+1 <
nvars && startsolvalues[j+1] == curtime )
2390 freecapacity -= demands[startindices[j]];
2394 while( endindex < nvars && curtime >= endsolvalues[endindex] )
2396 freecapacity += demands[endindices[endindex]];
2399 assert(freecapacity <= capacity);
2402 if( absviol < (SCIP_Real) (-freecapacity) )
2404 absviol = -freecapacity;
2405 relviol =
SCIPrelDiff((SCIP_Real)(capacity - freecapacity), (SCIP_Real)capacity);
2409 if( freecapacity < 0 && curtime >= hmin )
2423 ";\nviolation: at time point %d available capacity = %d, needed capacity = %d\n",
2424 curtime, capacity, capacity - freecapacity);
2426 for(
i = 0;
i <= j; ++
i )
2428 if( startsolvalues[
i] + durations[startindices[
i]] > curtime )
2432 demands[startindices[
i]]);
2461 SCIP_Bool* violated,
2462 SCIP_Bool printreason
2478 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
2479 violated, cons, printreason) );
2507 SCIP_Bool usebdwidening,
2509 SCIP_Bool* explanation
2513 SCIP_Bool* reported;
2523 SCIPdebugMsg(
scip,
"variable <%s>: (demand %d) resolve propagation of core time algorithm (peak %d)\n",
2528 capacity -= inferdemand;
2538 for( j = 0; j < nvars && capacity >= 0; ++j )
2544 if(
var == infervar )
2547 duration = durations[j];
2556 SCIPdebugMsg(
scip,
"variable <%s>: glb=[%g,%g] conflict=[%g,%g] (duration %d, demand %d)\n",
2566 if( inferpeak < ect && lst <= inferpeak )
2568 capacity -= demands[j];
2571 maxlst =
MAX(maxlst, lst);
2572 minect =
MIN(minect, ect);
2575 if( explanation !=
NULL )
2576 explanation[j] =
TRUE;
2593 if( inferpeak < ect && lst <= inferpeak )
2595 capacity -= demands[j];
2598 maxlst =
MAX(maxlst, lst);
2599 minect =
MIN(minect, ect);
2602 if( explanation !=
NULL )
2603 explanation[j] =
TRUE;
2619 for( j = 0; j <
nvars; ++j )
2625 if(
var == infervar || reported[j] )
2628 duration = durations[j];
2641 SCIPdebugMsg(
scip,
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
2646 if( inferpeak < ect && lst <= inferpeak )
2649 canddemands[ncands] = demands[j];
2652 capacity -= demands[j];
2663 while( capacity + canddemands[ncands-1] < 0 )
2666 capacity += canddemands[ncands];
2671 for(
c = 0;
c < ncands; ++
c )
2676 duration = durations[cands[
c]];
2681 maxlst =
MAX(maxlst, lst);
2682 minect =
MIN(minect, ect);
2686 SCIPdebugMsg(
scip,
"infer peak %d, relaxed peak %d, lst %d, ect %d\n", inferpeak, relaxedpeak, maxlst, minect);
2687 assert(inferpeak >= maxlst);
2688 assert(inferpeak < minect);
2691 if( relaxedpeak < inferpeak )
2693 inferpeak =
MAX(maxlst, relaxedpeak);
2695 else if( relaxedpeak > inferpeak )
2697 inferpeak =
MIN(minect-1, relaxedpeak);
2699 assert(inferpeak >= hmin);
2700 assert(inferpeak < hmax);
2701 assert(inferpeak >= maxlst);
2702 assert(inferpeak < minect);
2705 for(
c = 0;
c < ncands; ++
c )
2712 duration = durations[cands[
c]];
2723 if( explanation !=
NULL )
2724 explanation[cands[
c]] =
TRUE;
2733 if( provedpeak !=
NULL )
2734 *provedpeak = inferpeak;
2755 SCIP_Bool usebdwidening,
2756 SCIP_Bool* explanation
2785 for( j = 0; j <
nvars; ++j )
2797 if(
var == infervar )
2799 if( explanation !=
NULL )
2800 explanation[j] =
TRUE;
2808 duration = durations[j];
2814 left = (est == hmin && lb + duration > hmin) || lb >= est;
2819 right = (lct == hmax && ub < hmax) || ub + duration <= lct;
2836 if( explanation !=
NULL )
2837 explanation[j] =
TRUE;
2860 ect = est + duration;
2861 lct = lst + duration;
2864 if( lct <= end && est >= begin )
2867 assert(lst <= end && ect >= begin);
2875 return MIN3(left, right, end - begin);
2896 SCIP_Real relaxedbd,
2897 SCIP_Bool usebdwidening,
2898 SCIP_Bool* explanation
2905 SCIP_Longint requiredenergy;
2913 requiredenergy = ((
SCIP_Longint) end - begin) * capacity;
2920 for( v = 0; v <
nvars; ++v )
2936 demand = demands[v];
2939 duration = durations[v];
2943 if( infervar ==
var )
2951 SCIPdebugMsg(
scip,
"inference variable <%s>[%g,%g] %s %g (duration %d, demand %d)\n",
2974 right =
MIN3(end - lst, end - begin, duration);
2984 left =
MIN(lct - begin + 1, end - begin);
2988 overlap =
MIN(left, right);
2990 assert(overlap <= end - begin);
2991 assert(overlap <= duration);
3021 left =
MIN3(ect - begin, end - begin, duration);
3031 right =
MIN(end - est + 1, end - begin);
3035 overlap =
MIN(left, right);
3037 assert(overlap <= end - begin);
3038 assert(overlap <= duration);
3054 if( explanation !=
NULL )
3055 explanation[v] =
TRUE;
3069 if( est + duration > begin && lst < end )
3072 glbenergy =
computeOverlap(begin, end, est, lst, duration) * demand;
3075 requiredenergy -= glbenergy;
3077 if( explanation !=
NULL )
3078 explanation[v] =
TRUE;
3088 if( est + duration > begin && lst < end )
3093 locenergies[v] = overlaps[v] * demand - glbenergy;
3094 assert(locenergies[v] >= 0);
3102 for( v = 0; v < nvars && requiredenergy >= 0; ++v )
3118 duration = durations[idx];
3121 overlap = overlaps[v];
3124 requiredenergy -= locenergies[v];
3126 if( requiredenergy < -1 )
3130 demand = demands[idx];
3133 overlap += (int)((requiredenergy + 1) / demand);
3136 requiredenergy += locenergies[v];
3138 assert(requiredenergy < 0);
3143 relaxlb = begin - duration + overlap;
3144 relaxub = end - overlap;
3146 SCIPdebugMsg(
scip,
"variable <%s> glb=[%g,%g] loc=[%g,%g], conf=[%g,%g], added=[%d,%d] (demand %d, duration %d)\n",
3151 relaxlb, relaxub, demands[idx], duration);
3156 if( explanation !=
NULL )
3157 explanation[idx] =
TRUE;
3160 assert(requiredenergy < 0);
3184 SCIP_Real relaxedbd,
3185 SCIP_Bool usebdwidening,
3186 SCIP_Bool* explanation,
3203 if( inferpos >=
nvars ||
vars[inferpos] != infervar )
3206 for( inferpos = 0; inferpos <
nvars &&
vars[inferpos] != infervar; ++inferpos )
3212 inferdemand = demands[inferpos];
3213 inferduration = durations[inferpos];
3222 SCIPdebugMsg(
scip,
"variable <%s>: upper bound changed from %g to %g (relaxed %g)\n",
3235 relaxedpeak =
MIN(relaxedpeak, hmax-1);
3241 relaxedpeak =
MAX(relaxedpeak, inferpeak);
3242 assert(relaxedpeak >= inferpeak);
3243 assert(relaxedpeak >= hmin);
3249 SCIPdebugMsg(
scip,
"variable <%s>: lower bound changed from %g to %g (relaxed %g)\n",
3262 relaxedpeak =
MAX(relaxedpeak, hmin);
3268 relaxedpeak =
MIN(relaxedpeak, inferpeak);
3269 assert(relaxedpeak < hmax);
3274 infervar, inferdemand, inferpeak, relaxedpeak, bdchgidx, usebdwidening, &provedpeak, explanation) );
3303 if( explanation !=
NULL )
3304 explanation[inferpos] =
TRUE;
3318 begin =
MAX(begin, hmin);
3319 end =
MIN(end, hmax);
3322 begin, end, infervar, boundtype, bdchgidx, relaxedbd, usebdwidening, explanation) );
3353 int* alternativelbs,
3354 int* alternativeubs,
3362 for( v = 0; v <
nvars; ++v )
3378 if( alternativelbs[v] <= ub )
3396 if( alternativeubs[v] >= lb )
3424#if defined SCIP_DEBUG && !defined NDEBUG
3436 assert(starttimes[*idx] == curtime);
3438 assert(freecapacity != idx);
3441 (*freecapacity) -= consdata->demands[startindices[*idx]];
3443 while( (*idx)+1 <
nvars && starttimes[(*idx)+1] == curtime )
3446 (*freecapacity) -= consdata->demands[startindices[(*idx)]];
3447 assert(freecapacity != idx);
3466#if defined SCIP_DEBUG && !defined NDEBUG
3472 while( endtimes[*idx] <= curtime && *idx <
nvars)
3474 (*freecapacity) += consdata->demands[endindices[*idx]];
3509 nvars = consdata->nvars;
3512 *timepoint = consdata->hmax;
3523 starttimes, endtimes, startindices, endindices);
3526 freecapacity = consdata->capacity;
3527 hmin = consdata->hmin;
3528 hmax = consdata->hmax;
3531 for( j = 0; j <
nvars; ++j )
3533 curtime = starttimes[j];
3536 if( curtime >= hmax )
3545 assert(freecapacity <= consdata->capacity);
3552 if( freecapacity < 0 && curtime >= hmin )
3554 *timepoint = curtime;
3586 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3591 for(
c = 0;
c < nconss; ++
c )
3611 if( curtime < consdata->hmin || curtime >= consdata->hmax )
3615 for( j = 0; j < consdata->nvars; ++j )
3621 var = consdata->vars[j];
3631 if( lb <= curtime && ub + consdata->durations[j] > curtime && lb < ub )
3637 score =
MIN(solval - lb, ub - solval) / ((
SCIP_Real)ub-lb);
3673 if( nbranchcands > 0 )
3684 for(
c = 0;
c < nconss && !violated; ++
c )
3716 SCIP_Bool* downlocks;
3724 nvars = consdata->nvars;
3725 vars = consdata->vars;
3726 downlocks = consdata->downlocks;
3727 uplocks = consdata->uplocks;
3730 for( v = 0; v <
nvars; ++v )
3752 SCIP_Longint maxnodes,
3757 SCIP_Bool* unbounded
3765 SCIP_Real timelimit;
3766 SCIP_Real memorylimit;
3795 if( ncheckconss == 1 )
3845 if( consdata->triedsolving )
3855 consdata->triedsolving =
TRUE;
3857 SCIPdebugMsg(
scip,
"the cumulative constraint <%s> is independent from rest of the problem (%d variables, %d constraints)\n",
3861 nvars = consdata->nvars;
3862 vars = consdata->vars;
3868 for( v = 0; v <
nvars; ++v )
3899 consdata->hmin, consdata->hmax, timelimit, memorylimit, maxnodes, &solved,
cutoff, unbounded, &error) );
3901 if( !(*
cutoff) && !(*unbounded) && !error )
3903 SCIP_Bool infeasible;
3904 SCIP_Bool tightened;
3909 for( v = 0; v <
nvars; ++v )
3912 if( lbs[v] + 0.5 > ubs[v] )
3920 consdata->triedsolving =
FALSE;
3931 consdata->triedsolving =
FALSE;
3940 consdata->triedsolving =
FALSE;
3977 SCIP_Bool usebdwidening,
3978 SCIP_Bool* initialized,
3979 SCIP_Bool* explanation
3982 SCIPdebugMsg(
scip,
"detected infeasibility due to adding a core to the core resource profile\n");
3992 infervar, inferdemand, inferpeak, inferpeak,
NULL, usebdwidening,
NULL, explanation) );
4008 *initialized =
TRUE;
4033 SCIP_Bool usebdwidening,
4034 SCIP_Bool* initialized,
4035 SCIP_Bool* explanation,
4036 SCIP_Bool* infeasible
4052 duration = durations[idx];
4055 demand = demands[idx];
4067 SCIPdebugMsg(
scip,
"propagate earliest start time (lower bound) (pos %d)\n", pos);
4073 SCIP_Bool tightened;
4085 ect = est + duration;
4113 newlb =
MIN(newlb, ect);
4122 var, duration, demand, newlb-1, usebdwidening, initialized, explanation) );
4124 if( explanation !=
NULL )
4125 explanation[idx] =
TRUE;
4214 lct = lst + duration;
4232 SCIP_Bool tightened;
4233 SCIP_Bool infeasible;
4272 newub =
MAX(newub, lst) - duration;
4306 lct = lst + duration;
4328 int* coreEnergyAfterEst,
4329 int* coreEnergyAfterLct
4338 t = ntimepoints - 1;
4342 for( v =
nvars-1; v >= 0; --v )
4360 coreEnergyAfterEst[v] = energy;
4363 t = ntimepoints - 1;
4367 for( v =
nvars-1; v >= 0; --v )
4385 coreEnergyAfterLct[v] = energy;
4410 for( v = 0; v <
nvars; ++ v)
4421 duration = durations[v];
4426 ect = est + duration;
4427 lct = lst + duration;
4438 leftadjust =
MAX(0, hmin - est);
4441 rightadjust =
MAX(0, lct - hmax);
4444 flexenergies[v] = duration - leftadjust - rightadjust - core;
4445 flexenergies[v] =
MAX(0, flexenergies[v]);
4446 flexenergies[v] *= demands[v];
4447 assert(flexenergies[v] >= 0);
4450 ects[v] =
MIN(ect, lst);
4453 lsts[v] =
MAX(ect, lst);
4477 SCIP_Longint energy,
4480 SCIP_Bool* initialized,
4481 SCIP_Bool* explanation,
4491 if( !conshdlrdata->ttefinfer )
4495 if( est >= end || ect <= begin )
4501 if( est >= begin && ect <= end )
4507 if( energy >= demand * ((SCIP_Longint)
MAX(begin, est) -
MIN(end, ect)) )
4522 newlb = end - (int) (energy / demand);
4527 if( newlb > lct - duration )
4532 SCIP_Real relaxedbd;
4549 (*initialized) =
TRUE;
4554 else if( newlb > (*bestlb) )
4590 SCIP_Longint energy,
4593 SCIP_Bool* initialized,
4594 SCIP_Bool* explanation,
4605 if( !conshdlrdata->ttefinfer )
4609 if( lst >= end || lct <= begin )
4615 if( lst >= begin && lct <= end )
4619 if( energy >= demand * ((SCIP_Longint)
MIN(end, lct) -
MAX(begin, lst)) )
4636 newub = begin - duration + (int) (energy / demand);
4646 SCIP_Real relaxedbd;
4663 (*initialized) =
TRUE;
4668 else if( newub < (*bestub) )
4705 int* coreEnergyAfterEst,
4706 int* coreEnergyAfterLct,
4707 SCIP_Bool* initialized,
4708 SCIP_Bool* explanation,
4712 int coreEnergyAfterEnd;
4713 SCIP_Longint maxavailable;
4714 SCIP_Longint minavailable;
4715 SCIP_Longint totalenergy;
4727 for( v = 0; v <
nvars; ++v )
4732 est =
MIN(est, start);
4733 lct =
MAX(lct, end);
4737 hmin =
MAX(hmin, est);
4738 hmax =
MIN(hmax, lct);
4741 coreEnergyAfterEnd = -1;
4743 maxavailable = ((
SCIP_Longint) hmax - hmin) * capacity;
4744 minavailable = maxavailable;
4748 if( ((SCIP_Longint) lcts[0] - ests[
nvars-1]) * capacity >= totalenergy )
4756 for( v =
nvars-1; v >= 0 && !(*cutoff); --v )
4775 assert(v == 0 || lcts[v-1] <= lcts[v]);
4791 if( !conshdlrdata->ttefinfer && end <= hmax && minavailable < maxavailable )
4793 SCIP_Longint freeenergy;
4795 assert(coreEnergyAfterLct[v] >= coreEnergyAfterEnd);
4796 assert(coreEnergyAfterEnd >= 0);
4799 freeenergy = capacity * ((
SCIP_Longint) end - lct) - coreEnergyAfterLct[v] + coreEnergyAfterEnd;
4801 if( freeenergy <= minavailable )
4811 coreEnergyAfterEnd = coreEnergyAfterLct[v];
4814 minavailable = maxavailable;
4823 for(
i = nests-1;
i >= 0; --
i )
4826 SCIP_Longint freeenergy;
4853 if( ((SCIP_Longint) end - est) * capacity >= totalenergy )
4859 duration = durations[idx];
4862 demand = demands[idx];
4874 if( minavailable < maxavailable && est < minbegin )
4880 var, duration, demand, est, lst, lct, minbegin, end, minavailable, &(newubs[idx]), &(ubinferinfos[idx]),
4881 initialized, explanation,
cutoff) );
4887 SCIPdebugMsg(
scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, lst of free part <%d>\n",
4904 assert(flexenergies[idx] >= 0);
4905 flexenergy += flexenergies[idx];
4918 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (end - lst)));
4919 assert(end - lst < duration);
4923 flexenergy += energy;
4926 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
4930 if( candenergy > lbenergy )
4932 lbenergy = candenergy;
4937 SCIPdebugMsg(
scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
4938 assert(coreEnergyAfterEst[
i] >= coreEnergyAfterEnd);
4941 freeenergy = capacity * ((
SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterEst[
i] + coreEnergyAfterEnd;
4944 if( freeenergy < 0 )
4946 SCIPdebugMsg(
scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
4956 conshdlrdata->usebdwidening, explanation) );
4958 (*initialized) =
TRUE;
4970 if( lbenergy > 0 && freeenergy < lbenergy )
4972 SCIP_Longint energy;
4980 energy = freeenergy + (
computeCoreWithInterval(begin, end, ect, lst) +
MAX(0, (SCIP_Longint) end - lsts[lbcand])) * demands[lbcand];
4982 newlb = end - (int)(energy / demands[lbcand]);
4989 SCIP_Real relaxedbd;
4994 relaxedbd = lst + 1.0;
5001 conshdlrdata->usebdwidening, explanation) );
5003 (*initialized) =
TRUE;
5009 else if( newlb > newlbs[lbcand] )
5018 newlbs[lbcand] = newlb;
5023 if( minavailable > freeenergy )
5025 minavailable = freeenergy;
5028 assert(minavailable >= 0);
5056 int* coreEnergyAfterEst,
5057 int* coreEnergyAfterLct,
5058 SCIP_Bool* initialized,
5059 SCIP_Bool* explanation,
5063 int coreEnergyAfterStart;
5064 SCIP_Longint maxavailable;
5065 SCIP_Longint minavailable;
5066 SCIP_Longint totalenergy;
5084 for( v = 0; v <
nvars; ++v )
5089 minest =
MIN(minest, start);
5090 maxlct =
MAX(maxlct, end);
5094 hmin =
MAX(hmin, minest);
5095 hmax =
MIN(hmax, maxlct);
5097 maxavailable = ((
SCIP_Longint) hmax - hmin) * capacity;
5101 if( ((SCIP_Longint) lcts[0] - ests[
nvars-1]) * capacity >= totalenergy )
5109 for( v = 0; v <
nvars; ++v )
5141 coreEnergyAfterStart = coreEnergyAfterEst[v];
5144 minavailable = maxavailable;
5155 SCIP_Longint freeenergy;
5182 if( ((SCIP_Longint) lct - begin) * capacity >= totalenergy )
5188 duration = durations[idx];
5191 demand = demands[idx];
5203 if( minavailable < maxavailable && lct > minend )
5209 var, duration, demand, est, ect, lct, begin, minend, minavailable, &(newlbs[idx]), &(lbinferinfos[idx]),
5210 initialized, explanation,
cutoff) );
5216 SCIPdebugMsg(
scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, ect of free part <%d>\n",
5233 assert(flexenergies[idx] >= 0);
5234 flexenergy += flexenergies[idx];
5247 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (ect - begin)));
5248 assert(ect - begin < duration);
5252 flexenergy += energy;
5255 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
5259 if( candenergy > ubenergy )
5261 ubenergy = candenergy;
5266 SCIPdebugMsg(
scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
5267 assert(coreEnergyAfterLct[
i] <= coreEnergyAfterStart);
5270 freeenergy = capacity * ((
SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterStart + coreEnergyAfterLct[
i];
5273 if( freeenergy < 0 )
5275 SCIPdebugMsg(
scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
5285 conshdlrdata->usebdwidening, explanation) );
5287 (*initialized) =
TRUE;
5299 if( ubenergy > 0 && freeenergy < ubenergy )
5301 SCIP_Longint energy;
5305 duration = durations[ubcand];
5312 energy = freeenergy + (
computeCoreWithInterval(begin, end, ect, lst) +
MAX(0, (SCIP_Longint) ects[ubcand] - begin)) * demands[ubcand];
5314 newub = begin - duration + (int)(energy / demands[ubcand]);
5316 if( newub < ect - duration )
5321 SCIP_Real relaxedbd;
5325 relaxedbd = ect - duration - 1.0;
5332 conshdlrdata->usebdwidening, explanation) );
5334 (*initialized) =
TRUE;
5340 else if( newub < newubs[ubcand] )
5349 newubs[ubcand] = newub;
5354 if( minavailable > freeenergy )
5356 minavailable = freeenergy;
5359 assert(minavailable >= 0);
5390 SCIP_Bool* initialized,
5391 SCIP_Bool* explanation,
5395 int* coreEnergyAfterEst;
5396 int* coreEnergyAfterLct;
5417 if( !conshdlrdata->ttefcheck )
5438 for( v = 0; v <
nvars; ++v )
5442 lbinferinfos[v] = 0;
5443 ubinferinfos[v] = 0;
5447 collectDataTTEF(
scip,
nvars,
vars, durations, demands, hmin, hmax, permests, ests, permlcts, lcts, ects, lsts, flexenergies);
5460 newlbs, newubs, lbinferinfos, ubinferinfos, lsts, flexenergies,
5461 permests, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation,
cutoff) );
5465 newlbs, newubs, lbinferinfos, ubinferinfos, ects, flexenergies,
5466 permlcts, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation,
cutoff) );
5469 for( v = 0; v <
nvars && !(*cutoff); ++v )
5471 SCIP_Bool infeasible;
5472 SCIP_Bool tightened;
5477 TRUE, &infeasible, &tightened) );
5498 TRUE, &infeasible, &tightened) );
5541 conshdlrdata->usebdwidening, explanation) );
5543 (*initialized) =
TRUE;
5599 SCIP_Bool* initialized,
5600 SCIP_Bool* explanation,
5604 SCIP_Bool infeasible;
5617 if( !conshdlrdata->ttinfer )
5622 SCIPdebugMsg(
scip,
"propagate cores of cumulative condition of constraint <%s>[%d,%d) <= %d\n",
5632 for( v = 0; v <
nvars; ++v )
5645 duration = durations[v];
5657 if( lst + duration <= hmin || est >= hmax )
5661 begin =
MAX(hmin, lst);
5662 end =
MIN(hmax, est + duration);
5664 demand = demands[v];
5670 SCIPdebugMsg(
scip,
"variable <%s>[%g,%g] (duration %d, demand %d): remove core [%d,%d)\n",
5678 profile, v, nchgbds, conshdlrdata->usebdwidening, initialized, explanation,
cutoff) );
5685 profile, v, nchgbds) );
5695 begin =
MAX(hmin, lst);
5696 end =
MIN(hmax, est + duration);
5703 SCIPdebugMsg(
scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
5712 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
5714 if( explanation !=
NULL )
5715 explanation[v] =
TRUE;
5742 SCIP_Longint enveloptheta;
5745 SCIP_Longint enveloplambda;
5765 SCIPdebugMsg(
scip,
"update envelop starting from node <%p>\n", (
void*)node);
5770 while( node !=
NULL )
5789 if( leftdata->enveloptheta >= 0 )
5791 assert(rightdata->energytheta != -1);
5792 nodedata->enveloptheta =
MAX(leftdata->enveloptheta + rightdata->energytheta, rightdata->enveloptheta);
5795 nodedata->enveloptheta = rightdata->enveloptheta;
5797 assert(leftdata->energytheta != -1);
5798 assert(rightdata->energytheta != -1);
5799 nodedata->energytheta = leftdata->energytheta + rightdata->energytheta;
5801 if( leftdata->enveloplambda >= 0 )
5803 assert(rightdata->energytheta != -1);
5804 nodedata->enveloplambda =
MAX(leftdata->enveloplambda + rightdata->energytheta, rightdata->enveloplambda);
5807 nodedata->enveloplambda = rightdata->enveloplambda;
5809 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0 )
5810 nodedata->enveloplambda =
MAX(
nodedata->enveloplambda, leftdata->enveloptheta + rightdata->energylambda);
5814 if( leftdata->energylambda >= 0 && rightdata->energylambda >= 0 )
5816 assert(rightdata->energytheta != -1);
5817 assert(leftdata->energytheta != -1);
5818 nodedata->energylambda =
MAX(leftdata->energylambda + rightdata->energytheta, leftdata->energytheta + rightdata->energylambda);
5820 else if( rightdata->energylambda >= 0 )
5822 assert(leftdata->energytheta != -1);
5823 nodedata->energylambda = leftdata->energytheta + rightdata->energylambda;
5825 else if( leftdata->energylambda >= 0 )
5827 assert(rightdata->energytheta != -1);
5828 nodedata->energylambda = leftdata->energylambda + rightdata->energytheta;
5909 if( grandparent !=
NULL )
6019 if(
nodedata->key < leafdata->key )
6032 newnodedata = &nodedatas[*nnodedatas];
6033 nodedataidx[*nnodedatas] = *nnodedatas;
6037 newnodedata->var =
NULL;
6039 newnodedata->est = INT_MIN;
6040 newnodedata->lct = INT_MAX;
6041 newnodedata->duration = 0;
6042 newnodedata->demand = 0;
6043 newnodedata->enveloptheta = -1;
6044 newnodedata->energytheta = 0;
6045 newnodedata->enveloplambda = -1;
6046 newnodedata->energylambda = -1;
6047 newnodedata->idx = -1;
6048 newnodedata->intheta =
TRUE;
6056 if( parent !=
NULL )
6073 if(
nodedata->key < leafdata->key )
6085 newnodedata->key = leafdata->key;
6135 assert(rightdata->energytheta != -1);
6137 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6140 assert(leftdata->energytheta != -1);
6141 assert(rightdata->energylambda != -1);
6142 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6184 assert(rightdata->energytheta != -1);
6187 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6189 else if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6190 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6193 assert(rightdata->enveloplambda != -1);
6226 omegaset[*nelements] = node;
6279 assert(rightdata->energytheta != -1);
6281 if( leftdata->enveloptheta >= 0 &&
nodedata->enveloptheta == leftdata->enveloptheta + rightdata->energytheta )
6288 assert(rightdata->enveloptheta != -1);
6334 assert(rightdata->energytheta != -1);
6336 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6343 assert(leftdata->energytheta != -1);
6344 assert(rightdata->energylambda != -1);
6345 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6394 assert(rightdata->energytheta != -1);
6396 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6403 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6404 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6411 assert(rightdata->enveloplambda != -1);
6434 SCIPdebugMessage(
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
6439 return nodedata->demand * duration;
6452 return (est1 - est2);
6462 return (nodedatas[ind1].lct - nodedatas[ind2].lct);
6481 SCIP_Bool usebdwidening,
6482 SCIP_Bool* initialized,
6483 SCIP_Bool* explanation
6486 SCIP_Longint energy;
6493 SCIPdebugMsg(
scip,
"est=%d, lct=%d, propest %u, reportedenergy %d, shift %d\n", est, lct, propest, reportedenergy, shift);
6504 for( j = 0; j < nleaves && reportedenergy <= energy; ++j )
6520 assert(reportedenergy > energy);
6548 for( j = nleaves-1; j >= 0; --j )
6568 if( explanation !=
NULL )
6572 (*initialized) =
TRUE;
6597 if( energy > ((SCIP_Longint) capacity - demand) * ((SCIP_Longint) lct - est) )
6599 if( energy + (SCIP_Longint) demand * duration > capacity * ((SCIP_Longint) lct - est) )
6625 SCIP_Bool* initialized,
6626 SCIP_Bool* explanation,
6640 for( j = ncands-1; j >= 0 && !(*cutoff); --j )
6651 while( !(*
cutoff) && rootdata->enveloplambda > (SCIP_Longint) capacity *
nodedata->lct )
6671 assert(!leafdata->intheta);
6672 assert(leafdata->duration > 0);
6673 assert(leafdata->est >= 0);
6676 if( leafdata->est + leafdata->duration >=
nodedata->lct )
6698 assert(nelements < ncands);
6705 SCIPdebugMsg(
scip,
"an overload was detected duration edge-finder propagattion\n");
6709 conshdlrdata->usebdwidening, initialized, explanation) );
6715 else if( newest > 0 )
6717 SCIP_Bool infeasible;
6718 SCIP_Bool tightened;
6737 TRUE, &infeasible, &tightened) );
6759 TRUE, &infeasible, &tightened) );
6769 leafdata->est = newest;
6788 if( explanation !=
NULL )
6789 explanation[leafdata->idx] =
TRUE;
6792 for(
i = 0;
i < nelements; ++
i )
6800 if( explanation !=
NULL )
6804 (*initialized) =
TRUE;
6851 SCIP_Bool* initialized,
6852 SCIP_Bool* explanation,
6898 for( j = 0; j <
nvars; ++j )
6903 shift =
MAX(shift, lct);
6910 for( j = 0; j <
nvars; ++j )
6924 duration = durations[j];
6936 if( conshdlrdata->useadjustedjobs )
6940 leftadjust = (hmin - est);
6945 rightadjust = (lct - hmax);
6952 if( duration - leftadjust - rightadjust <= 0 )
6955 else if( est < hmin || lct > hmax )
6958 energy = demands[j] * (duration - leftadjust - rightadjust);
6961 totalenergy += energy;
6984 nodedataidx[ncands] = ncands;
6996 nodedata->rightadjust = rightadjust;
7011 nnodedatas = ncands;
7014 SCIPsortInd(nodedataidx, compNodedataLct, (
void*)nodedatas, ncands);
7021 for( j = 0; j < ncands; ++j )
7026 idx = nodedataidx[j];
7031 if( ((SCIP_Longint) nodedatas[idx].lct - nodedatas[idx].est) * capacity >= totalenergy )
7034 nodedatas[idx].est = -1;
7046 leaves[ninsertcands] = leaf;
7054 if( rootdata->enveloptheta > (SCIP_Longint) capacity * nodedatas[idx].lct )
7056 SCIPdebugMsg(
scip,
"detects cutoff due to overload in time window [?,%d) (ncands %d)\n", nodedatas[idx].lct, j);
7075 est = nodedatas[idx].est;
7076 lct = nodedatas[idx].lct;
7081 for( j = j+1; j < ncands; ++j )
7088 idx = nodedataidx[j];
7100 duration -= (est - glbest);
7103 duration -= (glblct - lct);
7107 glbenery +=
nodedata->demand * duration;
7109 if( explanation !=
NULL )
7116 conshdlrdata->usebdwidening, initialized, explanation) );
7118 else if( ninsertcands > 1 && conshdlrdata->efinfer )
7122 propest, shift, initialized, explanation, nchgbds,
cutoff) );
7154 SCIP_Bool* initialized,
7155 SCIP_Bool* explanation,
7165 if( !conshdlrdata->efcheck )
7170 cons,
TRUE, initialized, explanation, nchgbds,
cutoff) );
7177 if( !conshdlrdata->efinfer )
7182 cons,
FALSE, initialized, explanation, nchgbds,
cutoff) );
7201 SCIP_Bool* redundant
7221 (*redundant) =
TRUE;
7237 for( j = 0; j <
nvars; ++j )
7239 assert(durations[j] > 0);
7249 if( lb >= hmax || ub + durations[j] <= hmin )
7252 starttimes[njobs] =
MAX(lb, hmin);
7253 startindices[njobs] = j;
7255 endtimes[njobs] =
MIN(ub + durations[j], hmax);
7256 endindices[njobs] = j;
7257 assert(starttimes[njobs] <= endtimes[njobs]);
7266 freecapacity = capacity;
7269 for( j = 0; j < njobs; ++j )
7271 curtime = starttimes[j];
7274 if( curtime >= hmax )
7278 freecapacity -= demands[startindices[j]];
7279 while( j+1 < njobs && starttimes[j+1] == curtime )
7282 freecapacity -= demands[startindices[j]];
7286 while( endtimes[endindex] <= curtime )
7288 freecapacity += demands[endindices[endindex]];
7291 assert(freecapacity <= capacity);
7294 if( freecapacity < 0 && curtime >= hmin )
7296 (*redundant) =
FALSE;
7325 SCIP_Bool* initialized,
7326 SCIP_Bool* explanation,
7333 for( v = 0; v <
nvars; ++v )
7336 SCIP_Bool infeasible;
7350 duration = durations[v];
7353 demand = demands[v];
7361 if( lst + duration <= hmin || est >= hmax )
7365 begin =
MAX(hmin, lst);
7366 end =
MIN(hmax, est + duration);
7372 SCIPdebugMsg(
scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
7386 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
7388 if( explanation !=
NULL )
7389 explanation[v] =
TRUE;
7418 SCIP_Bool* redundant,
7419 SCIP_Bool* initialized,
7420 SCIP_Bool* explanation,
7445 SCIP_CALL_TERMINATE( retcode,
createCoreProfile(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax,
7446 initialized, explanation,
cutoff), TERMINATE );
7451 SCIP_CALL_TERMINATE( retcode,
propagateTimetable(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
7452 nchgbds, initialized, explanation,
cutoff), TERMINATE );
7458 SCIP_CALL_TERMINATE( retcode,
propagateEdgeFinding(
scip, conshdlrdata,
nvars,
vars, durations, demands, capacity, hmin, hmax,
7459 cons, initialized, explanation, nchgbds,
cutoff), TERMINATE );
7465 SCIP_CALL_TERMINATE( retcode,
propagateTTEF(
scip, conshdlrdata, profile,
nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
7466 nchgbds, initialized, explanation,
cutoff), TERMINATE );
7488 SCIP_Bool initialized;
7489 SCIP_Bool redundant;
7498 oldnchgbds = *nchgbds;
7499 initialized =
FALSE;
7513 consdata->nvars, consdata->vars, consdata->durations, consdata->demands, consdata->capacity,
7514 consdata->hmin, consdata->hmax, cons,
7515 nchgbds, &redundant, &initialized,
NULL,
cutoff) );
7519 SCIPdebugMsg(
scip,
"%s deletes cumulative constraint <%s> since it is redundant\n",
7539 if( *
cutoff || *nchgbds > oldnchgbds )
7546 consdata->propagated =
TRUE;
7565 SCIP_Real* leftimpllbs,
7566 SCIP_Real* leftimplubs,
7567 SCIP_Real* leftproplbs,
7568 SCIP_Real* leftpropubs,
7569 SCIP_Real* rightimpllbs,
7570 SCIP_Real* rightimplubs,
7571 SCIP_Real* rightproplbs,
7572 SCIP_Real* rightpropubs,
7579 SCIP_Bool tightened;
7600 leftimpllbs, leftimplubs, leftproplbs, leftpropubs,
cutoff) );
7635 rightimpllbs, rightimplubs, rightproplbs, rightpropubs,
cutoff) );
7659 SCIP_Bool* roundable
7708 SCIP_Bool* roundable
7763 int* alternativelbs,
7764 int* alternativeubs,
7773 for(
c = 0;
c < nconss; ++
c )
7790 assert(consdata->nvars > 1);
7815 hmin = consdata->hmin;
7816 hmax = consdata->hmax;
7822 nvars = consdata->nvars;
7824 for( v = 0; v <
nvars; ++v )
7830 var = consdata->vars[v];
7845 if( consdata->downlocks[v] )
7852 ect = est + consdata->durations[v];
7854 if( ect <= hmin || hmin >= hmax )
7856 else if( est < hmin && alternativelbs[idx] >= (hmin + 1 - constant) / scalar )
7858 alternativelbs[idx] = (hmin + 1 - constant) / scalar;
7864 if( consdata->uplocks[v] )
7870 duration = consdata->durations[v];
7874 lct = lst + duration;
7876 if( lst >= hmax || hmin >= hmax )
7878 else if( lct > hmax && alternativeubs[idx] <= ((hmax - 1 - constant) / scalar) - duration )
7880 alternativeubs[idx] = ((hmax - 1 - constant) / scalar) - duration;
7896 int* alternativelbs,
7897 int* alternativeubs,
7904 SCIP_Real* downimpllbs;
7905 SCIP_Real* downimplubs;
7906 SCIP_Real* downproplbs;
7907 SCIP_Real* downpropubs;
7908 SCIP_Real* upimpllbs;
7909 SCIP_Real* upimplubs;
7910 SCIP_Real* upproplbs;
7911 SCIP_Real* uppropubs;
7924 for( v = 0; v <
nvars; ++v )
7927 SCIP_Bool infeasible;
7929 SCIP_Bool roundable;
7937 if( alternativelbs[v] == INT_MAX && alternativeubs[v] == INT_MIN )
7953 if( alternativelbs[v] > ub )
7975 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7976 nfixedvars, &success,
cutoff) );
7999 if( alternativeubs[v] < lb )
8021 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
8022 nfixedvars, &success,
cutoff) );
8061 int* alternativelbs;
8062 int* alternativeubs;
8071 oldnfixedvars = *nfixedvars;
8080 for( v = 0; v <
nvars; ++v )
8084 alternativelbs[v] = INT_MAX;
8085 alternativeubs[v] = INT_MIN;
8095 if( !(*
cutoff) && oldnfixedvars == *nfixedvars && branched !=
NULL )
8148 nvars = consdata->nvars;
8155 remainingcap = consdata->capacity;
8158 for( j = 0; j <
nvars; ++j )
8165 if( startvalues[j] <= time && ub + consdata->durations[j] > time )
8168 if( startvalues[j] == ub )
8170 remainingcap -= consdata->demands[j];
8174 demands[nflexible] = consdata->demands[j];
8175 flexibleids[nflexible] = j;
8180 assert(remainingcap >= 0);
8196 while( j < nflexible && sumdemand <= remainingcap )
8198 sumdemand += demands[j];
8204 assert(sumdemand > remainingcap);
8205 assert(bigcoversize < nflexible);
8217 for( j = 0; j < nflexible; ++j )
8229 idx = flexibleids[j];
8242 start = time - consdata->durations[idx] + 1;
8243 end =
MIN(time, ub);
8248 if( vals[
b] < start || vals[
b] < lb )
8262 if( consdata->bcoverrowssize == 0 )
8264 consdata->bcoverrowssize = 10;
8267 if( consdata->nbcoverrows == consdata->bcoverrowssize )
8269 consdata->bcoverrowssize *= 2;
8273 consdata->bcoverrows[consdata->nbcoverrows] = row;
8274 consdata->nbcoverrows++;
8284 while( sumdemand <= remainingcap )
8287 sumdemand += demands[j];
8291 smallcoversize = nflexible - (j + 1) - 1;
8292 while( j > 0 && demands[j] == demands[nflexible-1] )
8295 assert(smallcoversize < nflexible);
8297 if( smallcoversize != 1 || smallcoversize != nflexible - (j + 1) - 1 )
8306 for( j = j + 1; j < nflexible; ++j )
8318 idx = flexibleids[j];
8331 start = time - consdata->durations[idx] + 1;
8332 end =
MIN(time, ub);
8337 if( vals[
b] < start || vals[
b] < lb )
8350 if( consdata->scoverrowssize == 0 )
8352 consdata->scoverrowssize = 10;
8355 if( consdata->nscoverrows == consdata->scoverrowssize )
8357 consdata->scoverrowssize *= 2;
8361 consdata->scoverrows[consdata->nscoverrows] = row;
8362 consdata->nscoverrows++;
8383 int* startvaluessorted;
8384 int* endvaluessorted;
8406 if( consdata->vars ==
NULL )
8409 nvars = consdata->nvars;
8410 hmin = consdata->hmin;
8411 hmax = consdata->hmax;
8421 for ( j = 0; j <
nvars; ++j )
8424 startvaluessorted[j] = startvalues[j];
8427 endvaluessorted[j] = endvalues[j];
8429 startindices[j] = j;
8439 freecapacity = consdata->capacity;
8442 for( j = 0; j <
nvars; ++j )
8444 curtime = startvaluessorted[j];
8445 if( curtime >= hmax )
8449 freecapacity -= consdata->demands[startindices[j]];
8451 while( j+1 <
nvars && startvaluessorted[j+1] == curtime )
8454 freecapacity -= consdata->demands[startindices[j]];
8458 while( endidx < nvars && curtime >= endvaluessorted[endidx] )
8460 freecapacity += consdata->demands[endindices[endidx]];
8464 assert(freecapacity <= consdata->capacity);
8474 if( freecapacity < 0 && curtime >= hmin )
8476 int nextprofilechange;
8480 nextprofilechange =
MIN( startvaluessorted[j+1], endvaluessorted[endidx] );
8482 nextprofilechange = endvaluessorted[endidx];
8484 nextprofilechange =
MIN(nextprofilechange, hmax);
8486 for( t = curtime; t < nextprofilechange; ++t )
8496 consdata->covercuts =
TRUE;
8520 SCIP_Bool cutsasconss
8531 assert(nstarted > nfinished);
8535 assert(consdata->nvars > 0);
8537 capacity = consdata->capacity;
8578 if( consdata->demandrowssize == 0 )
8580 consdata->demandrowssize = 10;
8583 if( consdata->ndemandrows == consdata->demandrowssize )
8585 consdata->demandrowssize *= 2;
8589 consdata->demandrows[consdata->ndemandrows] = row;
8590 consdata->ndemandrows++;
8606 SCIP_Bool cutsasconss
8632 nvars = consdata->nvars;
8645 SCIPdebugMsg(
scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
8650 starttimes, endtimes, startindices, endindices,
FALSE);
8653 freecapacity = consdata->capacity;
8654 hmin = consdata->hmin;
8655 hmax = consdata->hmax;
8658 for( j = 0; j <
nvars; ++j )
8660 curtime = starttimes[j];
8663 if( curtime >= hmax )
8672 assert(freecapacity <= consdata->capacity);
8679 if( freecapacity < 0 && curtime >= hmin )
8686 nextstarttime = starttimes[j+1];
8688 nextstarttime = endtimes[
nvars-1];
8690 nextstarttime =
MIN(nextstarttime, hmax);
8697 for( t = curtime+1 ; t < nextstarttime; ++t )
8702 if( freecapacity < 0 )
8737 SCIP_Bool cutsasconss
8745 assert(consdata->ndemandrows == 0);
8748 if( consdata->linkingconss ==
NULL )
8780 SCIP_Bool cutsasconss,
8781 SCIP_Bool* infeasible
8790 if( consdata->demandrows ==
NULL )
8792 assert(consdata->ndemandrows == 0);
8799 for(
r = 0;
r < consdata->ndemandrows && !(*infeasible); ++
r )
8817 SCIP_Bool* separated,
8838 if( consdata->demandrows ==
NULL )
8840 assert(consdata->ndemandrows == 0);
8850 for(
r = 0;
r < consdata->ndemandrows; ++
r )
8854 SCIP_Real feasibility;
8881 (*separated) =
TRUE;
8893 SCIP_Bool* separated,
8899 SCIP_Real minfeasibility;
8916 if( consdata->linkingconss ==
NULL )
8921 if( !consdata->covercuts )
8930 for(
r = 0;
r < consdata->nscoverrows; ++
r )
8934 SCIP_Real feasibility;
8942 if( minfeasibility > feasibility )
8944 minfeasibility = feasibility;
8945 row = consdata->scoverrows[
r];
8954 SCIPdebugMsg(
scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8961 (*separated) =
TRUE;
8968 for(
r = 0;
r < consdata->nbcoverrows; ++
r )
8972 SCIP_Real feasibility;
8980 if( minfeasibility > feasibility )
8982 minfeasibility = feasibility;
8983 row = consdata->bcoverrows[
r];
8992 SCIPdebugMsg(
scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
9000 (*separated) =
TRUE;
9028 assert(nstarted > nfinished);
9032 assert(consdata->nvars > 0);
9054 for( v = 0; v < nstarted - nfinished; ++v )
9079 SCIP_Bool* separated,
9105 nvars = consdata->nvars;
9118 SCIPdebugMsg(
scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
9127 freecapacity = consdata->capacity;
9128 hmin = consdata->hmin;
9129 hmax = consdata->hmax;
9132 for( j = 0; j <
nvars && !(*cutoff); ++j )
9134 curtime = starttimes[j];
9136 if( curtime >= hmax )
9145 assert(freecapacity <= consdata->capacity);
9152 if( freecapacity < 0 && curtime >= hmin)
9198 nvars = consdata->nvars;
9205 capacity = consdata->capacity;
9208 for ( j = 0; j <
nvars; ++j )
9210 if( consdata->demands[j] > capacity )
9238 if( consdata->nvars == 0 )
9245 else if( consdata->nvars == 1 )
9247 if( consdata->demands[0] > consdata->capacity )
9286 hmin = consdata->hmin;
9287 hmax = consdata->hmax;
9289 SCIPdebugMsg(
scip,
"check for irrelevant jobs within cumulative constraint <%s>[%d,%d)\n",
9292 for( j = consdata->nvars-1; j >= 0; --j )
9294 var = consdata->vars[j];
9295 demand = consdata->demands[j];
9296 duration = consdata->durations[j];
9302 if( demand == 0 || duration == 0 )
9311 else if( est >= hmax || lct <= hmin )
9339 SCIP_Bool tightened;
9347 assert(consdata->durations[pos] > 0);
9348 assert(consdata->demands[pos] > 0);
9350 var = consdata->vars[pos];
9352 duration = consdata->durations[pos];
9355 SCIPdebugMsg(
scip,
" variable <%s>: demand <%d> is larger than the capacity <%d>\n",
9363 if( ect - duration >= consdata->hmax || lst + duration <= consdata->hmin)
9366 if( ect > consdata->hmin && lst < consdata->hmax )
9371 else if( lst < consdata->hmax )
9379 else if( ect > consdata->hmin )
9398 SCIP_Real boundtuple[2];
9404 leftbound = consdata->hmin - duration;
9405 rightbound = consdata->hmax;
9455 capacity = consdata->capacity;
9457 for( j = consdata->nvars-1; j >= 0 && !(*cutoff); --j )
9459 if( consdata->demands[j] > capacity )
9483 SCIP_Bool infeasible;
9484 SCIP_Bool tightened;
9485 SCIP_Bool roundable;
9535 SCIP_Bool infeasible;
9536 SCIP_Bool tightened;
9537 SCIP_Bool roundable;
9589 if( *capacity == 1 ||
nvars <= 1 )
9599 for( v =
nvars-2; v >= 0 && (gcd >= 2 || mindemand1 + mindemand2 > *capacity); --v )
9601 assert(mindemand1 <= mindemand2);
9602 assert(demands[v] <= *capacity);
9606 if( mindemand1 > demands[v] )
9608 mindemand2 = mindemand1;
9609 mindemand1 = demands[v];
9611 else if( mindemand2 > demands[v] )
9612 mindemand2 = demands[v];
9615 if( mindemand1 + mindemand2 > *capacity )
9617 SCIPdebugMsg(
scip,
"update cumulative condition (%d + %d > %d) to unary cumulative condition\n", mindemand1, mindemand2, *capacity);
9619 for( v = 0; v <
nvars; ++v )
9624 (*nchgcoefs) +=
nvars;
9631 for( v = 0; v <
nvars; ++v )
9632 demands[v] /= (
int) gcd;
9634 (*capacity) /= (int) gcd;
9636 (*nchgcoefs) +=
nvars;
9663 if( consdata->normalized )
9666 capacity = consdata->capacity;
9672 consdata->normalized =
TRUE;
9674 if( capacity > consdata->capacity )
9675 consdata->varbounds =
FALSE;
9731 for( t = 0; t < ntimepoints; ++t )
9734 if( timepoints[t] <= *hmin )
9738 if( timepoints[t] >= *hmax )
9744 if( loads[t] <= capacity )
9746 (*split) = timepoints[t];
9782 SCIP_Bool modifiable,
9788 SCIP_Bool removable,
9790 SCIP_Bool stickingatnode
9799 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
9830 if( consdata->nvars <= 1 )
9834 consdata->durations, consdata->demands, consdata->capacity, &hmin, &hmax, &split) );
9837 if( consdata->hmin < hmin )
9841 consdata->hmin = hmin;
9846 if( consdata->hmax > hmax )
9849 consdata->hmax = hmax;
9854 if( consdata->hmax <= consdata->hmin )
9856 SCIPdebugMsg(
scip,
"constraint <%s> is redundant since hmax(%d) <= hmin(%d)\n",
9862 else if( consdata->hmin < split && split < consdata->hmax )
9867 SCIPdebugMsg(
scip,
"split cumulative constraint <%s>[%d,%d) with %d jobs at time point %d\n",
9868 SCIPconsGetName(cons), consdata->hmin, consdata->hmax, consdata->nvars, split);
9870 assert(split < consdata->hmax);
9874 consdata->durations, consdata->demands, consdata->capacity, split, consdata->hmax,
9879 consdata->hmax = split;
9881 assert(consdata->hmin < consdata->hmax);
9925 SCIP_Bool* downlocks,
9928 SCIP_Bool* irrelevants,
9934 SCIP_Real* downimpllbs;
9935 SCIP_Real* downimplubs;
9936 SCIP_Real* downproplbs;
9937 SCIP_Real* downpropubs;
9938 SCIP_Real* upimpllbs;
9939 SCIP_Real* upimplubs;
9940 SCIP_Real* upproplbs;
9941 SCIP_Real* uppropubs;
9961 SCIPdebugMsg(
scip,
"check for irrelevant variable for cumulative condition (hmin %d) w.r.t. earlier start time\n", hmin);
9963 firstminect = INT_MAX;
9964 secondminect = INT_MAX;
9967 for( v = 0; v <
nvars; ++v )
9973 if( ect < firstminect )
9975 secondminect = firstminect;
9978 else if( ect < secondminect )
9983 for( v = 0; v <
nvars; ++v )
9998 duration = durations[v];
10005 ect = est + duration;
10007 lct = lst + duration;
10010 if( ect == firstminect )
10011 minect = secondminect;
10013 minect = firstminect;
10016 alternativelb =
MAX(hmin+1, minect);
10017 alternativelb =
MIN(alternativelb, hmax);
10024 SCIPdebugMsg(
scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
10028 irrelevants[v] =
TRUE;
10051 SCIPdebugMsg(
scip,
" variables <%s>[%d,%d] (duration <%d>) is irrelevant due to no up lock\n",
10055 irrelevants[v] =
TRUE;
10063 SCIPdebugMsg(
scip,
" remove down lock of variable <%s>[%g,%g] with duration <%d>\n",
10067 downlocks[v] =
FALSE;
10074 else if( ect <= hmin )
10092 SCIPdebugMsg(
scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt EST\n",
10099 irrelevants[v] =
TRUE;
10116 SCIP_Bool roundable;
10122 if( alternativelb > lst )
10124 SCIP_Bool infeasible;
10147 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10148 nfixedvars, &success,
cutoff) );
10159 SCIPdebugMsg(
scip,
"********* check variable <%s>[%g,%g] with duration <%d> (hmin %d)\n",
10210 SCIP_Bool* downlocks,
10211 SCIP_Bool* uplocks,
10213 SCIP_Bool* irrelevants,
10219 SCIP_Real* downimpllbs;
10220 SCIP_Real* downimplubs;
10221 SCIP_Real* downproplbs;
10222 SCIP_Real* downpropubs;
10223 SCIP_Real* upimpllbs;
10224 SCIP_Real* upimplubs;
10225 SCIP_Real* upproplbs;
10226 SCIP_Real* uppropubs;
10246 SCIPdebugMsg(
scip,
"check for irrelevant variable for cumulative condition (hmax %d) w.r.t. latest completion time\n", hmax);
10248 firstmaxlst = INT_MIN;
10249 secondmaxlst = INT_MIN;
10252 for( v = 0; v <
nvars; ++v )
10258 if( lst > firstmaxlst )
10260 secondmaxlst = firstmaxlst;
10263 else if( lst > secondmaxlst )
10264 secondmaxlst = lst;
10268 for( v = 0; v <
nvars; ++v )
10282 duration = durations[v];
10289 ect = est + duration;
10293 if( lst == firstmaxlst )
10294 maxlst = secondmaxlst;
10296 maxlst = firstmaxlst;
10299 alternativeub =
MIN(hmax - 1, maxlst) - duration;
10300 alternativeub =
MAX(alternativeub, hmin);
10307 SCIPdebugMsg(
scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
10311 irrelevants[v] =
TRUE;
10325 if( !downlocks[v] )
10331 SCIPdebugMsg(
scip,
" variables <%s>[%d,%d] with duration <%d> is irrelevant due to no down lock\n",
10335 irrelevants[v] =
TRUE;
10343 SCIPdebugMsg(
scip,
" remove up lock of variable <%s>[%g,%g] with duration <%d>\n",
10347 uplocks[v] =
FALSE;
10354 else if( lst >= hmax )
10372 SCIPdebugMsg(
scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt LCT\n",
10379 irrelevants[v] =
TRUE;
10396 SCIP_Bool roundable;
10402 if( alternativeub < est )
10404 SCIP_Bool infeasible;
10427 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10428 nfixedvars, &success,
cutoff) );
10465 SCIP_Bool* irrelevants;
10476 nvars = consdata->nvars;
10486 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10487 irrelevants, nfixedvars, nchgsides,
cutoff) );
10491 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10492 irrelevants, nfixedvars, nchgsides,
cutoff) );
10497 for( v =
nvars-1; v >= 0; --v )
10499 if( irrelevants[v] )
10505 var = consdata->vars[v];
10512 if( lst <= consdata->hmin && ect >= consdata->hmax )
10514 if( consdata->capacity < consdata->demands[v] )
10520 consdata->capacity -= consdata->demands[v];
10521 consdata->varbounds =
FALSE;
10543 SCIP_Longint** demands,
10554 startindex = nstarted - 1;
10559 while( nstarted - nfinished > ncountedvars )
10566 varidx = startindices[startindex];
10575 if( endtime > curtime )
10577 if( consdata->demands[
varidx] < consdata->capacity )
10579 (*demands)[*ndemands] = consdata->demands[
varidx];
10604 SCIP_Longint* demands;
10605 SCIP_Real* profits;
10611 assert(nstarted > nfinished);
10615 assert(consdata->nvars > 0);
10616 assert(consdata->capacity > 0);
10622 collectDemands(
scip, consdata, startindices, curtime, nstarted, nfinished, &demands, &ndemands);
10627 for( j = 0; j < ndemands; ++j )
10683 nvars = consdata->nvars;
10691 SCIPdebugMsg(
scip,
"try to tighten capacity for cumulative constraint <%s> with capacity %d\n",
10701 starttimes, endtimes, startindices, endindices,
FALSE);
10705 freecapacity = consdata->capacity;
10708 for( j = 0; j <
nvars && bestcapacity < consdata->capacity; ++j )
10710 curtime = starttimes[j];
10719 assert(freecapacity <= consdata->capacity);
10726 if( freecapacity < 0 )
10736 bestcapacity =
MAX(bestcapacity, newcapacity);
10737 SCIPdebugMsg(
scip,
"after highest cap usage: bestcapacity = %d\n", bestcapacity);
10741 if( freecapacity > 0 && freecapacity != consdata->capacity )
10743 bestcapacity =
MAX(bestcapacity, consdata->capacity - freecapacity);
10744 SCIPdebugMsg(
scip,
"after peak < cap: bestcapacity = %d\n", bestcapacity);
10748 if( freecapacity == 0 && consdata->demands[startindices[j]] < consdata->capacity)
10751 SCIPdebugMsg(
scip,
"--> cannot decrease capacity since sum equals capacity\n");
10752 bestcapacity = consdata->capacity;
10764 if( bestcapacity < consdata->capacity )
10766 SCIPdebug(
int oldnchgcoefs = *nchgcoefs; )
10768 SCIPdebugMsg(
scip,
"+-+-+-+-+-+ --> CHANGE capacity of cons<%s> from %d to %d\n",
10771 for( j = 0; j <
nvars; ++j )
10773 if( consdata->demands[j] == consdata->capacity )
10775 consdata->demands[j] = bestcapacity;
10780 consdata->capacity = bestcapacity;
10785 consdata->varbounds =
FALSE;
10816 nvars = consdata->nvars;
10817 oldnchgcoefs = *nchgcoefs;
10826 mindemand = consdata->demands[0];
10827 for( j = 0; j <
nvars; ++j )
10829 mindemand =
MIN(mindemand, consdata->demands[j]);
10833 for( j = 0; j <
nvars; ++j )
10835 if( mindemand + consdata->demands[j] > consdata->capacity && consdata->demands[j] < consdata->capacity )
10838 consdata->demands[j], consdata->capacity);
10839 consdata->demands[j] = consdata->capacity;
10848 for( j = 0; j <
nvars; ++j )
10855 assert(consdata->demands[j] <= consdata->capacity);
10857 if( consdata->demands[j] == consdata->capacity )
10876 if( est_i >= lct_j || est_j >= lct_i )
10879 if( consdata->demands[j] + consdata->demands[
i] <= consdata->capacity )
10889 consdata->demands[j], consdata->capacity);
10890 consdata->demands[j] = consdata->capacity;
10895 if( (*nchgcoefs) > oldnchgcoefs )
10897 SCIPdebugMsg(
scip,
"+-+-+-+-+-+changed %d coefficients of variables of cumulative constraint<%s>\n",
10922 nvars = consdata->nvars;
10925 hmin = consdata->hmin;
10926 hmax = consdata->hmax;
10929 for( v = 0; v <
nvars; ++v )
10938 var = consdata->vars[v];
10941 duration = consdata->durations[v];
10944 ect = est + duration;
10946 lct = lst + duration;
10949 assert(lst > hmin || ect < hmax);
10951 if( lst <= hmin && est < hmin - lct +
MIN(hmin, ect) )
10955 SCIP_Bool infeasible;
10956 SCIP_Bool redundant;
10957 SCIP_Bool aggregated;
10960 shift = est - (hmin - lct +
MIN(hmin, ect));
10963 duration = hmin - lct;
10979 consdata->durations[v] = duration;
10980 consdata->vars[v] = aggrvar;
11017 capacity = consdata->capacity;
11019 if( capacity == 1 )
11026 halfcapacity = capacity / 2;
11027 mindemand = consdata->capacity;
11031 for( v = 0; v < consdata->nvars; ++v )
11033 if( consdata->demands[v] > halfcapacity )
11036 demands[
nvars] = 1;
11037 durations[
nvars] = consdata->durations[v];
11040 mindemand =
MIN(mindemand, consdata->demands[v]);
11049 for( v = 0; v < consdata->nvars; ++v )
11051 if( consdata->demands[v] > halfcapacity )
11054 if( mindemand + consdata->demands[v] > capacity )
11056 demands[
nvars] = 1;
11057 durations[
nvars] = consdata->durations[v];
11096 SCIP_Bool* unbounded
11134 if( conshdlrdata->normalize )
11146 if( conshdlrdata->coeftightening )
11170struct TCLIQUE_Graph
11174 SCIP_Bool** precedencematrix;
11175 SCIP_Bool** demandmatrix;
11190 return tcliquegraph->nnodes;
11199 return tcliquegraph->weights;
11211 if( tcliquegraph->precedencematrix[node1][node2] || tcliquegraph->precedencematrix[node2][node1] )
11215 if( tcliquegraph->demandmatrix[node1][node2] )
11240 assert(0 <= nodes[
i] && nodes[
i] < tcliquegraph->nnodes);
11241 assert(
i == 0 || nodes[
i-1] < nodes[
i]);
11244 if( tcliqueIsedgeClique(tcliquegraph, node, nodes[
i]) )
11247 adjnodes[nadjnodes] = nodes[
i];
11276 nnodes = tcliquegraph->nnodes;
11280 for( j = 0; j <
nnodes; ++j )
11301 SCIP_Real vlbconst,
11317 bound = (duration - vlbcoef) / (vlbcoef - 1.0);
11356 SCIP_Real vubconst,
11361 SCIP_Real vlbconst;
11364 vlbcoef = 1.0 / vubcoef;
11365 vlbconst = -vubconst / vubcoef;
11397 if( tcliquegraph->size == tcliquegraph->nnodes )
11402 tcliquegraph->size = size;
11410 for( v = 0; v < tcliquegraph->nnodes; ++v )
11416 assert(tcliquegraph->nnodes < tcliquegraph->size);
11418 pos = tcliquegraph->nnodes;
11421 tcliquegraph->durations[pos] = 0;
11422 tcliquegraph->weights[pos] = 0;
11423 tcliquegraph->vars[pos] =
var;
11433 tcliquegraph->nnodes++;
11435 for( v = 0; v < tcliquegraph->nnodes; ++v )
11437 tcliquegraph->precedencematrix[v][pos] = 0;
11438 tcliquegraph->demandmatrix[v][pos] = 0;
11441 (*idx) = tcliquegraph->nnodes;
11478 for( v = 0; v <
nvars; ++v )
11482 SCIP_Real* vbdcoefs;
11483 SCIP_Real* vbdconsts;
11494 if( tcliquegraph->durations[idx1] == 0 )
11502 for(
b = 0;
b < nvbdvars; ++
b )
11509 if( tcliquegraph->durations[idx2] == 0 )
11513 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11521 for(
b = 0;
b < nvbdvars; ++
b )
11528 if( tcliquegraph->durations[idx2] == 0 )
11532 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11542 if( tcliquegraph->durations[idx2] == 0 )
11547 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11551 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11561 SCIP_Bool** adjmatrix,
11573 for( j = 0; j <
nnodes; ++j )
11575 if( adjmatrix[
i][j] )
11580 for( k = 0; k <
nnodes; ++k )
11582 if( adjmatrix[j][k] )
11583 adjmatrix[
i][k] =
TRUE;
11602 for(
c = 0;
c < nconss; ++
c )
11614 vars = consdata->vars;
11615 demands = consdata->demands;
11617 nvars = consdata->nvars;
11618 capacity = consdata->capacity;
11631 if( tcliquegraph->durations[idx1] == 0 || tcliquegraph->durations[idx1] > consdata->durations[
i] )
11634 for( j =
i+1; j <
nvars; ++j )
11636 assert(consdata->durations[j] > 0);
11638 if( demands[
i] + demands[j] > capacity )
11651 if( est1 < consdata->hmin && est2 < consdata->hmin )
11658 if( lct1 > consdata->hmax && lct2 > consdata->hmax )
11665 if( tcliquegraph->durations[idx2] == 0 || tcliquegraph->durations[idx2] > consdata->durations[j] )
11670 assert(tcliquegraph->durations[idx1] > 0);
11671 assert(tcliquegraph->durations[idx2] > 0);
11673 tcliquegraph->demandmatrix[idx1][idx2] =
TRUE;
11674 tcliquegraph->demandmatrix[idx2][idx1] =
TRUE;
11701 transitiveClosure(tcliquegraph->precedencematrix, tcliquegraph->ninarcs, tcliquegraph->noutarcs, tcliquegraph->nnodes);
11732 for( v = 0; v < ncliquenodes; ++v )
11734 durations[v] = tcliquegraph->durations[cliquenodes[v]];
11735 assert(durations[v] > 0);
11737 vars[v] = tcliquegraph->vars[cliquenodes[v]];
11764 SCIP_Bool* precedencerow;
11765 SCIP_Bool* precedencecol;
11766 SCIP_Bool* demandrow;
11767 SCIP_Bool* demandcol;
11777 nnodes = tcliquegraph->nnodes;
11781 for( v = 0; v <
nnodes; ++v )
11783 tcliquegraph->weights[v] = tcliquegraph->durations[v];
11794 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
11803 if( tcliquegraph->durations[v] == 0 )
11815 precedencerow[
c] = tcliquegraph->precedencematrix[v][
c];
11816 precedencecol[
c] = tcliquegraph->precedencematrix[
c][v];
11818 demandrow[
c] = tcliquegraph->demandmatrix[v][
c];
11819 demandcol[
c] = tcliquegraph->demandmatrix[
c][v];
11822 if( precedencerow[
c] || precedencecol[
c] )
11824 tcliquegraph->demandmatrix[v][
c] =
FALSE;
11825 tcliquegraph->demandmatrix[
c][v] =
FALSE;
11829 tcliquegraph->precedencematrix[
c][v] =
FALSE;
11830 tcliquegraph->precedencematrix[v][
c] =
FALSE;
11834 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11835 tcliquegraph, tcliqueNewsolClique,
NULL,
11836 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11837 10000, 1000, 1000, v, &ntreenodes, &tcliquestatus);
11839 SCIPdebugMsg(
scip,
"tree nodes %d clique size %d (weight %d, status %d)\n", ntreenodes, ncliquenodes, cliqueweight, tcliquestatus);
11841 if( ncliquenodes == 1 )
11851 for(
c = 0;
c < ncliquenodes; ++
c )
11859 tcliquegraph->precedencematrix[v][
c] = precedencerow[
c];
11860 tcliquegraph->precedencematrix[
c][v] = precedencecol[
c];
11862 tcliquegraph->demandmatrix[v][
c] = demandrow[
c];
11863 tcliquegraph->demandmatrix[
c][v] = demandcol[
c];
11875 (*naddconss) += nconss;
11931 if( !tcliquegraph->precedencematrix[source][sink] )
11934 nnodes = tcliquegraph->nnodes;
11935 vars = tcliquegraph->vars;
11953 duration = tcliquegraph->durations[
i];
11955 if(
i == source ||
i == sink )
11958 tcliquegraph->weights[
i] = 0;
11960 else if( tcliquegraph->precedencematrix[source][
i] && tcliquegraph->precedencematrix[
i][sink] )
11963 tcliquegraph->weights[
i] = duration;
11969 tcliquegraph->weights[
i] = duration;
11972 tcliquegraph->weights[
i] = 0;
11978 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11979 tcliquegraph, tcliqueNewsolClique,
NULL,
11980 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11981 10000, 1000, 1000, -1, &ntreenodes, &tcliquestatus);
11983 if( ncliquenodes > 1 )
11994 distance = cliqueweight + tcliquegraph->durations[source];
12025 nnodes = tcliquegraph->nnodes;
12037 if( tcliquegraph->ninarcs[
i] == 0 )
12039 sources[nsources] =
i;
12043 if( tcliquegraph->ninarcs[
i] == 0 )
12066 (*naddconss) += nconss;
12089 for(
c = 0;
c < nconss; ++
c )
12099 vars = consdata->vars;
12100 nvars = consdata->nvars;
12102 for( v = 0; v <
nvars; ++v )
12113 tcliquegraph->durations[idx] =
MAX(tcliquegraph->durations[idx], consdata->durations[v]);
12114 assert(tcliquegraph->durations[idx] > 0);
12130 SCIP_Bool** precedencematrix;
12131 SCIP_Bool** demandmatrix;
12171 for( v = 0; v <
nvars; ++v )
12189 (*tcliquegraph)->nnodes =
nvars;
12190 (*tcliquegraph)->varmap = varmap;
12191 (*tcliquegraph)->precedencematrix = precedencematrix;
12192 (*tcliquegraph)->demandmatrix = demandmatrix;
12193 (*tcliquegraph)->weights = weights;
12194 (*tcliquegraph)->ninarcs = ninarcs;
12195 (*tcliquegraph)->noutarcs = noutarcs;
12196 (*tcliquegraph)->durations = durations;
12197 (*tcliquegraph)->size =
nvars;
12211 for( v = (*tcliquegraph)->nnodes-1; v >= 0; --v )
12253 if( conshdlrdata->detectvarbounds )
12259 if( conshdlrdata->detectdisjunctive )
12280 if( consdata->validsignature )
12283 vars = consdata->vars;
12284 nvars = consdata->nvars;
12286 for( v = 0; v <
nvars; ++v )
12288 consdata->signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(
vars[v]) % (
sizeof(
unsigned int) * 8)));
12291 consdata->validsignature =
TRUE;
12304 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
12319 for(
i = 0;
i < nconss; ++
i )
12331 assert(consdata0->validsignature);
12333 for( j =
i+1; j < nconss; ++j )
12344 if( consdata0->capacity != consdata1->capacity )
12348 assert(consdata1->validsignature);
12350 if( (consdata1->signature & (~consdata0->signature)) == 0 )
12354 assert((consdata0->signature & (~consdata1->signature)) == 0);
12357 if( (consdata0->signature & (~consdata1->signature)) == 0 )
12364 if( consdata0->nvars > consdata1->nvars )
12367 if( consdata0->hmin < consdata1->hmin )
12370 if( consdata0->hmax > consdata1->hmax )
12377 SCIPsort(perm0, consdataCompVar, (
void*)consdata0, consdata0->nvars);
12378 SCIPsort(perm1, consdataCompVar, (
void*)consdata1, consdata1->nvars);
12380 for( v0 = 0, v1 = 0; v0 < consdata0->nvars && v1 < consdata1->nvars; )
12391 var0 = consdata0->vars[idx0];
12393 var1 = consdata1->vars[idx1];
12404 demand0 = consdata0->demands[idx0];
12405 duration0 = consdata0->durations[idx0];
12407 demand1 = consdata1->demands[idx1];
12408 duration1 = consdata1->durations[idx1];
12410 if( demand0 != demand1 )
12413 if( duration0 != duration1 )
12419 else if( comp > 0 )
12425 if( v0 == consdata0->nvars )
12470 if( consdata->varbounds )
12473 vars = consdata->vars;
12474 durations = consdata->durations;
12475 demands = consdata->demands;
12476 capacity = consdata->capacity;
12477 nvars = consdata->nvars;
12485 SCIP_Real* vbdcoefs;
12486 SCIP_Real* vbdconsts;
12491 var = consdata->vars[
i];
12499 for(
b = 0;
b < nvbdvars; ++
b )
12505 for( j = 0; j <
nvars; ++j )
12507 if(
vars[j] == vbdvars[
b] )
12515 SCIP_Bool infeasible;
12530 (*nchgbds) += nlocalbdchgs;
12537 (*naddconss) += nconss;
12539 consdata->varbounds =
TRUE;
12553 SCIP_Bool solinfeasible,
12564 if( solinfeasible )
12570 SCIPdebugMsg(
scip,
"constraint enforcing %d useful cumulative constraints of %d constraints for %s solution\n", nusefulconss, nconss,
12571 sol ==
NULL ?
"LP" :
"relaxation");
12578 if( conshdlrdata->usebinvars )
12580 SCIP_Bool separated;
12587 for(
c = 0;
c < nusefulconss; ++
c )
12590 SCIP_Bool violated;
12608 for( ;
c < nconss && !separated; ++
c )
12611 SCIP_Bool violated;
12678#ifdef SCIP_STATISTIC
12679 if( !conshdlrdata->iscopy )
12683 conshdlrdata->nlbtimetable, conshdlrdata->nubtimetable, conshdlrdata->ncutofftimetable);
12685 conshdlrdata->nlbedgefinder, conshdlrdata->nubedgefinder, conshdlrdata->ncutoffedgefinder);
12687 conshdlrdata->ncutoffoverload, conshdlrdata->ncutoffoverloadTTEF);
12709 conshdlrdata->detectedredundant =
FALSE;
12711 for(
c = 0;
c < nconss; ++
c )
12724#ifdef SCIP_STATISTIC
12734 for(
c = 0;
c < nconss; ++
c )
12743 if( !conshdlrdata->iscopy )
12745 SCIPstatisticPrintf(
"@11 added variables bounds constraints %d\n", conshdlrdata->naddedvarbounds);
12746 SCIPstatisticPrintf(
"@22 added disjunctive constraints %d\n", conshdlrdata->naddeddisjunctives);
12772 for(
c = 0;
c < nconss; ++
c )
12836 sourcedata->durations, sourcedata->demands, sourcedata->nvars, sourcedata->capacity,
12864 *infeasible =
FALSE;
12866 SCIPdebugMsg(
scip,
"initialize LP relaxation for %d cumulative constraints\n", nconss);
12868 if( conshdlrdata->usebinvars )
12871 for(
c = 0;
c < nconss && !(*infeasible); ++
c )
12876 if( conshdlrdata->cutsasconss )
12895 SCIP_Bool separated;
12907 SCIPdebugMsg(
scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12918 if( conshdlrdata->usebinvars )
12921 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
12926 if( !
cutoff && conshdlrdata->usecovercuts )
12928 for(
c = 0;
c < nusefulconss; ++
c )
12935 if( conshdlrdata->sepaold )
12938 for(
c = 0;
c < nusefulconss; ++
c )
12947 else if( separated )
12959 SCIP_Bool separated;
12973 SCIPdebugMsg(
scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12979 if( conshdlrdata->usebinvars )
12982 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
12987 if( !
cutoff && conshdlrdata->usecovercuts )
12989 for(
c = 0;
c < nusefulconss; ++
c )
12995 if( conshdlrdata->sepaold )
12998 for(
c = 0;
c < nusefulconss; ++
c )
13007 else if( separated )
13044 if( objinfeasible )
13077 SCIP_Bool violated =
FALSE;
13101 SCIPdebugMsg(
scip,
"propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss);
13117 for(
c = 0;
c < nusefulconss && !
cutoff; ++
c )
13128 &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &
cutoff, &
cutoff) );
13131 &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &
cutoff, &
cutoff) );
13143 if( !
cutoff && nchgbds == 0 )
13146 for(
c = nusefulconss;
c < nconss && !
cutoff; ++
c )
13164 else if( nchgbds > 0 )
13166 SCIPdebugMsg(
scip,
"delete (locally) %d constraints and changed %d variable bounds\n", ndelconss, nchgbds);
13182 SCIP_Bool unbounded;
13204 oldnfixedvars = *nfixedvars;
13205 oldnchgbds = *nchgbds;
13206 oldnchgsides = *nchgsides;
13207 oldnchgcoefs = *nchgcoefs;
13208 oldnupgdconss = *nupgdconss;
13209 oldndelconss = *ndelconss;
13210 oldnaddconss = *naddconss;
13215 for(
c = 0;
c < nconss && !
cutoff; ++
c )
13228 nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &
cutoff, &unbounded) );
13231 nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &
cutoff, &unbounded) );
13234 if(
cutoff || unbounded )
13242 if( nrounds == 1 &&
SCIPgetNRuns(
scip) == 1 && conshdlrdata->disjunctive )
13265 && (conshdlrdata->detectvarbounds || conshdlrdata->detectdisjunctive)
13272 conshdlrdata->detectedredundant =
TRUE;
13280 SCIPdebugMsg(
scip,
"delete %d constraints and changed %d variable bounds (cutoff %u)\n",
13281 *ndelconss - oldndelconss, *nchgbds - oldnchgbds,
cutoff);
13285 else if( unbounded )
13287 else if( *nchgbds > oldnchgbds || *nfixedvars > oldnfixedvars || *nchgsides > oldnchgsides
13288 || *nchgcoefs > oldnchgcoefs || *nupgdconss > oldnupgdconss || *ndelconss > oldndelconss || *naddconss > oldnaddconss )
13319 SCIPdebugMsg(
scip,
"resolve propagation: variable <%s>, cumulative constraint <%s> (capacity %d, propagation %d, H=[%d,%d))\n",
13324 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
13325 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, conshdlrdata->usebdwidening,
NULL,
result) );
13347 vars = consdata->vars;
13350 for( v = 0; v < consdata->nvars; ++v )
13352 if( consdata->downlocks[v] && consdata->uplocks[v] )
13357 else if( consdata->downlocks[v] )
13361 else if( consdata->uplocks[v] )
13391 const char* consname;
13400 nvars = sourceconsdata->nvars;
13401 sourcevars = sourceconsdata->vars;
13427 sourceconsdata->durations, sourceconsdata->demands, sourceconsdata->capacity,
13428 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
13431 if( sourceconsdata->hmin > 0 )
13437 if( sourceconsdata->hmax < INT_MAX )
13491 endptr = strchr(endptr,
')');
13493 if( endptr ==
NULL )
13503 duration = atoi(strvalue);
13507 demand = atoi(strvalue);
13513 demands[
nvars] = demand;
13514 durations[
nvars] = duration;
13517 while( *str !=
')' );
13523 hmin = atoi(strvalue);
13528 hmax = (int)(value);
13536 capacity = (int)value;
13540 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
13566 if( varssize < consdata->
nvars )
13567 (*success) =
FALSE;
13588 (*nvars) = consdata->nvars;
13618 consdata->propagated =
FALSE;
13647 consEnfolpCumulative, consEnfopsCumulative, consCheckCumulative, consLockCumulative,
13655#ifdef SCIP_STATISTIC
13679 "should time-table (core-times) propagator be used to infer bounds?",
13683 "should edge-finding be used to detect an overload?",
13687 "should edge-finding be used to infer bounds?",
13690 "constraints/" CONSHDLR_NAME "/useadjustedjobs",
"should edge-finding be executed?",
13694 "should time-table edge-finding be used to detect an overload?",
13698 "should time-table edge-finding be used to infer bounds?",
13702 "constraints/" CONSHDLR_NAME "/usebinvars",
"should the binary representation be used?",
13705 "constraints/" CONSHDLR_NAME "/localcuts",
"should cuts be added only locally?",
13708 "constraints/" CONSHDLR_NAME "/usecovercuts",
"should covering cuts be added every node?",
13712 "should the cumulative constraint create cuts as knapsack constraints?",
13716 "shall old sepa algo be applied?",
13720 "constraints/" CONSHDLR_NAME "/fillbranchcands",
"should branching candidates be added to storage?",
13725 "constraints/" CONSHDLR_NAME "/dualpresolve",
"should dual presolving be applied?",
13728 "constraints/" CONSHDLR_NAME "/coeftightening",
"should coefficient tightening be applied?",
13731 "constraints/" CONSHDLR_NAME "/normalize",
"should demands and capacity be normalized?",
13735 "should pairwise constraint comparison be performed in presolving?",
13738 "constraints/" CONSHDLR_NAME "/disjunctive",
"extract disjunctive constraints?",
13743 "number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit)?",
13746 "constraints/" CONSHDLR_NAME "/detectdisjunctive",
"search for conflict set via maximal cliques to detect disjunctive constraints",
13749 "constraints/" CONSHDLR_NAME "/detectvarbounds",
"search for conflict set via maximal cliques to detect variable bound constraints",
13754 "constraints/" CONSHDLR_NAME "/usebdwidening",
"should bound widening be used during the conflict analysis?",
13772 SCIP_Bool separate,
13782 SCIP_Bool modifiable,
13788 SCIP_Bool removable,
13790 SCIP_Bool stickingatnode
13802 if( conshdlr ==
NULL )
13811 SCIP_CALL(
consdataCreate(
scip, &consdata,
vars,
NULL, durations, demands,
nvars, capacity, 0, INT_MAX, check) );
13815 initial, separate, enforce, check,
propagate,
13816 local, modifiable, dynamic, removable, stickingatnode) );
13878 assert(hmin <= consdata->hmax);
13880 consdata->hmin = hmin;
13902 return consdata->hmin;
13922 assert(hmax >= consdata->hmin);
13924 consdata->hmax = hmax;
13946 return consdata->hmax;
13967 return consdata->vars;
13988 return consdata->nvars;
14009 return consdata->capacity;
14030 return consdata->durations;
14051 return consdata->demands;
14067 SCIP_Bool* violated,
14069 SCIP_Bool printreason
14076 violated, cons, printreason) );
14112 hmin, hmax, split) );
14125 SCIP_Bool* downlocks,
14126 SCIP_Bool* uplocks,
14128 SCIP_Bool* irrelevants,
14139 irrelevants, nfixedvars, nchgsides,
cutoff) );
14143 irrelevants, nfixedvars, nchgsides,
cutoff) );
14161 SCIP_Bool* initialized,
14162 SCIP_Bool* explanation,
14168 SCIP_Bool redundant;
14179 if( conshdlr ==
NULL )
14191 nvars,
vars, durations, demands, capacity, hmin, hmax, cons,
14192 nchgbds, &redundant, initialized, explanation,
cutoff) );
14211 SCIP_Real relaxedbd,
14212 SCIP_Bool* explanation,
14240 file = fopen(filename,
"w");
14253 nvars = consdata->nvars;
14256 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL), TERMINATE );
14261 for( v = 0; v <
nvars; ++v )
14265 var = consdata->vars[v];
14272 else if( !consdata->downlocks[v] || !consdata->uplocks[v] )
14280 for( v = 0; v <
nvars; ++v )
14286 var = consdata->vars[v];
14292 for(
b = 0;
b < nvbdvars; ++
b )
14304 for(
b = 0;
b < nvbdvars; ++
b )
14336 if( conshdlr ==
NULL )
14361 SCIP_Real* objvals,
14367 SCIP_Real timelimit,
14368 SCIP_Real memorylimit,
14369 SCIP_Longint maxnodes,
14371 SCIP_Bool* infeasible,
14372 SCIP_Bool* unbounded,
14380 (*infeasible) =
FALSE;
14381 (*unbounded) =
FALSE;
14389 if( conshdlr ==
NULL )
14400 if( timelimit > 0.0 && memorylimit > 10 )
14402 SCIP_CALL( conshdlrdata->solveCumulative(njobs, ests, lsts, objvals, durations, demands, capacity,
14403 hmin, hmax, timelimit, memorylimit, maxnodes, solved, infeasible, unbounded, error) );
14439 for( v = 0; v <
nvars; ++v )
14441 copydemands[v] = demands[v];
14447 for( v = 0; v <
nvars; ++v )
14457 duration = durations[idx];
14466 if( impliedest < impliedlct )
14468 SCIP_Bool infeasible;
14476 if( est == impliedest && lct == impliedlct )
14507 for( t = 0; t < ntimepoints - 1; ++t )
14510 if( loads[t] > capacity )
14512 assert(t == 0 || loads[t-1] <= capacity);
14513 return timepoints[t];
14537 for( t = ntimepoints - 1; t >= 0; --t )
14540 if( loads[t] > capacity )
14542 assert(t == ntimepoints-1 || loads[t+1] <= capacity);
14543 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