58 #define CONSHDLR_NAME "cumulative" 59 #define CONSHDLR_DESC "cumulative constraint handler" 60 #define CONSHDLR_SEPAPRIORITY 2100000 61 #define CONSHDLR_ENFOPRIORITY -2040000 62 #define CONSHDLR_CHECKPRIORITY -3030000 63 #define CONSHDLR_SEPAFREQ 1 64 #define CONSHDLR_PROPFREQ 1 65 #define CONSHDLR_EAGERFREQ 100 67 #define CONSHDLR_MAXPREROUNDS -1 68 #define CONSHDLR_DELAYSEPA FALSE 69 #define CONSHDLR_DELAYPROP FALSE 70 #define CONSHDLR_NEEDSCONS TRUE 72 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS 73 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 85 #define DEFAULT_USEBINVARS FALSE 86 #define DEFAULT_LOCALCUTS FALSE 87 #define DEFAULT_USECOVERCUTS TRUE 88 #define DEFAULT_CUTSASCONSS TRUE 89 #define DEFAULT_SEPAOLD TRUE 92 #define DEFAULT_TTINFER TRUE 93 #define DEFAULT_EFCHECK FALSE 94 #define DEFAULT_EFINFER FALSE 95 #define DEFAULT_USEADJUSTEDJOBS FALSE 96 #define DEFAULT_TTEFCHECK TRUE 97 #define DEFAULT_TTEFINFER TRUE 100 #define DEFAULT_DUALPRESOLVE TRUE 101 #define DEFAULT_COEFTIGHTENING FALSE 102 #define DEFAULT_NORMALIZE TRUE 103 #define DEFAULT_PRESOLPAIRWISE TRUE 104 #define DEFAULT_DISJUNCTIVE TRUE 105 #define DEFAULT_DETECTDISJUNCTIVE TRUE 106 #define DEFAULT_DETECTVARBOUNDS TRUE 107 #define DEFAULT_MAXNODES 10000LL 110 #define DEFAULT_FILLBRANCHCANDS FALSE 113 #define DEFAULT_USEBDWIDENING TRUE 122 #define EVENTHDLR_NAME "cumulative" 123 #define EVENTHDLR_DESC "bound change event handler for cumulative constraints" 162 unsigned int signature;
164 unsigned int validsignature:1;
165 unsigned int normalized:1;
166 unsigned int covercuts:1;
167 unsigned int propagated:1;
168 unsigned int varbounds:1;
169 unsigned int triedsolving:1;
171 #ifdef SCIP_STATISTIC 177 struct SCIP_ConshdlrData
211 #ifdef SCIP_STATISTIC 229 int nallconsdualfixs;
231 int naddeddisjunctives;
266 unsigned int proprule:2;
267 unsigned int data1:15;
268 unsigned int data2:15;
273 typedef struct InferInfo INFERINFO;
283 inferinfo.val.asint = i;
294 return inferinfo.val.asint;
303 return (
PROPRULE) inferinfo.val.asbits.proprule;
312 return (
int) inferinfo.val.asbits.data1;
321 return (
int) inferinfo.val.asbits.data2;
336 assert((
int)proprule <= (1<<2)-1);
337 assert(data1 >= 0 && data1 < (1<<15));
338 assert(data2 >= 0 && data2 < (1<<15));
340 inferinfo.val.asbits.proprule = proprule;
341 inferinfo.val.asbits.data1 = (
unsigned int) data1;
342 inferinfo.val.asbits.data2 = (
unsigned int) data2;
371 core =
MAX(0, MIN(end, ect) -
MAX(lst, begin));
376 #define computeCoreWithInterval(begin, end, ect, lst) (MAX(0, MIN((end), (ect)) - MAX((lst), (begin)))) 408 for( v = 0; v < nvbdvars; ++v )
411 assert(vbdvar != NULL);
415 if( image != NULL &&
SCIPisEQ(scip, vbdcoefs[v], 1.0 ) )
420 duration = (int)(
size_t)image;
423 SCIPdebugMsg(scip,
"check implication <%s>[%g,%g] >= <%s>[%g,%g] + <%g>\n",
427 if( duration >= vbdconst )
433 if( (*est) < impliedest )
476 for( v = 0; v < nvbdvars; ++v )
479 assert(vbdvar != NULL);
487 SCIPdebugMsg(scip,
"check implication <%s>[%g,%g] <= <%s>[%g,%g] + <%g>\n",
491 if( duration >= -vbdconst )
497 if( (*lct) > impliedlct )
531 startindex = nstarted - 1;
537 while( nstarted - nfinished > nrowvars )
546 varidx = startindices[startindex];
547 assert(varidx >= 0 && varidx < consdata->nvars);
549 var = consdata->vars[varidx];
550 duration = consdata->durations[varidx];
551 demand = consdata->demands[varidx];
557 if( endtime > curtime )
575 start = curtime - duration + 1;
576 end = MIN(curtime, endtime - duration);
578 for( b = 0; b < nbinvars; ++b )
580 if( vals[b] < start )
586 assert(binvars[b] != NULL);
596 (*vars)[*nvars] = binvars[b];
597 (*coefs)[*nvars] = demand;
634 assert(curtime >= consdata->hmin);
635 assert(curtime < consdata->hmax);
642 startindex = nstarted - 1;
645 while( nstarted - nfinished > counter )
647 assert(startindex >= 0);
650 varidx = startindices[startindex];
651 assert(varidx >= 0 && varidx < consdata->nvars);
653 var = consdata->vars[varidx];
654 duration = consdata->durations[varidx];
655 assert(duration > 0);
663 endtime = MIN(starttime + duration, consdata->hmax);
666 if( endtime > curtime )
668 (*activevars)[counter] = var;
669 sumofstarts += starttime;
670 mindelta = MIN(mindelta, endtime - curtime);
677 assert(mindelta > 0);
678 *lhs = lower ? sumofstarts + mindelta : sumofstarts - mindelta;
700 assert(vars != NULL || nvars == 0);
703 for ( j = 0; j < nvars; ++j )
705 assert(vars != NULL);
748 assert(vars != NULL || nvars == 0);
751 for ( j = 0; j < nvars; ++j )
753 assert(vars != NULL);
792 tmpnvars = consdata->nvars;
796 for ( j = 0; j < tmpnvars; ++j )
798 var = consdata->vars[j];
800 assert(consdata->durations[j] > 0);
801 assert(consdata->demands[j] > 0);
812 startindices[*nvars] = j;
814 endtimes[*nvars] = starttimes[*nvars] + consdata->durations[j];
815 endindices[*nvars] = j;
817 SCIPdebugMsg(scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
819 consdata->durations[j],
820 starttimes[*nvars], starttimes[*nvars] + consdata->durations[startindices[*nvars]],
821 consdata->demands[startindices[*nvars]]);
832 startindices[*nvars] = j;
834 endtimes[*nvars] = starttimes[*nvars] + consdata->durations[j];
835 endindices[*nvars] = j;
837 SCIPdebugMsg(scip,
"%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
839 consdata->durations[j],
840 starttimes[*nvars], starttimes[*nvars] + consdata->durations[startindices[*nvars]],
841 consdata->demands[startindices[*nvars]]);
854 for ( j = 0; j < *nvars; ++j )
856 SCIPdebugMsg(scip,
"%d: job[%d] starttime %d, endtime = %d, demand = %d\n", j,
857 startindices[j], starttimes[j], starttimes[j] + consdata->durations[startindices[j]],
858 consdata->demands[startindices[j]]);
861 for ( j = 0; j < *nvars; ++j )
863 SCIPdebugMsg(scip,
"%d: job[%d] endtime %d, demand = %d\n", j, endindices[j], endtimes[j],
864 consdata->demands[endindices[j]]);
869 #ifdef SCIP_STATISTIC 899 assert( scip != NULL );
900 assert(durations != NULL);
901 assert(demands != NULL);
902 assert(capacity >= 0);
908 assert(vars != NULL);
922 (*timepoints)[0] = starttimes[0];
923 (*cumulativedemands)[0] = 0;
927 for( j = 0; j < nvars; ++j )
932 curtime = starttimes[j];
934 if( curtime >= hmax )
938 while( endindex < nvars && endtimes[endindex] <= curtime )
942 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
945 (*timepoints)[*ntimepoints] = endtimes[endindex];
946 (*cumulativedemands)[*ntimepoints] = 0;
949 idx = endindices[endindex];
951 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
954 (*cumulativedemands)[*ntimepoints] = totaldemand;
957 idx = startindices[j];
959 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
961 if( (*timepoints)[*ntimepoints] < curtime )
964 (*timepoints)[*ntimepoints] = curtime;
965 (*cumulativedemands)[*ntimepoints] = 0;
968 (*cumulativedemands)[*ntimepoints] = totaldemand;
971 while( j+1 < nvars && starttimes[j+1] == curtime )
974 idx = startindices[j];
976 totaldemand += (
SCIP_Real) demands[idx] * durations[idx] / (lct - starttimes[j]);
978 (*cumulativedemands)[*ntimepoints] = totaldemand;
983 while( endindex < nvars)
988 if( (*timepoints)[*ntimepoints] < endtimes[endindex] )
991 (*timepoints)[*ntimepoints] = endtimes[endindex];
992 (*cumulativedemands)[*ntimepoints] = 0;
995 idx = endindices[endindex];
997 totaldemand -= (
SCIP_Real) demands[idx] * durations[idx] / (endtimes[endindex] - est);
998 (*cumulativedemands)[*ntimepoints] = totaldemand;
1005 (*minfreecapacity) = INT_MAX;
1006 for( j = 0; j < *ntimepoints; ++j )
1008 if( (*timepoints)[j] >= hmin && (*timepoints)[j] < hmax )
1009 *minfreecapacity = MIN( *minfreecapacity, (
SCIP_Real)capacity - (*cumulativedemands)[j] );
1045 assert(consdata != NULL);
1047 nvars = consdata->nvars;
1048 capacity = consdata->capacity;
1050 globalmaxdemand = 0.0;
1057 for( v = 0; v < nvars; ++v )
1068 peak = consdata->demands[v];
1073 if( consdata->demands[v] > capacity / 3 )
1076 for( j = 0; j < nvars; ++j )
1086 if( lb <= timepoint && lb + consdata->durations[j] > timepoint )
1088 peak += consdata->demands[j];
1091 if( consdata->demands[j] > consdata->capacity / 3 )
1097 globalpeak =
MAX(globalpeak, peak);
1098 globalmaxdemand =
MAX(globalmaxdemand, maxdemand);
1100 if( peak > capacity )
1103 cumfactor1 =
MAX( cumfactor1, (peak-capacity)/peak * (capacity-deltademand)/(
SCIP_Real)capacity );
1104 resstrength2 =
MAX(resstrength2, (capacity-maxdemand)/(peak-maxdemand) );
1108 resstrength1 = (capacity-globalmaxdemand) / (globalpeak-globalmaxdemand);
1111 consdata->disjfactor2 = disjfactor2;
1112 consdata->cumfactor1 = cumfactor1;
1113 consdata->resstrength2 = resstrength2;
1114 consdata->resstrength1 = resstrength1;
1128 minfreecapacity = INT_MAX;
1131 SCIP_CALL( computeRelevantEnergyIntervals(scip, nvars, consdata->vars,
1132 consdata->durations, consdata->demands,
1133 capacity, consdata->hmin, consdata->hmax, &timepoints, &estimateddemands,
1134 &ntimepoints, &maxdemand, &minfreecapacity) );
1140 consdata->estimatedstrength = (
SCIP_Real)(capacity - minfreecapacity) / (
SCIP_Real) capacity;
1143 SCIPstatisticPrintf(
"cumulative constraint<%s>: DISJ1=%g, DISJ2=%g, CUM=%g, RS1 = %g, RS2 = %g, EST = %g\n",
1144 SCIPconsGetName(cons), consdata->disjfactor1, disjfactor2, cumfactor1, resstrength1, resstrength2,
1145 consdata->estimatedstrength);
1175 if( realconstant < 0.0 )
1180 if( realscalar < 0.0 )
1191 assert(*scalar != 0);
1209 for( j = 0; j < njobs; ++j )
1210 energy += durations[j] * demands[j];
1251 assert(subscip != NULL);
1262 for( v = 0; v < njobs; ++v )
1269 if( objvals == NULL )
1272 objval = objvals[v];
1280 njobs, subvars, durations, demands, capacity) );
1325 (*infeasible) =
TRUE;
1329 (*unbounded) =
TRUE;
1338 assert(sol != NULL);
1340 for( v = 0; v < njobs; ++v )
1356 for( v = 0; v < njobs; ++v )
1376 for( v = 0; v < njobs; ++v )
1397 (*infeasible) =
FALSE;
1398 (*unbounded) =
FALSE;
1401 SCIPdebugMessage(
"solve independent cumulative condition with %d variables\n", njobs);
1408 njobs, capacity, hmin, hmax,
1409 maxnodes, timelimit, memorylimit,
1411 infeasible, unbounded, solved, error);
1438 (*infeasible) =
FALSE;
1439 (*unbounded) =
FALSE;
1442 SCIPdebugMsg(scip,
"solve independent cumulative condition with %d variables\n", njobs);
1461 for( v = 0; v < njobs; ++v )
1469 if( objvals == NULL )
1472 objval = objvals[v];
1478 timeinterval = lst - est + 1;
1479 assert(timeinterval > 0);
1482 minest = MIN(minest, est);
1483 maxlct =
MAX(maxlct, lst + durations[v]);
1492 for( t = 0; t < timeinterval; ++t )
1505 binvars[v][t] = binvar;
1514 hmin =
MAX(hmin, minest);
1515 hmax = MIN(hmax, maxlct);
1516 assert(hmin > INT_MIN);
1517 assert(hmax < INT_MAX);
1518 assert(hmin < hmax);
1521 for( t = hmin; t < hmax; ++t )
1532 for( v = 0; v < njobs; ++v )
1545 duration = durations[v];
1546 assert(duration > 0);
1549 if( t < est || t >= lst + duration )
1552 demand = demands[v];
1553 assert(demand >= 0);
1555 start =
MAX(t - duration + 1, est);
1558 assert(start <= end);
1560 for( k = start; k <= end; ++k )
1562 assert(binvars[v][k] != NULL);
1597 (*infeasible) =
TRUE;
1601 (*unbounded) =
TRUE;
1609 assert(sol != NULL);
1611 for( v = 0; v < njobs; ++v )
1621 timeinterval = lst - est + 1;
1624 for( t = 0; t < timeinterval; ++t )
1644 for( v = 0; v < njobs; ++v )
1654 timeinterval = lst - est + 1;
1657 for( t = 0; t < timeinterval; ++t )
1667 for( t = timeinterval - 1; t >= 0; --t )
1690 for( v = 0; v < njobs; ++v )
1700 timeinterval = lst - est + 1;
1702 for( t = 0; t < timeinterval; ++t )
1736 assert(scip != NULL);
1737 assert(conshdlrdata != NULL);
1738 assert(eventhdlr != NULL);
1743 (*conshdlrdata)->eventhdlr = eventhdlr;
1746 (*conshdlrdata)->solveCumulative = solveCumulativeViaScipCp;
1748 #ifdef SCIP_STATISTIC 1749 (*conshdlrdata)->nlbtimetable = 0;
1750 (*conshdlrdata)->nubtimetable = 0;
1751 (*conshdlrdata)->ncutofftimetable = 0;
1752 (*conshdlrdata)->nlbedgefinder = 0;
1753 (*conshdlrdata)->nubedgefinder = 0;
1754 (*conshdlrdata)->ncutoffedgefinder = 0;
1755 (*conshdlrdata)->ncutoffoverload = 0;
1756 (*conshdlrdata)->ncutoffoverloadTTEF = 0;
1758 (*conshdlrdata)->nirrelevantjobs = 0;
1759 (*conshdlrdata)->nalwaysruns = 0;
1760 (*conshdlrdata)->nremovedlocks = 0;
1761 (*conshdlrdata)->ndualfixs = 0;
1762 (*conshdlrdata)->ndecomps = 0;
1763 (*conshdlrdata)->ndualbranchs = 0;
1764 (*conshdlrdata)->nallconsdualfixs = 0;
1765 (*conshdlrdata)->naddedvarbounds = 0;
1766 (*conshdlrdata)->naddeddisjunctives = 0;
1779 assert(conshdlrdata != NULL);
1780 assert(*conshdlrdata != NULL);
1803 assert(scip != NULL);
1804 assert(consdata != NULL);
1805 assert(eventhdlr != NULL);
1808 for( v = 0; v < consdata->nvars; ++v )
1826 assert(scip != NULL);
1827 assert(consdata != NULL);
1828 assert(eventhdlr != NULL);
1829 assert(0 <= pos && pos < consdata->nvars);
1830 assert(consdata->vars[pos] != NULL);
1848 assert(scip != NULL);
1849 assert(consdata != NULL);
1852 for( v = 0; v < consdata->nvars; ++v )
1870 nvars = consdata->nvars;
1873 for( v = 0; v < nvars; ++v )
1875 consdata->downlocks[v] = locked;
1876 consdata->uplocks[v] = locked;
1898 assert(scip != NULL);
1899 assert(consdata != NULL);
1900 assert(vars != NULL || nvars > 0);
1901 assert(demands != NULL);
1902 assert(durations != NULL);
1903 assert(capacity >= 0);
1905 assert(hmin < hmax);
1910 (*consdata)->hmin = hmin;
1911 (*consdata)->hmax = hmax;
1913 (*consdata)->capacity = capacity;
1914 (*consdata)->demandrows = NULL;
1915 (*consdata)->demandrowssize = 0;
1916 (*consdata)->ndemandrows = 0;
1917 (*consdata)->scoverrows = NULL;
1918 (*consdata)->nscoverrows = 0;
1919 (*consdata)->scoverrowssize = 0;
1920 (*consdata)->bcoverrows = NULL;
1921 (*consdata)->nbcoverrows = 0;
1922 (*consdata)->bcoverrowssize = 0;
1923 (*consdata)->nvars = nvars;
1924 (*consdata)->varssize = nvars;
1925 (*consdata)->signature = 0;
1926 (*consdata)->validsignature =
FALSE;
1927 (*consdata)->normalized =
FALSE;
1928 (*consdata)->covercuts =
FALSE;
1929 (*consdata)->propagated =
FALSE;
1930 (*consdata)->varbounds =
FALSE;
1931 (*consdata)->triedsolving =
FALSE;
1935 assert(vars != NULL);
1940 (*consdata)->linkingconss = NULL;
1948 if( linkingconss != NULL )
1956 SCIPdebugMsg(scip,
"get tranformed variables and constraints\n");
1964 for( v = 0; v < nvars; ++v )
1969 if( linkingconss != NULL )
1974 for( v = 0; v < nvars; ++v )
1975 assert(
SCIPgetConsLinking(scip, (*consdata)->vars[v]) == (*consdata)->linkingconss[v]);
1981 (*consdata)->vars = NULL;
1982 (*consdata)->downlocks = NULL;
1983 (*consdata)->uplocks = NULL;
1984 (*consdata)->demands = NULL;
1985 (*consdata)->durations = NULL;
1986 (*consdata)->linkingconss = NULL;
1990 (*consdata)->resstrength1 = -1.0;
1991 (*consdata)->resstrength2 = -1.0;
1992 (*consdata)->cumfactor1 = -1.0;
1993 (*consdata)->disjfactor1 = -1.0;
1994 (*consdata)->disjfactor2 = -1.0;
1995 (*consdata)->estimatedstrength = -1.0;
2011 assert(consdata != NULL);
2012 assert(*consdata != NULL);
2014 for( r = 0; r < (*consdata)->ndemandrows; ++r )
2016 assert((*consdata)->demandrows[r] != NULL);
2022 (*consdata)->ndemandrows = 0;
2023 (*consdata)->demandrowssize = 0;
2026 for( r = 0; r < (*consdata)->nscoverrows; ++r )
2028 assert((*consdata)->scoverrows[r] != NULL);
2034 (*consdata)->nscoverrows = 0;
2035 (*consdata)->scoverrowssize = 0;
2037 for( r = 0; r < (*consdata)->nbcoverrows; ++r )
2039 assert((*consdata)->bcoverrows[r] != NULL);
2045 (*consdata)->nbcoverrows = 0;
2046 (*consdata)->bcoverrowssize = 0;
2048 (*consdata)->covercuts =
FALSE;
2063 assert(consdata != NULL);
2064 assert(*consdata != NULL);
2066 nvars = (*consdata)->nvars;
2067 varssize = (*consdata)->varssize;
2077 if( (*consdata)->linkingconss != NULL )
2079 for( v = nvars-1; v >= 0; --v )
2081 assert((*consdata)->linkingconss[v] != NULL );
2112 assert(consdata != NULL);
2117 for( v = 0; v < consdata->nvars; ++v )
2119 assert(consdata->vars[v] != NULL);
2124 consdata->durations[v], consdata->demands[v]);
2126 SCIPinfoMessage(scip, file,
")[%d,%d) <= %d", consdata->hmin, consdata->hmax, consdata->capacity);
2141 assert(scip != NULL);
2142 assert(consdata != NULL);
2143 assert(cons != NULL);
2147 SCIPdebugMsg(scip,
"cumulative constraint <%s>: remove variable <%s>\n",
2153 consdata->downlocks[pos] =
FALSE;
2154 consdata->uplocks[pos] =
FALSE;
2156 if( consdata->linkingconss != NULL )
2163 assert(conshdlr != NULL);
2165 assert(conshdlrdata != NULL);
2166 assert(conshdlrdata->eventhdlr != NULL);
2171 SCIPdebugMsg(scip,
"remove variable <%s>[%g,%g] from cumulative constraint <%s>\n",
2178 if( pos != consdata->nvars - 1 )
2180 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
2181 consdata->downlocks[pos] = consdata->downlocks[consdata->nvars-1];
2182 consdata->uplocks[pos] = consdata->uplocks[consdata->nvars-1];
2183 consdata->demands[pos] = consdata->demands[consdata->nvars-1];
2184 consdata->durations[pos] = consdata->durations[consdata->nvars-1];
2186 if( consdata->linkingconss != NULL )
2188 consdata->linkingconss[pos]= consdata->linkingconss[consdata->nvars-1];
2193 consdata->validsignature =
FALSE;
2194 consdata->normalized =
FALSE;
2209 assert(scip != NULL);
2210 assert(consdata != NULL);
2212 nvars = consdata->nvars;
2214 assert(consdata->linkingconss == NULL);
2218 for( v = 0; v < nvars; ++v )
2223 var = consdata->vars[v];
2224 assert(var != NULL);
2239 consdata->linkingconss[v] = cons;
2248 assert(consdata->linkingconss[v] != NULL);
2283 int* startsolvalues;
2296 assert(scip != NULL);
2297 assert(violated != NULL);
2299 (*violated) =
FALSE;
2304 assert(vars != NULL);
2305 assert(demands != NULL);
2306 assert(durations != NULL);
2315 for ( j = 0; j < nvars; ++j )
2327 startsolvalues[j] =
MAX(solvalue, hmin);
2328 startindices[j] = j;
2330 endsolvalues[j] =
MAX(solvalue + durations[j], hmin);
2341 freecapacity = capacity;
2346 for( j = 0; j < nvars; ++j )
2349 curtime = startsolvalues[j];
2351 if( curtime >= hmax )
2355 freecapacity -= demands[startindices[j]];
2356 while( j+1 < nvars && startsolvalues[j+1] == curtime )
2359 freecapacity -= demands[startindices[j]];
2363 while( endindex < nvars && curtime >= endsolvalues[endindex] )
2365 freecapacity += demands[endindices[endindex]];
2368 assert(freecapacity <= capacity);
2371 if( absviol < (
SCIP_Real) (-freecapacity) )
2373 absviol = -freecapacity;
2378 if( freecapacity < 0 && curtime >= hmin )
2380 SCIPdebugMsg(scip,
"freecapacity = %3d\n", freecapacity);
2392 ";\nviolation: at time point %d available capacity = %d, needed capacity = %d\n",
2393 curtime, capacity, capacity - freecapacity);
2395 for( i = 0; i <= j; ++i )
2397 if( startsolvalues[i] + durations[startindices[i]] > curtime )
2399 SCIPinfoMessage(scip, NULL,
"activity %s, start = %i, duration = %d, demand = %d \n",
2400 SCIPvarGetName(vars[startindices[i]]), startsolvalues[i], durations[startindices[i]],
2401 demands[startindices[i]]);
2436 assert(scip != NULL);
2437 assert(cons != NULL);
2438 assert(violated != NULL);
2443 assert(consdata != NULL);
2447 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
2448 violated, cons, printreason) );
2492 SCIPdebugMsg(scip,
"variable <%s>: (demand %d) resolve propagation of core time algorithm (peak %d)\n",
2497 capacity -= inferdemand;
2507 for( j = 0; j < nvars && capacity >= 0; ++j )
2510 assert(var != NULL);
2513 if( var == infervar )
2516 duration = durations[j];
2517 assert(duration > 0);
2525 SCIPdebugMsg(scip,
"variable <%s>: glb=[%g,%g] conflict=[%g,%g] (duration %d, demand %d)\n",
2535 if( inferpeak < ect && lst <= inferpeak )
2537 capacity -= demands[j];
2540 maxlst =
MAX(maxlst, lst);
2541 minect = MIN(minect, ect);
2542 assert(maxlst < minect);
2544 if( explanation != NULL )
2545 explanation[j] =
TRUE;
2562 if( inferpeak < ect && lst <= inferpeak )
2564 capacity -= demands[j];
2567 maxlst =
MAX(maxlst, lst);
2568 minect = MIN(minect, ect);
2569 assert(maxlst < minect);
2571 if( explanation != NULL )
2572 explanation[j] =
TRUE;
2588 for( j = 0; j < nvars; ++j )
2591 assert(var != NULL);
2594 if( var == infervar || reported[j] )
2597 duration = durations[j];
2598 assert(duration > 0);
2610 SCIPdebugMsg(scip,
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
2615 if( inferpeak < ect && lst <= inferpeak )
2618 canddemands[ncands] = demands[j];
2621 capacity -= demands[j];
2628 assert(capacity < 0);
2632 while( capacity + canddemands[ncands-1] < 0 )
2635 capacity += canddemands[ncands];
2640 for( c = 0; c < ncands; ++c )
2642 var = vars[cands[c]];
2643 assert(var != NULL);
2645 duration = durations[cands[c]];
2650 maxlst =
MAX(maxlst, lst);
2651 minect = MIN(minect, ect);
2652 assert(maxlst < minect);
2655 SCIPdebugMsg(scip,
"infer peak %d, relaxed peak %d, lst %d, ect %d\n", inferpeak, relaxedpeak, maxlst, minect);
2656 assert(inferpeak >= maxlst);
2657 assert(inferpeak < minect);
2660 if( relaxedpeak < inferpeak )
2662 inferpeak =
MAX(maxlst, relaxedpeak);
2664 else if( relaxedpeak > inferpeak )
2666 inferpeak = MIN(minect-1, relaxedpeak);
2668 assert(inferpeak >= hmin);
2669 assert(inferpeak < hmax);
2670 assert(inferpeak >= maxlst);
2671 assert(inferpeak < minect);
2674 for( c = 0; c < ncands; ++c )
2676 var = vars[cands[c]];
2677 assert(var != NULL);
2681 duration = durations[cands[c]];
2692 if( explanation != NULL )
2693 explanation[cands[c]] =
TRUE;
2702 if( provedpeak != NULL )
2703 *provedpeak = inferpeak;
2721 INFERINFO inferinfo,
2734 assert(scip != NULL);
2754 for( j = 0; j < nvars; ++j )
2764 assert(var != NULL);
2766 if( var == infervar )
2768 if( explanation != NULL )
2769 explanation[j] =
TRUE;
2777 duration = durations[j];
2778 assert(duration > 0);
2783 left = (est == hmin && lb + duration > hmin) || lb >= est;
2788 right = (lct == hmax && ub < hmax) || ub + duration <= lct;
2805 if( explanation != NULL )
2806 explanation[j] =
TRUE;
2829 ect = est + duration;
2830 lct = lst + duration;
2833 if( lct <= end && est >= begin )
2836 assert(lst <= end && ect >= begin);
2844 return MIN3(left, right, end - begin);
2882 requiredenergy = (end - begin) * capacity;
2884 SCIPdebugMsg(scip,
"analysis energy load in [%d,%d) (capacity %d, energy %d)\n", begin, end, capacity, requiredenergy);
2889 for( v = 0; v < nvars; ++v )
2899 assert(var != NULL);
2905 demand = demands[v];
2908 duration = durations[v];
2909 assert(duration > 0);
2912 if( infervar == var )
2920 SCIPdebugMsg(scip,
"inference variable <%s>[%g,%g] %s %g (duration %d, demand %d)\n",
2943 right = MIN3(end - lst, end - begin, duration);
2949 assert(begin <= lct);
2953 left = MIN(lct - begin + 1, end - begin);
2957 overlap = MIN(left, right);
2958 assert(overlap > 0);
2959 assert(overlap <= end - begin);
2960 assert(overlap <= duration);
2985 assert(ect > begin);
2990 left = MIN3(ect - begin, end - begin, duration);
3000 right = MIN(end - est + 1, end - begin);
3004 overlap = MIN(left, right);
3005 assert(overlap > 0);
3006 assert(overlap <= end - begin);
3007 assert(overlap <= duration);
3021 requiredenergy -= overlap * demand;
3023 if( explanation != NULL )
3024 explanation[v] =
TRUE;
3038 if( est + duration > begin && lst < end )
3041 glbenergy =
computeOverlap(begin, end, est, lst, duration) * demand;
3044 requiredenergy -= glbenergy;
3046 if( explanation != NULL )
3047 explanation[v] =
TRUE;
3057 if( est + duration > begin && lst < end )
3062 locenergies[v] = overlaps[v] * demand - glbenergy;
3063 assert(locenergies[v] >= 0);
3071 for( v = 0; v < nvars && requiredenergy >= 0; ++v )
3081 assert(idx >= 0 && idx < nvars);
3084 assert(var != NULL);
3085 assert(var != infervar);
3087 duration = durations[idx];
3088 assert(duration > 0);
3090 overlap = overlaps[v];
3091 assert(overlap > 0);
3093 requiredenergy -= locenergies[v];
3095 if( requiredenergy < -1 )
3099 demand = demands[idx];
3102 overlap += (int)((requiredenergy + 1) / demand);
3105 requiredenergy += locenergies[v];
3106 requiredenergy -= overlap * demand;
3107 assert(requiredenergy < 0);
3110 assert(overlap > 0);
3112 relaxlb = begin - duration + overlap;
3113 relaxub = end - overlap;
3115 SCIPdebugMsg(scip,
"variable <%s> glb=[%g,%g] loc=[%g,%g], conf=[%g,%g], added=[%d,%d] (demand %d, duration %d)\n",
3120 relaxlb, relaxub, demands[idx], duration);
3125 if( explanation != NULL )
3126 explanation[idx] =
TRUE;
3129 assert(requiredenergy < 0);
3150 INFERINFO inferinfo,
3172 if( inferpos >= nvars || vars[inferpos] != infervar )
3175 for( inferpos = 0; inferpos < nvars && vars[inferpos] != infervar; ++inferpos )
3178 assert(inferpos < nvars);
3179 assert(vars[inferpos] == infervar);
3181 inferdemand = demands[inferpos];
3182 inferduration = durations[inferpos];
3191 SCIPdebugMsg(scip,
"variable <%s>: upper bound changed from %g to %g (relaxed %g)\n",
3204 relaxedpeak = MIN(relaxedpeak, hmax-1);
3210 relaxedpeak =
MAX(relaxedpeak, inferpeak);
3211 assert(relaxedpeak >= inferpeak);
3212 assert(relaxedpeak >= hmin);
3218 SCIPdebugMsg(scip,
"variable <%s>: lower bound changed from %g to %g (relaxed %g)\n",
3231 relaxedpeak =
MAX(relaxedpeak, hmin);
3237 relaxedpeak = MIN(relaxedpeak, inferpeak);
3238 assert(relaxedpeak < hmax);
3243 infervar, inferdemand, inferpeak, relaxedpeak, bdchgidx, usebdwidening, &provedpeak, explanation) );
3272 if( explanation != NULL )
3273 explanation[inferpos] =
TRUE;
3285 assert(begin < end);
3287 begin =
MAX(begin, hmin);
3288 end = MIN(end, hmax);
3291 begin, end, infervar, boundtype, bdchgidx, relaxedbd, usebdwidening, explanation) );
3321 int* alternativelbs,
3322 int* alternativeubs,
3330 for( v = 0; v < nvars; ++v )
3336 assert(var != NULL);
3346 if( alternativelbs[v] <= ub )
3364 if( alternativeubs[v] >= lb )
3393 #if defined SCIP_DEBUG && !defined NDEBUG 3396 assert(idx != NULL);
3399 assert(idx != NULL);
3402 assert(starttimes != NULL);
3403 assert(starttimes != NULL);
3404 assert(freecapacity != NULL);
3405 assert(starttimes[*idx] == curtime);
3406 assert(consdata->demands != NULL);
3407 assert(freecapacity != idx);
3410 (*freecapacity) -= consdata->demands[startindices[*idx]];
3412 while( (*idx)+1 < nvars && starttimes[(*idx)+1] == curtime )
3415 (*freecapacity) -= consdata->demands[startindices[(*idx)]];
3416 assert(freecapacity != idx);
3419 assert(oldidx <= *idx);
3435 #if defined SCIP_DEBUG && !defined NDEBUG 3441 while( endtimes[*idx] <= curtime && *idx < nvars)
3443 (*freecapacity) += consdata->demands[endindices[*idx]];
3448 assert(oldidx <= *idx);
3476 assert(consdata != NULL);
3478 nvars = consdata->nvars;
3481 *timepoint = consdata->hmax;
3483 assert(consdata->vars != NULL);
3492 starttimes, endtimes, startindices, endindices);
3495 freecapacity = consdata->capacity;
3496 hmin = consdata->hmin;
3497 hmax = consdata->hmax;
3500 for( j = 0; j < nvars; ++j )
3502 curtime = starttimes[j];
3503 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
3505 if( curtime >= hmax )
3512 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
3514 assert(freecapacity <= consdata->capacity);
3515 assert(endindex <= nvars);
3521 if( freecapacity < 0 && curtime >= hmin )
3523 *timepoint = curtime;
3550 assert(scip != NULL);
3551 assert(conss != NULL);
3555 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal, NULL) );
3557 assert(scip != NULL);
3558 assert(conss != NULL);
3560 for( c = 0; c < nconss; ++c )
3569 assert(cons != NULL);
3575 assert(consdata != NULL);
3580 if( curtime < consdata->hmin || curtime >= consdata->hmax )
3584 for( j = 0; j < consdata->nvars; ++j )
3590 var = consdata->vars[j];
3591 assert(var != NULL);
3600 if( lb <= curtime && ub + consdata->durations[j] > curtime && lb < ub )
3606 score = MIN(solval - lb, ub - solval) / ((
SCIP_Real)ub-lb);
3619 SCIPdebugMsg(scip,
"found %d branching candidates\n", *nbranchcands);
3642 if( nbranchcands > 0 )
3653 for( c = 0; c < nconss && !violated; ++c )
3658 assert(cons != NULL);
3692 assert(consdata != NULL);
3694 nvars = consdata->nvars;
3695 vars = consdata->vars;
3696 downlocks = consdata->downlocks;
3697 uplocks = consdata->uplocks;
3700 for( v = 0; v < nvars; ++v )
3705 assert(var != NULL);
3743 assert(scip != NULL);
3764 if( ncheckconss == 1 )
3809 assert(consdata != NULL);
3814 if( consdata->triedsolving )
3824 consdata->triedsolving =
TRUE;
3826 SCIPdebugMsg(scip,
"the cumulative constraint <%s> is independent from rest of the problem (%d variables, %d constraints)\n",
3830 nvars = consdata->nvars;
3831 vars = consdata->vars;
3837 for( v = 0; v < nvars; ++v )
3845 assert(var != NULL);
3868 consdata->hmin, consdata->hmax, timelimit, memorylimit, maxnodes, &solved, cutoff, unbounded, &error) );
3870 if( !(*cutoff) && !(*unbounded) && !error )
3878 for( v = 0; v < nvars; ++v )
3881 if( lbs[v] + 0.5 > ubs[v] )
3884 assert(!infeasible);
3889 consdata->triedsolving =
FALSE;
3895 assert(!infeasible);
3900 consdata->triedsolving =
FALSE;
3904 assert(!infeasible);
3909 consdata->triedsolving =
FALSE;
3951 SCIPdebugMsg(scip,
"detected infeasibility due to adding a core to the core resource profile\n");
3961 infervar, inferdemand, inferpeak, inferpeak, NULL, usebdwidening, NULL, explanation) );
3977 *initialized =
TRUE;
4019 assert(var != NULL);
4021 duration = durations[idx];
4022 assert(duration > 0);
4024 demand = demands[idx];
4036 SCIPdebugMsg(scip,
"propagate earliest start time (lower bound) (pos %d)\n", pos);
4041 INFERINFO inferinfo;
4051 assert(pos == tmppos);
4054 ect = est + duration;
4081 newlb = MIN(newlb, ect);
4090 var, duration, demand, newlb-1, usebdwidening, initialized, explanation) );
4092 if( explanation != NULL )
4093 explanation[idx] =
TRUE;
4108 assert(!(*infeasible));
4123 assert(est >= newlb);
4162 assert(var != NULL);
4163 assert(duration > 0);
4175 lct = lst + duration;
4183 SCIPdebugMsg(scip,
"propagate upper bound (pos %d)\n", pos);
4192 INFERINFO inferinfo;
4204 assert(pos == tmppos);
4232 newub =
MAX(newub, lst) - duration;
4233 assert(newub >= est);
4243 assert(!infeasible);
4258 assert(lst <= newub);
4259 lct = lst + duration;
4282 int* coreEnergyAfterEst,
4283 int* coreEnergyAfterLct
4292 t = ntimepoints - 1;
4296 for( v = nvars-1; v >= 0; --v )
4314 coreEnergyAfterEst[v] = energy;
4317 t = ntimepoints - 1;
4321 for( v = nvars-1; v >= 0; --v )
4339 coreEnergyAfterLct[v] = energy;
4366 for( v = 0; v < nvars; ++ v)
4377 duration = durations[v];
4378 assert(duration > 0);
4382 ect = est + duration;
4383 lct = lst + duration;
4394 leftadjust =
MAX(0, hmin - est);
4397 rightadjust =
MAX(0, lct - hmax);
4400 flexenergies[v] = duration - leftadjust - rightadjust - core;
4401 flexenergies[v] =
MAX(0, flexenergies[v]);
4402 flexenergies[v] *= demands[v];
4403 assert(flexenergies[v] >= 0);
4406 ects[v] = MIN(ect, lst);
4409 lsts[v] =
MAX(ect, lst);
4443 assert(begin >= hmin);
4444 assert(end <= hmax);
4447 if( !conshdlrdata->ttefinfer )
4451 if( est >= end || ect <= begin )
4457 if( est >= begin && ect <= end )
4463 if( energy >= demand * (
MAX(begin, est) - MIN(end, ect)) )
4478 newlb = end - energy / demand;
4483 if( newlb > lct - duration )
4503 begin, end, var,
SCIP_BOUNDTYPE_LOWER, NULL, relaxedbd, conshdlrdata->usebdwidening, explanation) );
4505 (*initialized) =
TRUE;
4510 else if( newlb > (*bestlb) )
4512 INFERINFO inferinfo;
4514 assert(newlb > begin);
4556 assert(begin >= hmin);
4557 assert(end <= hmax);
4558 assert(est < begin);
4561 if( !conshdlrdata->ttefinfer )
4565 if( lst >= end || lct <= begin )
4571 if( lst >= begin && lct <= end )
4575 if( energy >= demand * (MIN(end, lct) -
MAX(begin, lst)) )
4585 assert(energy >= 0);
4592 newub = begin - duration + energy / demand;
4617 begin, end, var,
SCIP_BOUNDTYPE_UPPER, NULL, relaxedbd, conshdlrdata->usebdwidening, explanation) );
4619 (*initialized) =
TRUE;
4624 else if( newub < (*bestub) )
4626 INFERINFO inferinfo;
4628 assert(newub < begin);
4661 int* coreEnergyAfterEst,
4662 int* coreEnergyAfterLct,
4668 int coreEnergyAfterEnd;
4683 for( v = 0; v < nvars; ++v )
4688 est = MIN(est, start);
4689 lct =
MAX(lct, end);
4693 hmin =
MAX(hmin, est);
4694 hmax = MIN(hmax, lct);
4697 coreEnergyAfterEnd = -1;
4699 maxavailable = (hmax - hmin) * capacity;
4700 minavailable = maxavailable;
4704 if( (lcts[0] - ests[nvars-1]) * capacity >= totalenergy )
4712 for( v = nvars-1; v >= 0 && !(*cutoff); --v )
4731 assert(v == 0 || lcts[v-1] <= lcts[v]);
4747 if( !conshdlrdata->ttefinfer && end <= hmax && minavailable < maxavailable )
4751 assert(coreEnergyAfterLct[v] >= coreEnergyAfterEnd);
4752 assert(coreEnergyAfterEnd >= 0);
4755 freeenergy = capacity * (end - lct) - coreEnergyAfterLct[v] + coreEnergyAfterEnd;
4757 if( freeenergy <= minavailable )
4759 SCIPdebugMsg(scip,
"skip latest completion time <%d> (minimum available energy <%d>, free energy <%d>)\n", lct, minavailable, freeenergy);
4764 SCIPdebugMsg(scip,
"check intervals ending with <%d>\n", lct);
4767 coreEnergyAfterEnd = coreEnergyAfterLct[v];
4770 minavailable = maxavailable;
4779 for( i = nests-1; i >= 0; --i )
4791 assert(idx < nvars);
4809 if( (end - est) * capacity >= totalenergy )
4813 assert(var != NULL);
4815 duration = durations[idx];
4816 assert(duration > 0);
4818 demand = demands[idx];
4829 assert(est <= minbegin);
4830 if( minavailable < maxavailable && est < minbegin )
4836 var, duration, demand, est, lst, lct, minbegin, end, minavailable, &(newubs[idx]), &(ubinferinfos[idx]),
4837 initialized, explanation, cutoff) );
4843 SCIPdebugMsg(scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, lst of free part <%d>\n",
4859 assert(lst >= begin);
4860 assert(flexenergies[idx] >= 0);
4861 flexenergy += flexenergies[idx];
4874 energy = MIN(flexenergies[idx], demands[idx] *
MAX(0, (end - lst)));
4875 assert(end - lst < duration);
4876 assert(energy >= 0);
4879 flexenergy += energy;
4882 candenergy = MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
4883 assert(candenergy >= 0);
4886 if( candenergy > lbenergy )
4888 lbenergy = candenergy;
4893 SCIPdebugMsg(scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
4894 assert(coreEnergyAfterEst[i] >= coreEnergyAfterEnd);
4897 freeenergy = capacity * (end - begin) - flexenergy - coreEnergyAfterEst[i] + coreEnergyAfterEnd;
4900 if( freeenergy < 0 )
4902 SCIPdebugMsg(scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
4912 conshdlrdata->usebdwidening, explanation) );
4914 (*initialized) =
TRUE;
4926 if( lbenergy > 0 && freeenergy < lbenergy )
4938 newlb = end - (int)(energy / demands[lbcand]);
4950 relaxedbd = lst + 1.0;
4957 conshdlrdata->usebdwidening, explanation) );
4959 (*initialized) =
TRUE;
4965 else if( newlb > newlbs[lbcand] )
4967 INFERINFO inferinfo;
4974 newlbs[lbcand] = newlb;
4979 if( minavailable > freeenergy )
4981 minavailable = freeenergy;
4984 assert(minavailable >= 0);
5012 int* coreEnergyAfterEst,
5013 int* coreEnergyAfterLct,
5019 int coreEnergyAfterStart;
5040 for( v = 0; v < nvars; ++v )
5045 minest = MIN(minest, start);
5046 maxlct =
MAX(maxlct, end);
5050 hmin =
MAX(hmin, minest);
5051 hmax = MIN(hmax, maxlct);
5053 maxavailable = (hmax - hmin) * capacity;
5057 if( (lcts[0] - ests[nvars-1]) * capacity >= totalenergy )
5065 for( v = 0; v < nvars; ++v )
5092 assert(est > begin);
5094 SCIPdebugMsg(scip,
"check intervals starting with <%d>\n", est);
5097 coreEnergyAfterStart = coreEnergyAfterEst[v];
5100 minavailable = maxavailable;
5108 for( i = nlcts; i < nvars; ++i )
5120 assert(idx < nvars);
5138 if( (lct - begin) * capacity >= totalenergy )
5142 assert(var != NULL);
5144 duration = durations[idx];
5145 assert(duration > 0);
5147 demand = demands[idx];
5158 assert(lct >= minend);
5159 if( minavailable < maxavailable && lct > minend )
5165 var, duration, demand, est, ect, lct, begin, minend, minavailable, &(newlbs[idx]), &(lbinferinfos[idx]),
5166 initialized, explanation, cutoff) );
5172 SCIPdebugMsg(scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, ect of free part <%d>\n",
5189 assert(flexenergies[idx] >= 0);
5190 flexenergy += flexenergies[idx];
5203 energy = MIN(flexenergies[idx], demands[idx] *
MAX(0, (ect - begin)));
5204 assert(ect - begin < duration);
5205 assert(energy >= 0);
5208 flexenergy += energy;
5211 candenergy = MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
5212 assert(candenergy >= 0);
5215 if( candenergy > ubenergy )
5217 ubenergy = candenergy;
5222 SCIPdebugMsg(scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
5223 assert(coreEnergyAfterLct[i] <= coreEnergyAfterStart);
5226 freeenergy = capacity * (end - begin) - flexenergy - coreEnergyAfterStart + coreEnergyAfterLct[i];
5229 if( freeenergy < 0 )
5231 SCIPdebugMsg(scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
5241 conshdlrdata->usebdwidening, explanation) );
5243 (*initialized) =
TRUE;
5255 if( ubenergy > 0 && freeenergy < ubenergy )
5261 duration = durations[ubcand];
5262 assert(duration > 0);
5270 newub = begin - duration + (int)(energy / demands[ubcand]);
5272 if( newub < ect - duration )
5281 relaxedbd = ect - duration - 1.0;
5288 conshdlrdata->usebdwidening, explanation) );
5290 (*initialized) =
TRUE;
5296 else if( newub < newubs[ubcand] )
5298 INFERINFO inferinfo;
5305 newubs[ubcand] = newub;
5310 if( minavailable > freeenergy )
5312 minavailable = freeenergy;
5315 assert(minavailable >= 0);
5351 int* coreEnergyAfterEst;
5352 int* coreEnergyAfterLct;
5373 if( !conshdlrdata->ttefcheck )
5376 SCIPdebugMsg(scip,
"run time-table edge-finding overload checking\n");
5394 for( v = 0; v < nvars; ++v )
5398 lbinferinfos[v] = 0;
5399 ubinferinfos[v] = 0;
5403 collectDataTTEF(scip, nvars, vars, durations, demands, hmin, hmax, permests, ests, permlcts, lcts, ects, lsts, flexenergies);
5416 newlbs, newubs, lbinferinfos, ubinferinfos, lsts, flexenergies,
5417 permests, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5421 newlbs, newubs, lbinferinfos, ubinferinfos, ects, flexenergies,
5422 permlcts, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5425 for( v = 0; v < nvars && !(*cutoff); ++v )
5433 assert(!infeasible);
5453 INFERINFO inferinfo;
5459 assert(var != NULL);
5470 assert(begin < end);
5478 conshdlrdata->usebdwidening, explanation) );
5480 (*initialized) =
TRUE;
5544 assert(scip != NULL);
5546 assert(cons != NULL);
5547 assert(cutoff != NULL);
5554 if( !conshdlrdata->ttinfer )
5557 assert(*initialized ==
FALSE);
5559 SCIPdebugMsg(scip,
"propagate cores of cumulative condition of constraint <%s>[%d,%d) <= %d\n",
5569 for( v = 0; v < nvars; ++v )
5580 assert(var != NULL);
5582 duration = durations[v];
5583 assert(duration > 0);
5594 if( lst + duration <= hmin || est >= hmax )
5598 begin =
MAX(hmin, lst);
5599 end = MIN(hmax, est + duration);
5601 demand = demands[v];
5607 SCIPdebugMsg(scip,
"variable <%s>[%g,%g] (duration %d, demand %d): remove core [%d,%d)\n",
5615 profile, v, nchgbds, conshdlrdata->usebdwidening, initialized, explanation, cutoff) );
5622 profile, v, nchgbds) );
5632 begin =
MAX(hmin, lst);
5633 end = MIN(hmax, est + duration);
5640 SCIPdebugMsg(scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
5649 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
5651 if( explanation != NULL )
5652 explanation[v] =
TRUE;
5669 struct SCIP_NodeData
5686 typedef struct SCIP_NodeData SCIP_NODEDATA;
5696 (*nodedata)->var = NULL;
5698 (*nodedata)->est = INT_MIN;
5699 (*nodedata)->lct = INT_MAX;
5700 (*nodedata)->duration = 0;
5701 (*nodedata)->demand = 0;
5702 (*nodedata)->enveloptheta = -1;
5703 (*nodedata)->energytheta = 0;
5704 (*nodedata)->enveloplambda = -1;
5705 (*nodedata)->energylambda = -1;
5706 (*nodedata)->idx = -1;
5707 (*nodedata)->intheta =
TRUE;
5735 SCIP_NODEDATA* leftdata;
5736 SCIP_NODEDATA* rightdata;
5738 SCIPdebugMsg(scip,
"update envelop starting from node <%p>\n", (
void*)node);
5743 while( node != NULL )
5751 assert(left != NULL);
5753 assert(leftdata != NULL);
5757 assert(right != NULL);
5759 assert(rightdata != NULL);
5762 if( leftdata->enveloptheta >= 0 )
5764 assert(rightdata->energytheta != -1);
5765 nodedata->enveloptheta =
MAX(leftdata->enveloptheta + rightdata->energytheta, rightdata->enveloptheta);
5768 nodedata->enveloptheta = rightdata->enveloptheta;
5770 assert(leftdata->energytheta != -1);
5771 assert(rightdata->energytheta != -1);
5772 nodedata->energytheta = leftdata->energytheta + rightdata->energytheta;
5774 if( leftdata->enveloplambda >= 0 )
5776 assert(rightdata->energytheta != -1);
5777 nodedata->enveloplambda =
MAX(leftdata->enveloplambda + rightdata->energytheta, rightdata->enveloplambda);
5780 nodedata->enveloplambda = rightdata->enveloplambda;
5782 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0 )
5783 nodedata->enveloplambda =
MAX(
nodedata->enveloplambda, leftdata->enveloptheta + rightdata->energylambda);
5787 if( leftdata->energylambda >= 0 && rightdata->energylambda >= 0 )
5789 assert(rightdata->energytheta != -1);
5790 assert(leftdata->energytheta != -1);
5791 nodedata->energylambda =
MAX(leftdata->energylambda + rightdata->energytheta, leftdata->energytheta + rightdata->energylambda);
5793 else if( rightdata->energylambda >= 0 )
5795 assert(leftdata->energytheta != -1);
5796 nodedata->energylambda = leftdata->energytheta + rightdata->energylambda;
5798 else if( leftdata->energylambda >= 0 )
5800 assert(rightdata->energytheta != -1);
5801 nodedata->energylambda = leftdata->energylambda + rightdata->energytheta;
5822 assert(node != NULL);
5829 assert(parent != NULL);
5836 assert(nodedata != NULL);
5838 nodedata->key = key;
5859 assert(scip != NULL);
5860 assert(tree != NULL);
5861 assert(node != NULL);
5869 assert(parent != NULL);
5880 assert(sibling != NULL);
5884 if( grandparent != NULL )
5931 assert(scip != NULL);
5932 assert(tree != NULL);
5933 assert(node != NULL);
5940 assert(
nodedata->enveloptheta != -1);
5941 assert(
nodedata->energytheta != -1);
5942 assert(
nodedata->enveloplambda == -1);
5943 assert(
nodedata->energylambda == -1);
5963 SCIP_NODEDATA** nodedatas,
5974 SCIP_NODEDATA* newnodedata;
5975 SCIP_NODEDATA* leafdata;
5982 assert(leaf != NULL);
5985 assert(leafdata != NULL);
5988 assert(nodedata != NULL);
5989 assert(nodedata->intheta);
5994 if( nodedata->key < leafdata->key )
6000 assert(leafdata != NULL);
6003 assert(leaf != NULL);
6004 assert(leaf != node);
6011 assert(newnode != NULL);
6014 nodedatas[*nnodedatas] = newnodedata;
6019 if( parent != NULL )
6036 if( nodedata->key < leafdata->key )
6041 newnodedata->key = nodedata->key;
6048 newnodedata->key = leafdata->key;
6070 SCIP_NODEDATA* leftdata;
6071 SCIP_NODEDATA* rightdata;
6073 assert(node != NULL);
6086 assert(left != NULL);
6089 assert(leftdata != NULL);
6092 assert(right != NULL);
6095 assert(rightdata != NULL);
6097 assert(
nodedata->energylambda != -1);
6098 assert(rightdata->energytheta != -1);
6100 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6103 assert(leftdata->energytheta != -1);
6104 assert(rightdata->energylambda != -1);
6105 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6119 SCIP_NODEDATA* leftdata;
6120 SCIP_NODEDATA* rightdata;
6122 assert(node != NULL);
6135 assert(left != NULL);
6138 assert(leftdata != NULL);
6141 assert(right != NULL);
6144 assert(rightdata != NULL);
6146 assert(
nodedata->enveloplambda != -1);
6147 assert(rightdata->energytheta != -1);
6150 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6152 else if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6153 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6156 assert(rightdata->enveloplambda != -1);
6157 assert(
nodedata->enveloplambda == rightdata->enveloplambda);
6189 omegaset[*nelements] = node;
6209 assert(node != NULL);
6220 SCIP_NODEDATA* leftdata;
6221 SCIP_NODEDATA* rightdata;
6224 assert(nodedata != NULL);
6228 assert(left != NULL);
6231 assert(leftdata != NULL);
6234 assert(right != NULL);
6237 assert(rightdata != NULL);
6240 assert(nodedata != NULL);
6242 assert(nodedata->enveloptheta != -1);
6243 assert(rightdata->energytheta != -1);
6245 if( leftdata->enveloptheta >= 0 && nodedata->enveloptheta == leftdata->enveloptheta + rightdata->energytheta )
6252 assert(rightdata->enveloptheta != -1);
6253 assert(nodedata->enveloptheta == rightdata->enveloptheta);
6273 SCIP_NODEDATA* leftdata;
6274 SCIP_NODEDATA* rightdata;
6276 assert(node != NULL);
6286 assert(left != NULL);
6289 assert(leftdata != NULL);
6292 assert(right != NULL);
6295 assert(rightdata != NULL);
6297 assert(
nodedata->energylambda != -1);
6298 assert(rightdata->energytheta != -1);
6300 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6307 assert(leftdata->energytheta != -1);
6308 assert(rightdata->energylambda != -1);
6309 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6330 SCIP_NODEDATA* leftdata;
6331 SCIP_NODEDATA* rightdata;
6333 assert(node != NULL);
6346 assert(left != NULL);
6349 assert(leftdata != NULL);
6352 assert(right != NULL);
6355 assert(rightdata != NULL);
6357 assert(
nodedata->enveloplambda != -1);
6358 assert(rightdata->energytheta != -1);
6360 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6367 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6368 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6375 assert(rightdata->enveloplambda != -1);
6376 assert(
nodedata->enveloplambda == rightdata->enveloplambda);
6396 assert(duration > 0);
6398 SCIPdebugMessage(
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
6403 return nodedata->demand * duration;
6416 return (est1 - est2);
6426 lct1 = ((SCIP_NODEDATA*)elem1)->lct;
6427 lct2 = ((SCIP_NODEDATA*)elem2)->lct;
6429 return (lct1 - lct2);
6460 SCIPdebugMsg(scip,
"est=%d, lct=%d, propest %u, reportedenergy %d, shift %d\n", est, lct, propest, reportedenergy, shift);
6463 energy = (lct - est) * capacity;
6471 for( j = 0; j < nleaves && reportedenergy <= energy; ++j )
6476 assert(nodedata != NULL);
6481 if( nodedata->est < est )
6483 est = nodedata->est;
6484 energy = (lct - est) * capacity;
6487 assert(reportedenergy > energy);
6489 SCIPdebugMsg(scip,
"time window [%d,%d) available energy %d, required energy %d\n", est, lct, energy, reportedenergy);
6515 for( j = nleaves-1; j >= 0; --j )
6520 assert(nodedata != NULL);
6521 assert(nodedata->var != NULL);
6535 if( explanation != NULL )
6536 explanation[nodedata->idx] =
TRUE;
6539 (*initialized) =
TRUE;
6562 assert(scip != NULL);
6564 if( energy > (capacity - demand) * (lct - est) )
6566 if( energy + demand * duration > capacity * (lct - est) )
6598 SCIP_NODEDATA* rootdata;
6604 assert(rootdata != NULL);
6607 for( j = ncands-1; j >= 0 && !(*cutoff); --j )
6615 assert(nodedata->est != -1);
6618 while( !(*cutoff) && rootdata->enveloplambda > capacity * nodedata->lct )
6622 SCIP_NODEDATA* leafdata;
6633 assert(leaf != NULL);
6637 assert(leafdata != NULL);
6638 assert(!leafdata->intheta);
6639 assert(leafdata->duration > 0);
6640 assert(leafdata->est >= 0);
6643 if( leafdata->est + leafdata->duration >= nodedata->lct )
6649 assert(rootdata != NULL);
6664 assert(nelements > 0);
6665 assert(nelements < ncands);
6667 newest =
computeEstOmegaset(scip, leafdata->duration, leafdata->demand, capacity, est, lct, energy);
6672 SCIPdebugMsg(scip,
"an overload was detected duration edge-finder propagattion\n");
6676 conshdlrdata->usebdwidening, initialized, explanation) );
6682 else if( newest > 0 )
6686 INFERINFO inferinfo;
6693 SCIPdebugMsg(scip,
"variable <%s> adjust lower bound from %g to %d\n",
6707 SCIPdebugMsg(scip,
"variable <%s> adjust upper bound from %g to %d\n",
6720 leafdata->est = newest;
6731 SCIPdebugMsg(scip,
"edge-finder dectected an infeasibility\n");
6739 if( explanation != NULL )
6740 explanation[leafdata->idx] =
TRUE;
6743 for( i = 0; i < nelements; ++i )
6746 assert(nodedata != NULL);
6751 if( explanation != NULL )
6752 explanation[nodedata->idx] =
TRUE;
6755 (*initialized) =
TRUE;
6773 assert(rootdata != NULL);
6808 SCIP_NODEDATA** nodedatas;
6820 assert(scip != NULL);
6821 assert(cons != NULL);
6822 assert(initialized != NULL);
6823 assert(cutoff != NULL);
6824 assert(*cutoff ==
FALSE);
6846 for( j = 0; j < nvars; ++j )
6851 shift =
MAX(shift, lct);
6858 for( j = 0; j < nvars; ++j )
6870 assert(var != NULL);
6872 duration = durations[j];
6873 assert(duration > 0);
6884 if( conshdlrdata->useadjustedjobs )
6888 leftadjust = (hmin - est);
6893 rightadjust = (lct - hmax);
6900 if( duration - leftadjust - rightadjust <= 0 )
6903 else if( est < hmin || lct > hmax )
6906 energy = demands[j] * (duration - leftadjust - rightadjust);
6909 totalenergy += energy;
6935 nodedata->key = est + j / (2.0 * nvars);
6936 nodedata->var = var;
6937 nodedata->est = est;
6938 nodedata->lct = lct;
6939 nodedata->demand = demands[j];
6940 nodedata->duration = duration;
6941 nodedata->leftadjust = leftadjust;
6942 nodedata->rightadjust = rightadjust;
6948 nodedata->enveloptheta = capacity * est + energy;
6949 nodedata->energytheta = energy;
6950 nodedata->enveloplambda = -1;
6951 nodedata->energylambda = -1;
6954 nodedata->intheta =
TRUE;
6960 nnodedatas = ncands;
6963 SCIPsortPtr((
void**)nodedatas, compNodedataLct, ncands);
6970 for( j = 0; j < ncands; ++j )
6973 SCIP_NODEDATA* rootdata;
6978 if( (nodedatas[j]->lct - nodedatas[j]->est) * capacity >= totalenergy )
6981 nodedatas[j]->est = -1;
6990 assert(nnodedatas <= 2*nvars);
6993 leaves[ninsertcands] = leaf;
6998 assert(rootdata != NULL);
7001 if( rootdata->enveloptheta > capacity * nodedatas[j]->lct )
7003 SCIPdebugMsg(scip,
"detects cutoff due to overload in time window [?,%d) (ncands %d)\n", nodedatas[j]->lct, j);
7021 est = nodedatas[j]->est;
7022 lct = nodedatas[j]->lct;
7027 for( j = j+1; j < ncands; ++j )
7034 nodedata = nodedatas[j];
7035 assert(nodedata != NULL);
7037 duration = nodedata->duration - nodedata->leftadjust - nodedata->rightadjust;
7045 duration -= (est - glbest);
7048 duration -= (glblct - lct);
7052 glbenery += nodedata->demand * duration;
7054 if( explanation != NULL )
7055 explanation[nodedata->idx] =
TRUE;
7061 conshdlrdata->usebdwidening, initialized, explanation) );
7063 else if( ninsertcands > 1 && conshdlrdata->efinfer )
7067 propest, shift, initialized, explanation, nchgbds, cutoff) );
7071 for( j = nnodedatas - 1; j >= 0; --j )
7115 if( !conshdlrdata->efcheck )
7120 cons,
TRUE, initialized, explanation, nchgbds, cutoff) );
7127 if( !conshdlrdata->efinfer )
7132 cons,
FALSE, initialized, explanation, nchgbds, cutoff) );
7169 assert(scip != NULL);
7170 assert(redundant != NULL);
7172 (*redundant) =
TRUE;
7178 assert(vars != NULL);
7188 for( j = 0; j < nvars; ++j )
7190 assert(durations[j] > 0);
7191 assert(demands[j] > 0);
7194 assert(var != NULL);
7200 if( lb >= hmax || ub + durations[j] <= hmin )
7203 starttimes[njobs] =
MAX(lb, hmin);
7204 startindices[njobs] = j;
7206 endtimes[njobs] = MIN(ub + durations[j], hmax);
7207 endindices[njobs] = j;
7208 assert(starttimes[njobs] <= endtimes[njobs]);
7217 freecapacity = capacity;
7220 for( j = 0; j < njobs; ++j )
7222 curtime = starttimes[j];
7225 if( curtime >= hmax )
7229 freecapacity -= demands[startindices[j]];
7230 while( j+1 < njobs && starttimes[j+1] == curtime )
7233 freecapacity -= demands[startindices[j]];
7237 while( endtimes[endindex] <= curtime )
7239 freecapacity += demands[endindices[endindex]];
7242 assert(freecapacity <= capacity);
7245 if( freecapacity < 0 && curtime >= hmin )
7247 (*redundant) =
FALSE;
7284 for( v = 0; v < nvars; ++v )
7297 assert(var != NULL);
7301 duration = durations[v];
7302 assert(duration > 0);
7304 demand = demands[v];
7312 if( lst + duration <= hmin || est >= hmax )
7316 begin =
MAX(hmin, lst);
7317 end = MIN(hmax, est + duration);
7323 SCIPdebugMsg(scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
7337 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
7339 if( explanation != NULL )
7340 explanation[v] =
TRUE;
7379 assert(nchgbds != NULL);
7380 assert(initialized != NULL);
7381 assert(cutoff != NULL);
7396 SCIP_CALL_TERMINATE( retcode,
createCoreProfile(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax,
7397 initialized, explanation, cutoff), TERMINATE );
7402 SCIP_CALL_TERMINATE( retcode,
propagateTimetable(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7403 nchgbds, initialized, explanation, cutoff), TERMINATE );
7409 SCIP_CALL_TERMINATE( retcode,
propagateEdgeFinding(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
7410 cons, initialized, explanation, nchgbds, cutoff), TERMINATE );
7416 SCIP_CALL_TERMINATE( retcode,
propagateTTEF(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7417 nchgbds, initialized, explanation, cutoff), TERMINATE );
7443 assert(scip != NULL);
7444 assert(cons != NULL);
7447 assert(consdata != NULL);
7449 oldnchgbds = *nchgbds;
7450 initialized =
FALSE;
7464 consdata->nvars, consdata->vars, consdata->durations, consdata->demands, consdata->capacity,
7465 consdata->hmin, consdata->hmax, cons,
7466 nchgbds, &redundant, &initialized, NULL, cutoff) );
7470 SCIPdebugMsg(scip,
"%s deletes cumulative constraint <%s> since it is redundant\n",
7484 assert(*cutoff ==
TRUE);
7490 if( *cutoff || *nchgbds > oldnchgbds )
7497 consdata->propagated =
TRUE;
7532 assert(probingpos >= 0);
7533 assert(probingpos < nvars);
7534 assert(success != NULL);
7535 assert(cutoff != NULL);
7537 var = vars[probingpos];
7538 assert(var != NULL);
7551 leftimpllbs, leftimplubs, leftproplbs, leftpropubs, cutoff) );
7586 rightimpllbs, rightimplubs, rightproplbs, rightpropubs, cutoff) );
7616 assert(roundable != NULL);
7633 assert(scalar != 0);
7665 assert(roundable != NULL);
7682 assert(scalar != 0);
7714 int* alternativelbs,
7715 int* alternativeubs,
7724 for( c = 0; c < nconss; ++c )
7733 assert(cons != NULL);
7740 assert(consdata != NULL);
7741 assert(consdata->nvars > 1);
7754 retcode =
SCIPcreateWorstCaseProfile(scip, profile, consdata->nvars, consdata->vars, consdata->durations, consdata->demands);
7767 hmin = consdata->hmin;
7768 hmax = consdata->hmax;
7772 assert(consdata != NULL);
7774 nvars = consdata->nvars;
7776 for( v = 0; v < nvars; ++v )
7782 var = consdata->vars[v];
7783 assert(var != NULL);
7798 if( consdata->downlocks[v] )
7805 ect = est + consdata->durations[v];
7807 if( ect <= hmin || hmin >= hmax )
7809 else if( est < hmin && alternativelbs[idx] >= (hmin + 1 - constant) / scalar )
7811 alternativelbs[idx] = (hmin + 1 - constant) / scalar;
7817 if( consdata->uplocks[v] )
7823 duration = consdata->durations[v];
7827 lct = lst + duration;
7829 if( lst >= hmax || hmin >= hmax )
7831 else if( lct > hmax && alternativeubs[idx] <= ((hmax - 1 - constant) / scalar) - duration )
7833 alternativeubs[idx] = ((hmax - 1 - constant) / scalar) - duration;
7849 int* alternativelbs,
7850 int* alternativeubs,
7877 for( v = 0; v < nvars; ++v )
7887 assert(var != NULL);
7903 if( alternativelbs[v] > ub )
7906 assert(!infeasible);
7925 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7926 nfixedvars, &success, cutoff) );
7950 if( alternativeubs[v] < lb )
7953 assert(!infeasible);
7972 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7973 nfixedvars, &success, cutoff) );
8013 int* alternativelbs;
8014 int* alternativeubs;
8023 oldnfixedvars = *nfixedvars;
8032 for( v = 0; v < nvars; ++v )
8036 alternativelbs[v] = INT_MAX;
8037 alternativeubs[v] = INT_MIN;
8045 nfixedvars, cutoff) );
8047 if( !(*cutoff) && oldnfixedvars == *nfixedvars && branched != NULL )
8094 assert(cons != NULL);
8098 assert(consdata != NULL );
8100 nvars = consdata->nvars;
8107 remainingcap = consdata->capacity;
8110 for( j = 0; j < nvars; ++j )
8117 if( startvalues[j] <= time && ub + consdata->durations[j] > time )
8120 if( startvalues[j] == ub )
8122 remainingcap -= consdata->demands[j];
8126 demands[nflexible] = consdata->demands[j];
8127 flexibleids[nflexible] = j;
8132 assert(remainingcap >= 0);
8148 while( j < nflexible && sumdemand <= remainingcap )
8150 sumdemand += demands[j];
8156 assert(sumdemand > remainingcap);
8157 assert(bigcoversize < nflexible);
8169 for( j = 0; j < nflexible; ++j )
8181 idx = flexibleids[j];
8185 assert(nbinvars != 0);
8188 assert(vals != NULL);
8194 start = time - consdata->durations[idx] + 1;
8195 end = MIN(time, ub);
8198 for( b = 0; b < nbinvars; ++b )
8200 if( vals[b] < start || vals[b] < lb )
8206 assert(binvars[b] != NULL);
8214 if( consdata->bcoverrowssize == 0 )
8216 consdata->bcoverrowssize = 10;
8219 if( consdata->nbcoverrows == consdata->bcoverrowssize )
8221 consdata->bcoverrowssize *= 2;
8225 consdata->bcoverrows[consdata->nbcoverrows] = row;
8226 consdata->nbcoverrows++;
8236 while( sumdemand <= remainingcap )
8239 sumdemand += demands[j];
8243 smallcoversize = nflexible - (j + 1) - 1;
8244 while( j > 0 && demands[j] == demands[nflexible-1] )
8247 assert(smallcoversize < nflexible);
8249 if( smallcoversize != 1 || smallcoversize != nflexible - (j + 1) - 1 )
8258 for( j = j + 1; j < nflexible; ++j )
8270 idx = flexibleids[j];
8274 assert(nbinvars != 0);
8277 assert(vals != NULL);
8283 start = time - consdata->durations[idx] + 1;
8284 end = MIN(time, ub);
8287 for( b = 0; b < nbinvars; ++b )
8289 if( vals[b] < start || vals[b] < lb )
8295 assert(binvars[b] != NULL);
8302 if( consdata->scoverrowssize == 0 )
8304 consdata->scoverrowssize = 10;
8307 if( consdata->nscoverrows == consdata->scoverrowssize )
8309 consdata->scoverrowssize *= 2;
8313 consdata->scoverrows[consdata->nscoverrows] = row;
8314 consdata->nscoverrows++;
8335 int* startvaluessorted;
8336 int* endvaluessorted;
8351 assert(scip != NULL);
8352 assert(cons != NULL);
8355 assert(consdata != NULL);
8358 if( consdata->vars == NULL )
8361 nvars = consdata->nvars;
8362 hmin = consdata->hmin;
8363 hmax = consdata->hmax;
8373 for ( j = 0; j < nvars; ++j )
8376 startvaluessorted[j] = startvalues[j];
8379 endvaluessorted[j] = endvalues[j];
8381 startindices[j] = j;
8391 freecapacity = consdata->capacity;
8394 for( j = 0; j < nvars; ++j )
8396 curtime = startvaluessorted[j];
8397 if( curtime >= hmax )
8401 freecapacity -= consdata->demands[startindices[j]];
8403 while( j+1 < nvars && startvaluessorted[j+1] == curtime )
8406 freecapacity -= consdata->demands[startindices[j]];
8410 while( endidx < nvars && curtime >= endvaluessorted[endidx] )
8412 freecapacity += consdata->demands[endindices[endidx]];
8416 assert(freecapacity <= consdata->capacity);
8417 assert(endidx <= nvars);
8427 if( freecapacity < 0 && curtime >= hmin )
8429 int nextprofilechange;
8433 nextprofilechange = MIN( startvaluessorted[j+1], endvaluessorted[endidx] );
8435 nextprofilechange = endvaluessorted[endidx];
8437 nextprofilechange = MIN(nextprofilechange, hmax);
8439 for( t = curtime; t < nextprofilechange; ++t )
8441 SCIPdebugMsg(scip,
"add cover constraint for time %d\n", curtime);
8451 consdata->covercuts =
TRUE;
8486 assert(nstarted > nfinished);
8489 assert(consdata != NULL);
8490 assert(consdata->nvars > 0);
8492 capacity = consdata->capacity;
8493 assert(capacity > 0);
8509 for( b = 0; b < nbinvars; ++b )
8525 for( b = 0; b < nbinvars; ++b )
8533 if( consdata->demandrowssize == 0 )
8535 consdata->demandrowssize = 10;
8538 if( consdata->ndemandrows == consdata->demandrowssize )
8540 consdata->demandrowssize *= 2;
8544 consdata->demandrows[consdata->ndemandrows] = row;
8545 consdata->ndemandrows++;
8581 assert(scip != NULL);
8582 assert(cons != NULL);
8585 assert(consdata != NULL);
8587 nvars = consdata->nvars;
8593 assert(consdata->vars != NULL);
8600 SCIPdebugMsg(scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
8605 starttimes, endtimes, startindices, endindices,
FALSE);
8608 freecapacity = consdata->capacity;
8609 hmin = consdata->hmin;
8610 hmax = consdata->hmax;
8613 for( j = 0; j < nvars; ++j )
8615 curtime = starttimes[j];
8616 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
8618 if( curtime >= hmax )
8625 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
8627 assert(freecapacity <= consdata->capacity);
8628 assert(endindex <= nvars);
8634 if( freecapacity < 0 && curtime >= hmin )
8641 nextstarttime = starttimes[j+1];
8643 nextstarttime = endtimes[nvars-1];
8645 nextstarttime = MIN(nextstarttime, hmax);
8652 for( t = curtime+1 ; t < nextstarttime; ++t )
8657 if( freecapacity < 0 )
8660 SCIPdebugMsg(scip,
"add capacity constraint at time %d\n", t);
8698 assert(consdata != NULL);
8699 assert(consdata->demandrows == NULL);
8700 assert(consdata->ndemandrows == 0);
8703 if( consdata->linkingconss == NULL )
8743 assert(consdata != NULL);
8745 if( consdata->demandrows == NULL )
8749 assert(consdata->ndemandrows == 0 || consdata->demandrows != NULL);
8751 for( r = 0; r < consdata->ndemandrows && !(*infeasible); ++r )
8755 assert(consdata->demandrows[r] != NULL);
8777 assert(scip != NULL);
8778 assert(cons != NULL);
8779 assert(separated != NULL);
8780 assert(cutoff != NULL);
8786 assert(consdata != NULL);
8790 if( consdata->demandrows == NULL )
8794 assert(consdata->ndemandrows == 0 || consdata->demandrows != NULL);
8799 for( r = 0; r < consdata->ndemandrows; ++r )
8830 (*separated) =
TRUE;
8851 assert(scip != NULL);
8852 assert(cons != NULL);
8853 assert(separated != NULL);
8854 assert(cutoff != NULL);
8860 assert(consdata != NULL);
8865 if( consdata->linkingconss == NULL )
8870 if( !consdata->covercuts )
8879 for( r = 0; r < consdata->nscoverrows; ++r )
8885 assert(consdata->scoverrows[r] != NULL);
8891 if( minfeasibility > feasibility )
8893 minfeasibility = feasibility;
8894 row = consdata->scoverrows[r];
8903 SCIPdebugMsg(scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8910 (*separated) =
TRUE;
8917 for( r = 0; r < consdata->nbcoverrows; ++r )
8923 assert(consdata->bcoverrows[r] != NULL);
8929 if( minfeasibility > feasibility )
8931 minfeasibility = feasibility;
8932 row = consdata->bcoverrows[r];
8941 SCIPdebugMsg(scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8944 assert(row != NULL);
8949 (*separated) =
TRUE;
8977 assert(nstarted > nfinished);
8980 assert(consdata != NULL);
8981 assert(consdata->nvars > 0);
8986 SCIP_CALL(
collectIntVars(scip, consdata, &activevars, startindices, curtime, nstarted, nfinished, lower, &lhs ) );
9004 for( v = 0; v < nstarted - nfinished; ++v )
9013 assert( ! infeasible );
9050 assert(scip != NULL);
9051 assert(cons != NULL);
9054 assert(consdata != NULL);
9056 nvars = consdata->nvars;
9062 assert(consdata->vars != NULL);
9069 SCIPdebugMsg(scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
9078 freecapacity = consdata->capacity;
9079 hmin = consdata->hmin;
9080 hmax = consdata->hmax;
9083 for( j = 0; j < nvars; ++j )
9085 curtime = starttimes[j];
9087 if( curtime >= hmax )
9094 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
9096 assert(freecapacity <= consdata->capacity);
9097 assert(endindex <= nvars);
9103 if( freecapacity < 0 && curtime >= hmin)
9143 assert(scip != NULL);
9144 assert(cons != NULL);
9147 assert(consdata != NULL);
9149 nvars = consdata->nvars;
9155 assert(consdata->vars != NULL);
9156 capacity = consdata->capacity;
9159 for ( j = 0; j < nvars; ++j )
9161 if( consdata->demands[j] > capacity )
9183 assert(scip != NULL);
9184 assert(cons != NULL);
9187 assert(consdata != NULL);
9189 if( consdata->nvars == 0 )
9196 else if( consdata->nvars == 1 )
9198 if( consdata->demands[0] > consdata->capacity )
9231 assert(scip != NULL);
9232 assert(cons != NULL);
9235 assert(consdata != NULL);
9237 hmin = consdata->hmin;
9238 hmax = consdata->hmax;
9240 SCIPdebugMsg(scip,
"check for irrelevant jobs within cumulative constraint <%s>[%d,%d)\n",
9243 for( j = consdata->nvars-1; j >= 0; --j )
9245 var = consdata->vars[j];
9246 demand = consdata->demands[j];
9247 duration = consdata->durations[j];
9253 if( demand == 0 || duration == 0 )
9256 SCIPdebugMsg(scip,
" remove variable <%s> due to zero %s\n",
9262 else if( est >= hmax || lct <= hmin )
9264 SCIPdebugMsg(scip,
" remove variable <%s>[%d,%d] with duration <%d>\n",
9295 assert(scip != NULL);
9298 assert(consdata->durations[pos] > 0);
9299 assert(consdata->demands[pos] > 0);
9301 var = consdata->vars[pos];
9302 assert(var != NULL);
9303 duration = consdata->durations[pos];
9306 SCIPdebugMsg(scip,
" variable <%s>: demand <%d> is larger than the capacity <%d>\n",
9307 SCIPvarGetName(var), consdata->demands[pos], consdata->capacity);
9314 if( ect - duration >= consdata->hmax || lst + duration <= consdata->hmin)
9317 if( ect > consdata->hmin && lst < consdata->hmax )
9322 else if( lst < consdata->hmax )
9330 else if( ect > consdata->hmin )
9355 leftbound = consdata->hmin - duration;
9356 rightbound = consdata->hmax;
9400 assert(consdata != NULL);
9406 capacity = consdata->capacity;
9408 for( j = consdata->nvars-1; j >= 0 && !(*cutoff); --j )
9410 if( consdata->demands[j] > capacity )
9447 assert(uplock ==
TRUE || uplock ==
FALSE);
9448 assert((
int)
TRUE == 1);
9449 assert((
int)
FALSE == 0);
9466 assert(!infeasible);
9499 assert(downlock ==
TRUE || downlock ==
FALSE);
9500 assert((
int)
TRUE == 1);
9501 assert((
int)
FALSE == 0);
9513 assert(!infeasible);
9542 if( *capacity == 1 || nvars <= 1 )
9545 assert(demands[nvars-1] <= *capacity);
9546 assert(demands[nvars-2] <= *capacity);
9549 mindemand1 = MIN(demands[nvars-1], demands[nvars-2]);
9550 mindemand2 =
MAX(demands[nvars-1], demands[nvars-2]);
9552 for( v = nvars-2; v >= 0 && (gcd >= 2 || mindemand1 + mindemand2 > *capacity); --v )
9554 assert(mindemand1 <= mindemand2);
9555 assert(demands[v] <= *capacity);
9559 if( mindemand1 > demands[v] )
9561 mindemand2 = mindemand1;
9562 mindemand1 = demands[v];
9564 else if( mindemand2 > demands[v] )
9565 mindemand2 = demands[v];
9568 if( mindemand1 + mindemand2 > *capacity )
9570 SCIPdebugMsg(scip,
"update cumulative condition (%d + %d > %d) to unary cumulative condition\n", mindemand1, mindemand2, *capacity);
9572 for( v = 0; v < nvars; ++v )
9577 (*nchgcoefs) += nvars;
9582 SCIPdebugMsg(scip,
"cumulative condition: dividing demands by %" SCIP_LONGINT_FORMAT
"\n", gcd);
9584 for( v = 0; v < nvars; ++v )
9589 (*nchgcoefs) += nvars;
9611 assert(nchgcoefs != NULL);
9612 assert(nchgsides != NULL);
9616 assert(consdata != NULL);
9618 if( consdata->normalized )
9621 capacity = consdata->capacity;
9626 consdata->demands, &consdata->capacity, nchgcoefs, nchgsides) );
9628 consdata->normalized =
TRUE;
9630 if( capacity > consdata->capacity )
9631 consdata->varbounds =
FALSE;
9689 for( t = 0; t < ntimepoints; ++t )
9692 if( timepoints[t] <= *hmin )
9696 if( timepoints[t] >= *hmax )
9702 if( loads[t] <= capacity )
9704 (*split) = timepoints[t];
9757 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
9786 assert(consdata != NULL);
9788 if( consdata->nvars <= 1 )
9792 consdata->durations, consdata->demands, consdata->capacity, &hmin, &hmax, &split) );
9795 if( consdata->hmin < hmin )
9799 consdata->hmin = hmin;
9804 if( consdata->hmax > hmax )
9807 consdata->hmax = hmax;
9812 if( consdata->hmax <= consdata->hmin )
9814 SCIPdebugMsg(scip,
"constraint <%s> is redundant since hmax(%d) <= hmin(%d)\n",
9820 else if( consdata->hmin < split && split < consdata->hmax )
9825 SCIPdebugMsg(scip,
"split cumulative constraint <%s>[%d,%d) with %d jobs at time point %d\n",
9826 SCIPconsGetName(cons), consdata->hmin, consdata->hmax, consdata->nvars, split);
9828 assert(split < consdata->hmax);
9832 consdata->durations, consdata->demands, consdata->capacity, split, consdata->hmax,
9837 consdata->hmax = split;
9839 assert(consdata->hmin < consdata->hmax);
9915 assert(scip != NULL);
9917 assert(cons != NULL);
9919 SCIPdebugMsg(scip,
"check for irrelevant variable for cumulative condition (hmin %d) w.r.t. earlier start time\n", hmin);
9921 firstminect = INT_MAX;
9922 secondminect = INT_MAX;
9925 for( v = 0; v < nvars; ++v )
9931 if( ect < firstminect )
9933 secondminect = firstminect;
9936 else if( ect < secondminect )
9941 for( v = 0; v < nvars; ++v )
9954 assert(var != NULL);
9956 duration = durations[v];
9957 assert(duration > 0);
9963 ect = est + duration;
9965 lct = lst + duration;
9968 if( ect == firstminect )
9969 minect = secondminect;
9971 minect = firstminect;
9974 alternativelb =
MAX(hmin+1, minect);
9975 alternativelb = MIN(alternativelb, hmax);
9982 SCIPdebugMsg(scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
9986 irrelevants[v] =
TRUE;
9997 assert(downlocks != NULL);
9998 assert(uplocks != NULL);
10009 SCIPdebugMsg(scip,
" variables <%s>[%d,%d] (duration <%d>) is irrelevant due to no up lock\n",
10013 irrelevants[v] =
TRUE;
10021 SCIPdebugMsg(scip,
" remove down lock of variable <%s>[%g,%g] with duration <%d>\n",
10025 downlocks[v] =
FALSE;
10032 else if( ect <= hmin )
10050 SCIPdebugMsg(scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt EST\n",
10057 irrelevants[v] =
TRUE;
10065 assert(downlocks != NULL);
10080 if( alternativelb > lst )
10086 assert(!infeasible);
10105 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10106 nfixedvars, &success, cutoff) );
10117 SCIPdebugMsg(scip,
"********* check variable <%s>[%g,%g] with duration <%d> (hmin %d)\n",
10200 assert(scip != NULL);
10202 assert(cons != NULL);
10204 SCIPdebugMsg(scip,
"check for irrelevant variable for cumulative condition (hmax %d) w.r.t. latest completion time\n", hmax);
10206 firstmaxlst = INT_MIN;
10207 secondmaxlst = INT_MIN;
10210 for( v = 0; v < nvars; ++v )
10216 if( lst > firstmaxlst )
10218 secondmaxlst = firstmaxlst;
10221 else if( lst > secondmaxlst )
10222 secondmaxlst = lst;
10226 for( v = 0; v < nvars; ++v )
10238 assert(var != NULL);
10240 duration = durations[v];
10241 assert(duration > 0);
10247 ect = est + duration;
10251 if( lst == firstmaxlst )
10252 maxlst = secondmaxlst;
10254 maxlst = firstmaxlst;
10257 alternativeub = MIN(hmax - 1, maxlst) - duration;
10258 alternativeub =
MAX(alternativeub, hmin);
10265 SCIPdebugMsg(scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
10269 irrelevants[v] =
TRUE;
10276 assert(downlocks != NULL);
10277 assert(uplocks != NULL);
10283 if( !downlocks[v] )
10289 SCIPdebugMsg(scip,
" variables <%s>[%d,%d] with duration <%d> is irrelevant due to no down lock\n",
10293 irrelevants[v] =
TRUE;
10301 SCIPdebugMsg(scip,
" remove up lock of variable <%s>[%g,%g] with duration <%d>\n",
10305 uplocks[v] =
FALSE;
10312 else if( lst >= hmax )
10330 SCIPdebugMsg(scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt LCT\n",
10337 irrelevants[v] =
TRUE;
10345 assert(uplocks != NULL);
10360 if( alternativeub < est )
10366 assert(!infeasible);
10385 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10386 nfixedvars, &success, cutoff) );
10427 assert(scip != NULL);
10428 assert(cons != NULL);
10429 assert(!(*cutoff));
10432 assert(consdata != NULL);
10434 nvars = consdata->nvars;
10444 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10445 irrelevants, nfixedvars, nchgsides, cutoff) );
10449 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10450 irrelevants, nfixedvars, nchgsides, cutoff) );
10455 for( v = nvars-1; v >= 0; --v )
10457 if( irrelevants[v] )
10463 var = consdata->vars[v];
10464 assert(var != NULL);
10470 if( lst <= consdata->hmin && ect >= consdata->hmax )
10472 if( consdata->capacity < consdata->demands[v] )
10478 consdata->capacity -= consdata->demands[v];
10479 consdata->varbounds =
FALSE;
10508 assert(demands != NULL);
10509 assert(ndemands != NULL);
10512 startindex = nstarted - 1;
10517 while( nstarted - nfinished > ncountedvars )
10524 varidx = startindices[startindex];
10525 assert(varidx >= 0 && varidx < consdata->nvars);
10527 var = consdata->vars[varidx];
10528 assert(var != NULL);
10533 if( endtime > curtime )
10535 if( consdata->demands[varidx] < consdata->capacity )
10537 (*demands)[*ndemands] = consdata->demands[varidx];
10571 assert(nstarted > nfinished);
10574 assert(consdata != NULL);
10575 assert(consdata->nvars > 0);
10576 assert(consdata->capacity > 0);
10582 SCIP_CALL(
collectDemands(scip, consdata, startindices, curtime, nstarted, nfinished, &demands, &ndemands) );
10587 for( j = 0; j < ndemands; ++j )
10595 items, NULL, NULL, NULL, NULL, &solval, &success) );
10636 assert(scip != NULL);
10637 assert(cons != NULL);
10638 assert(nchgsides != NULL);
10641 assert(consdata != NULL);
10643 nvars = consdata->nvars;
10646 if( nvars <= 1 || consdata->capacity <= 1 )
10649 assert(consdata->vars != NULL);
10651 SCIPdebugMsg(scip,
"try to tighten capacity for cumulative constraint <%s> with capacity %d\n",
10661 starttimes, endtimes, startindices, endindices,
FALSE);
10665 freecapacity = consdata->capacity;
10668 for( j = 0; j < nvars && bestcapacity < consdata->capacity; ++j )
10670 curtime = starttimes[j];
10671 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
10677 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
10679 assert(freecapacity <= consdata->capacity);
10680 assert(endindex <= nvars);
10686 if( freecapacity < 0 )
10696 bestcapacity =
MAX(bestcapacity, newcapacity);
10697 SCIPdebugMsg(scip,
"after highest cap usage: bestcapacity = %d\n", bestcapacity);
10701 if( freecapacity > 0 && freecapacity != consdata->capacity )
10703 bestcapacity =
MAX(bestcapacity, consdata->capacity - freecapacity);
10704 SCIPdebugMsg(scip,
"after peak < cap: bestcapacity = %d\n", bestcapacity);
10708 if( freecapacity == 0 && consdata->demands[startindices[j]] < consdata->capacity)
10711 SCIPdebugMsg(scip,
"--> cannot decrease capacity since sum equals capacity\n");
10712 bestcapacity = consdata->capacity;
10724 if( bestcapacity < consdata->capacity )
10731 SCIPdebugMsg(scip,
"+-+-+-+-+-+ --> CHANGE capacity of cons<%s> from %d to %d\n",
10734 for( j = 0; j < nvars; ++j )
10736 if( consdata->demands[j] == consdata->capacity )
10738 consdata->demands[j] = bestcapacity;
10743 consdata->capacity = bestcapacity;
10746 SCIPdebugMsgPrint(scip,
"; changed additionally %d coefficients\n", (*nchgcoefs) - oldnchgcoefs);
10748 consdata->varbounds =
FALSE;
10771 assert(scip != NULL);
10772 assert(cons != NULL);
10773 assert(nchgcoefs != NULL);
10777 assert(consdata != NULL);
10779 nvars = consdata->nvars;
10780 oldnchgcoefs = *nchgcoefs;
10789 mindemand = consdata->demands[0];
10790 for( j = 0; j < nvars; ++j )
10792 mindemand = MIN(mindemand, consdata->demands[j]);
10796 for( j = 0; j < nvars; ++j )
10798 if( mindemand + consdata->demands[j] > consdata->capacity && consdata->demands[j] < consdata->capacity )
10801 consdata->demands[j], consdata->capacity);
10802 consdata->demands[j] = consdata->capacity;
10811 for( j = 0; j < nvars; ++j )
10818 assert(consdata->demands[j] <= consdata->capacity);
10820 if( consdata->demands[j] == consdata->capacity )
10828 for( i = 0; i < nvars; ++i )
10839 if( est_i >= lct_j || est_j >= lct_i )
10842 if( consdata->demands[j] + consdata->demands[i] <= consdata->capacity )
10852 consdata->demands[j], consdata->capacity);
10853 consdata->demands[j] = consdata->capacity;
10859 if( (*nchgcoefs) > oldnchgcoefs )
10861 SCIPdebugMsg(scip,
"+-+-+-+-+-+changed %d coefficients of variables of cumulative constraint<%s>\n",
10884 assert(cons != NULL);
10886 nvars = consdata->nvars;
10889 hmin = consdata->hmin;
10890 hmax = consdata->hmax;
10891 assert(hmin < hmax);
10893 for( v = 0; v < nvars; ++v )
10902 var = consdata->vars[v];
10903 assert(var != NULL);
10905 duration = consdata->durations[v];
10908 ect = est + duration;
10910 lct = lst + duration;
10913 assert(lst > hmin || ect < hmax);
10915 if( lst <= hmin && est < hmin - lct + MIN(hmin, ect) )
10924 shift = est - (hmin - lct + MIN(hmin, ect));
10927 duration = hmin - lct;
10929 SCIPdebugMsg(scip,
"replace variable <%s>[%g,%g] by [%d,%d]\n",
10938 assert(!infeasible);
10939 assert(!redundant);
10940 assert(aggregated);
10943 consdata->durations[v] = duration;
10944 consdata->vars[v] = aggrvar;
10979 assert(consdata != NULL);
10981 capacity = consdata->capacity;
10983 if( capacity == 1 )
10990 halfcapacity = capacity / 2;
10991 mindemand = consdata->capacity;
10995 for( v = 0; v < consdata->nvars; ++v )
10997 if( consdata->demands[v] > halfcapacity )
10999 vars[nvars] = consdata->vars[v];
11000 demands[nvars] = 1;
11001 durations[nvars] = consdata->durations[v];
11004 mindemand = MIN(mindemand, consdata->demands[v]);
11013 for( v = 0; v < consdata->nvars; ++v )
11015 if( consdata->demands[v] > halfcapacity )
11018 if( mindemand + consdata->demands[v] > capacity )
11020 demands[nvars] = 1;
11021 durations[nvars] = consdata->durations[v];
11022 vars[nvars] = consdata->vars[v];
11081 if( *cutoff || *unbounded || presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE )
11098 if( conshdlrdata->normalize )
11110 if( conshdlrdata->coeftightening )
11122 SCIP_CALL( reformulateCons(scip, cons, naggrvars) );
11134 struct TCLIQUE_Graph
11152 assert(tcliquegraph != NULL);
11154 return tcliquegraph->nnodes;
11161 assert(tcliquegraph != NULL);
11163 return tcliquegraph->weights;
11170 assert(tcliquegraph != NULL);
11171 assert(0 <= node1 && node1 < tcliquegraph->
nnodes);
11172 assert(0 <= node2 && node2 < tcliquegraph->nnodes);
11175 if( tcliquegraph->precedencematrix[node1][node2] || tcliquegraph->precedencematrix[node2][node1] )
11179 if( tcliquegraph->demandmatrix[node1][node2] )
11194 assert(tcliquegraph != NULL);
11195 assert(0 <= node && node < tcliquegraph->
nnodes);
11196 assert(nnodes == 0 || nodes != NULL);
11197 assert(adjnodes != NULL);
11201 for( i = 0; i <
nnodes; i++ )
11204 assert(0 <= nodes[i] && nodes[i] < tcliquegraph->nnodes);
11205 assert(i == 0 || nodes[i-1] < nodes[i]);
11208 if( tcliqueIsedgeClique(tcliquegraph, node, nodes[i]) )
11211 adjnodes[nadjnodes] = nodes[i];
11240 nnodes = tcliquegraph->nnodes;
11242 for( i = 0; i <
nnodes; ++i )
11244 for( j = 0; j <
nnodes; ++j )
11246 SCIPinfoMessage(scip, NULL,
"(%d/%d) ", tcliquegraph->precedencematrix[i][j], tcliquegraph->demandmatrix[i][j]);
11269 if(
SCIPisEQ(scip, vlbcoef, 1.0) )
11281 bound = (duration - vlbcoef) / (vlbcoef - 1.0);
11283 if(
SCIPisLT(scip, vlbcoef, 1.0) )
11297 assert(
SCIPisGT(scip, vlbcoef, 1.0));
11328 vlbcoef = 1.0 / vubcoef;
11329 vlbconst = -vubconst / vubcoef;
11361 if( tcliquegraph->size == tcliquegraph->nnodes )
11366 tcliquegraph->size = size;
11374 for( v = 0; v < tcliquegraph->nnodes; ++v )
11380 assert(tcliquegraph->nnodes < tcliquegraph->size);
11382 pos = tcliquegraph->nnodes;
11385 tcliquegraph->durations[pos] = 0;
11386 tcliquegraph->weights[pos] = 0;
11387 tcliquegraph->vars[pos] = var;
11397 tcliquegraph->nnodes++;
11399 for( v = 0; v < tcliquegraph->nnodes; ++v )
11401 tcliquegraph->precedencematrix[v][pos] = 0;
11402 tcliquegraph->demandmatrix[v][pos] = 0;
11405 (*idx) = tcliquegraph->nnodes;
11442 for( v = 0; v < nvars; ++v )
11453 assert(var != NULL);
11458 if( tcliquegraph->durations[idx1] == 0 )
11466 for( b = 0; b < nvbdvars; ++b )
11473 if( tcliquegraph->durations[idx2] == 0 )
11477 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11485 for( b = 0; b < nvbdvars; ++b )
11492 if( tcliquegraph->durations[idx2] == 0 )
11496 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11499 for( b = v+1; b < nvars; ++b )
11506 if( tcliquegraph->durations[idx2] == 0 )
11511 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11515 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11535 for( i = 0; i <
nnodes; ++i )
11537 for( j = 0; j <
nnodes; ++j )
11539 if( adjmatrix[i][j] )
11544 for( k = 0; k <
nnodes; ++k )
11546 if( adjmatrix[j][k] )
11547 adjmatrix[i][k] =
TRUE;
11566 for( c = 0; c < nconss; ++c )
11576 assert(consdata != NULL);
11578 vars = consdata->vars;
11579 demands = consdata->demands;
11581 nvars = consdata->nvars;
11582 capacity = consdata->capacity;
11587 for( i = 0; i < nvars; ++i )
11595 if( tcliquegraph->durations[idx1] == 0 || tcliquegraph->durations[idx1] > consdata->durations[i] )
11598 for( j = i+1; j < nvars; ++j )
11600 assert(consdata->durations[j] > 0);
11602 if( demands[i] + demands[j] > capacity )
11615 if( est1 < consdata->hmin && est2 < consdata->hmin )
11622 if( lct1 > consdata->hmax && lct2 > consdata->hmax )
11627 assert(idx1 != idx2);
11629 if( tcliquegraph->durations[idx2] == 0 || tcliquegraph->durations[idx2] > consdata->durations[j] )
11634 assert(tcliquegraph->durations[idx1] > 0);
11635 assert(tcliquegraph->durations[idx2] > 0);
11637 tcliquegraph->demandmatrix[idx1][idx2] =
TRUE;
11638 tcliquegraph->demandmatrix[idx2][idx1] =
TRUE;
11659 assert(scip != NULL);
11660 assert(tcliquegraph != NULL);
11666 transitiveClosure(tcliquegraph->precedencematrix, tcliquegraph->ninarcs, tcliquegraph->noutarcs, tcliquegraph->nnodes);
11697 for( v = 0; v < ncliquenodes; ++v )
11699 durations[v] = tcliquegraph->durations[cliquenodes[v]];
11700 assert(durations[v] > 0);
11702 vars[v] = tcliquegraph->vars[cliquenodes[v]];
11742 nnodes = tcliquegraph->nnodes;
11746 for( v = 0; v <
nnodes; ++v )
11748 tcliquegraph->weights[v] = tcliquegraph->durations[v];
11759 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal, NULL) );
11768 if( tcliquegraph->durations[v] == 0 )
11778 for( c = 0; c <
nnodes; ++c )
11780 precedencerow[c] = tcliquegraph->precedencematrix[v][c];
11781 precedencecol[c] = tcliquegraph->precedencematrix[c][v];
11783 demandrow[c] = tcliquegraph->demandmatrix[v][c];
11784 demandcol[c] = tcliquegraph->demandmatrix[c][v];
11787 if( precedencerow[c] || precedencecol[c] )
11789 tcliquegraph->demandmatrix[v][c] =
FALSE;
11790 tcliquegraph->demandmatrix[c][v] =
FALSE;
11794 tcliquegraph->precedencematrix[c][v] =
FALSE;
11795 tcliquegraph->precedencematrix[v][c] =
FALSE;
11799 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11800 tcliquegraph, tcliqueNewsolClique, NULL,
11801 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11802 10000, 1000, 1000, v, &ntreenodes, &tcliquestatus);
11804 SCIPdebugMsg(scip,
"tree nodes %d clique size %d (weight %d, status %d)\n", ntreenodes, ncliquenodes, cliqueweight, tcliquestatus);
11806 if( ncliquenodes == 1 )
11816 for( c = 0; c < ncliquenodes; ++c )
11822 for( c = 0; c <
nnodes; ++c )
11824 tcliquegraph->precedencematrix[v][c] = precedencerow[c];
11825 tcliquegraph->precedencematrix[c][v] = precedencecol[c];
11827 tcliquegraph->demandmatrix[v][c] = demandrow[c];
11828 tcliquegraph->demandmatrix[c][v] = demandcol[c];
11840 (*naddconss) += nconss;
11896 if( !tcliquegraph->precedencematrix[source][sink] )
11899 nnodes = tcliquegraph->nnodes;
11900 vars = tcliquegraph->vars;
11910 for( i = 0; i <
nnodes; ++i )
11916 assert(var != NULL);
11918 duration = tcliquegraph->durations[i];
11920 if( i == source || i == sink )
11923 tcliquegraph->weights[i] = 0;
11925 else if( tcliquegraph->precedencematrix[source][i] && tcliquegraph->precedencematrix[i][sink] )
11928 tcliquegraph->weights[i] = duration;
11934 tcliquegraph->weights[i] = duration;
11937 tcliquegraph->weights[i] = 0;
11943 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11944 tcliquegraph, tcliqueNewsolClique, NULL,
11945 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11946 10000, 1000, 1000, -1, &ntreenodes, &tcliquestatus);
11948 if( ncliquenodes > 1 )
11959 distance = cliqueweight + tcliquegraph->durations[source];
11990 nnodes = tcliquegraph->nnodes;
12000 for( i = 0; i <
nnodes; ++i )
12002 if( tcliquegraph->ninarcs[i] == 0 )
12004 sources[nsources] = i;
12008 if( tcliquegraph->ninarcs[i] == 0 )
12031 (*naddconss) += nconss;
12054 for( c = 0; c < nconss; ++c )
12062 assert(consdata != NULL);
12064 vars = consdata->vars;
12065 nvars = consdata->nvars;
12067 for( v = 0; v < nvars; ++v )
12078 tcliquegraph->durations[idx] =
MAX(tcliquegraph->durations[idx], consdata->durations[v]);
12079 assert(tcliquegraph->durations[idx] > 0);
12136 for( v = 0; v < nvars; ++v )
12141 assert(var != NULL);
12154 (*tcliquegraph)->nnodes = nvars;
12155 (*tcliquegraph)->varmap = varmap;
12156 (*tcliquegraph)->precedencematrix = precedencematrix;
12157 (*tcliquegraph)->demandmatrix = demandmatrix;
12158 (*tcliquegraph)->weights = weights;
12159 (*tcliquegraph)->ninarcs = ninarcs;
12160 (*tcliquegraph)->noutarcs = noutarcs;
12161 (*tcliquegraph)->durations = durations;
12162 (*tcliquegraph)->size = nvars;
12176 for( v = (*tcliquegraph)->nnodes-1; v >= 0; --v )
12218 if( conshdlrdata->detectvarbounds )
12224 if( conshdlrdata->detectdisjunctive )
12245 if( consdata->validsignature )
12248 vars = consdata->vars;
12249 nvars = consdata->nvars;
12251 for( v = 0; v < nvars; ++v )
12253 consdata->signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(vars[v]) % (
sizeof(
unsigned int) * 8)));
12256 consdata->validsignature =
TRUE;
12265 assert(consdata != NULL);
12266 assert(0 <= ind1 && ind1 < consdata->nvars);
12267 assert(0 <= ind2 && ind2 < consdata->nvars);
12269 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
12284 for( i = 0; i < nconss; ++i )
12290 assert(cons0 != NULL);
12293 assert(consdata0 != NULL);
12296 assert(consdata0->validsignature);
12298 for( j = i+1; j < nconss; ++j )
12304 assert(cons1 != NULL);
12307 assert(consdata1 != NULL);
12309 if( consdata0->capacity != consdata1->capacity )
12313 assert(consdata1->validsignature);
12315 if( (consdata1->signature & (~consdata0->signature)) == 0 )
12319 assert((consdata0->signature & (~consdata1->signature)) == 0);
12322 if( (consdata0->signature & (~consdata1->signature)) == 0 )
12329 if( consdata0->nvars > consdata1->nvars )
12332 if( consdata0->hmin < consdata1->hmin )
12335 if( consdata0->hmax > consdata1->hmax )
12342 SCIPsort(perm0, consdataCompVar, (
void*)consdata0, consdata0->nvars);
12343 SCIPsort(perm1, consdataCompVar, (
void*)consdata1, consdata1->nvars);
12345 for( v0 = 0, v1 = 0; v0 < consdata0->nvars && v1 < consdata1->nvars; )
12356 var0 = consdata0->vars[idx0];
12358 var1 = consdata1->vars[idx1];
12369 demand0 = consdata0->demands[idx0];
12370 duration0 = consdata0->durations[idx0];
12372 demand1 = consdata1->demands[idx1];
12373 duration1 = consdata1->durations[idx1];
12375 if( demand0 != demand1 )
12378 if( duration0 != duration1 )
12384 else if( comp > 0 )
12390 if( v0 == consdata0->nvars )
12431 assert(consdata != NULL);
12434 if( consdata->varbounds )
12437 vars = consdata->vars;
12438 durations = consdata->durations;
12439 demands = consdata->demands;
12440 capacity = consdata->capacity;
12441 nvars = consdata->nvars;
12455 var = consdata->vars[i];
12456 assert(var != NULL);
12463 for( b = 0; b < nvbdvars; ++b )
12465 if(
SCIPisEQ(scip, vbdcoefs[b], 1.0) )
12469 for( j = 0; j < nvars; ++j )
12471 if( vars[j] == vbdvars[b] )
12477 if( demands[i] + demands[j] > capacity &&
SCIPconvertRealToInt(scip, vbdconsts[b]) < durations[j] )
12492 assert(!infeasible);
12494 (*nchgbds) += nlocalbdchgs;
12501 (*naddconss) += nconss;
12503 consdata->varbounds =
TRUE;
12523 assert(conshdlr != NULL);
12525 assert(nconss == 0 || conss != NULL);
12526 assert(result != NULL);
12528 if( solinfeasible )
12534 SCIPdebugMsg(scip,
"constraint enforcing %d useful cumulative constraints of %d constraints for %s solution\n", nusefulconss, nconss,
12535 sol == NULL ?
"LP" :
"relaxation");
12538 assert(conshdlrdata != NULL);
12542 if( conshdlrdata->usebinvars )
12551 for( c = 0; c < nusefulconss; ++c )
12557 assert(cons != NULL);
12572 for( ; c < nconss && !separated; ++c )
12578 assert(cons != NULL);
12616 assert(scip != NULL);
12617 assert(conshdlr != NULL);
12636 assert(conshdlr != NULL);
12640 assert(conshdlrdata != NULL);
12642 #ifdef SCIP_STATISTIC 12643 if( !conshdlrdata->iscopy )
12646 SCIPstatisticPrintf(
"time-table: lb=%" SCIP_LONGINT_FORMAT
", ub=%" SCIP_LONGINT_FORMAT
", cutoff=%" SCIP_LONGINT_FORMAT
"\n",
12647 conshdlrdata->nlbtimetable, conshdlrdata->nubtimetable, conshdlrdata->ncutofftimetable);
12648 SCIPstatisticPrintf(
"edge-finder: lb=%" SCIP_LONGINT_FORMAT
", ub=%" SCIP_LONGINT_FORMAT
", cutoff=%" SCIP_LONGINT_FORMAT
"\n",
12649 conshdlrdata->nlbedgefinder, conshdlrdata->nubedgefinder, conshdlrdata->ncutoffedgefinder);
12650 SCIPstatisticPrintf(
"overload: time-table=%" SCIP_LONGINT_FORMAT
" time-time edge-finding=%" SCIP_LONGINT_FORMAT
"\n",
12651 conshdlrdata->ncutoffoverload, conshdlrdata->ncutoffoverloadTTEF);
12671 assert(conshdlrdata != NULL);
12673 conshdlrdata->detectedredundant =
FALSE;
12675 for( c = 0; c < nconss; ++c )
12688 #ifdef SCIP_STATISTIC 12696 assert(conshdlrdata != NULL);
12698 for( c = 0; c < nconss; ++c )
12700 SCIP_CALL( evaluateCumulativeness(scip, conss[c]) );
12707 if( !conshdlrdata->iscopy )
12709 SCIPstatisticPrintf(
"@11 added variables bounds constraints %d\n", conshdlrdata->naddedvarbounds);
12710 SCIPstatisticPrintf(
"@22 added disjunctive constraints %d\n", conshdlrdata->naddeddisjunctives);
12732 assert(conshdlr != NULL);
12736 for( c = 0; c < nconss; ++c )
12739 assert(consdata != NULL);
12752 assert(conshdlr != NULL);
12754 assert(consdata != NULL );
12755 assert(*consdata != NULL );
12763 assert(conshdlrdata != NULL);
12782 assert(conshdlr != NULL);
12784 assert(sourcecons != NULL);
12785 assert(targetcons != NULL);
12788 assert(sourcedata != NULL);
12789 assert(sourcedata->demandrows == NULL);
12795 assert(conshdlrdata != NULL);
12796 assert(conshdlrdata->eventhdlr != NULL);
12800 sourcedata->durations, sourcedata->demands, sourcedata->nvars, sourcedata->capacity,
12824 assert(conshdlr != NULL);
12826 assert(conshdlrdata != NULL);
12828 *infeasible =
FALSE;
12830 SCIPdebugMsg(scip,
"initialize LP relaxation for %d cumulative constraints\n", nconss);
12832 if( conshdlrdata->usebinvars )
12835 for( c = 0; c < nconss && !(*infeasible); ++c )
12840 if( conshdlrdata->cutsasconss )
12864 assert(conshdlr != NULL);
12866 assert(nconss == 0 || conss != NULL);
12867 assert(result != NULL);
12869 assert(conshdlrdata != NULL);
12871 SCIPdebugMsg(scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12877 if( !conshdlrdata->localcuts &&
SCIPgetDepth(scip) > 0 )
12882 if( conshdlrdata->usebinvars )
12885 for( c = 0; c < nusefulconss && !cutoff; ++c )
12890 if( !cutoff && conshdlrdata->usecovercuts )
12892 for( c = 0; c < nusefulconss; ++c )
12899 if( conshdlrdata->sepaold )
12902 for( c = 0; c < nusefulconss; ++c )
12911 else if( separated )
12926 assert(conshdlr != NULL);
12928 assert(nconss == 0 || conss != NULL);
12929 assert(result != NULL);
12932 assert(conshdlrdata != NULL);
12934 if( !conshdlrdata->localcuts &&
SCIPgetDepth(scip) > 0 )
12937 SCIPdebugMsg(scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12943 if( conshdlrdata->usebinvars )
12946 for( c = 0; c < nusefulconss && !cutoff; ++c )
12951 if( !cutoff && conshdlrdata->usecovercuts )
12953 for( c = 0; c < nusefulconss; ++c )
12959 if( conshdlrdata->sepaold )
12962 for( c = 0; c < nusefulconss; ++c )
12971 else if( separated )
13001 SCIPdebugMsg(scip,
"method: enforce pseudo solution\n");
13003 assert(conshdlr != NULL);
13005 assert(nconss == 0 || conss != NULL);
13006 assert(result != NULL);
13008 if( objinfeasible )
13017 assert(conshdlrdata != NULL);
13030 assert(conshdlr != NULL);
13032 assert(nconss == 0 || conss != NULL);
13033 assert(result != NULL);
13037 SCIPdebugMsg(scip,
"check %d cumulative constraints\n", nconss);
13039 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
13065 SCIPdebugMsg(scip,
"propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss);
13067 assert(conshdlr != NULL);
13069 assert(nconss == 0 || conss != NULL);
13070 assert(result != NULL);
13073 assert(conshdlrdata != NULL);
13081 for( c = 0; c < nusefulconss && !cutoff; ++c )
13086 assert(cons != NULL);
13092 &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) );
13095 &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) );
13107 if( !cutoff && nchgbds == 0 )
13110 for( c = nusefulconss; c < nconss && !cutoff; ++c )
13117 if( !cutoff && conshdlrdata->dualpresolve &&
SCIPallowDualReds(scip) && nconss > 1 )
13128 else if( nchgbds > 0 )
13130 SCIPdebugMsg(scip,
"delete (locally) %d constraints and changed %d variable bounds\n", ndelconss, nchgbds);
13156 assert(conshdlr != NULL);
13158 assert(scip != NULL);
13159 assert(result != NULL);
13161 SCIPdebugMsg(scip,
"presolve %d cumulative constraints\n", nconss);
13164 assert(conshdlrdata != NULL);
13168 oldnfixedvars = *nfixedvars;
13169 oldnchgbds = *nchgbds;
13170 oldnchgsides = *nchgsides;
13171 oldnchgcoefs = *nchgcoefs;
13172 oldnupgdconss = *nupgdconss;
13173 oldndelconss = *ndelconss;
13174 oldnaddconss = *naddconss;
13179 for( c = 0; c < nconss && !cutoff; ++c )
13192 nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) );
13195 nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) );
13198 if( cutoff || unbounded )
13206 if( nrounds == 1 &&
SCIPgetNRuns(scip) == 1 && conshdlrdata->disjunctive )
13225 nfixedvars, &cutoff, NULL) );
13229 if( !cutoff &&
SCIPgetNRuns(scip) == 1 && !conshdlrdata->detectedredundant
13230 && (conshdlrdata->detectvarbounds || conshdlrdata->detectdisjunctive)
13237 conshdlrdata->detectedredundant =
TRUE;
13245 SCIPdebugMsg(scip,
"delete %d constraints and changed %d variable bounds (cutoff %u)\n",
13246 *ndelconss - oldndelconss, *nchgbds - oldnchgbds, cutoff);
13250 else if( unbounded )
13252 else if( *nchgbds > oldnchgbds || *nfixedvars > oldnfixedvars || *nchgsides > oldnchgsides
13253 || *nchgcoefs > oldnchgcoefs || *nupgdconss > oldnupgdconss || *ndelconss > oldndelconss || *naddconss > oldnaddconss )
13268 assert(conshdlr != NULL);
13270 assert(scip != NULL);
13271 assert(result != NULL);
13272 assert(infervar != NULL);
13273 assert(bdchgidx != NULL);
13276 assert(conshdlrdata != NULL);
13279 assert(cons != NULL);
13282 assert(consdata != NULL);
13284 SCIPdebugMsg(scip,
"resolve propagation: variable <%s>, cumulative constraint <%s> (capacity %d, propagation %d, H=[%d,%d))\n",
13289 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
13290 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, conshdlrdata->usebdwidening, NULL, result) );
13303 SCIPdebugMsg(scip,
"lock cumulative constraint <%s> with nlockspos = %d, nlocksneg = %d\n",
SCIPconsGetName(cons), nlockspos, nlocksneg);
13305 assert(scip != NULL);
13306 assert(cons != NULL);
13309 assert(consdata != NULL);
13311 vars = consdata->vars;
13312 assert(vars != NULL);
13314 for( v = 0; v < consdata->nvars; ++v )
13316 if( consdata->downlocks[v] && consdata->uplocks[v] )
13321 else if( consdata->downlocks[v] )
13325 else if( consdata->uplocks[v] )
13339 assert(scip != NULL);
13340 assert(conshdlr != NULL);
13341 assert(cons != NULL);
13355 const char* consname;
13361 assert(sourceconsdata != NULL);
13364 nvars = sourceconsdata->nvars;
13365 sourcevars = sourceconsdata->vars;
13375 for( v = 0; v < nvars && *valid; ++v )
13378 assert(!(*valid) || vars[v] != NULL);
13391 sourceconsdata->durations, sourceconsdata->demands, sourceconsdata->capacity,
13392 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13395 if( sourceconsdata->hmin > 0 )
13401 if( sourceconsdata->hmax < INT_MAX )
13433 SCIPdebugMsg(scip,
"parse <%s> as cumulative constraint\n", str);
13456 duration = atoi(strvalue);
13460 demand = atoi(strvalue);
13466 demands[nvars] = demand;
13467 durations[nvars] = duration;
13471 while( var != NULL );
13475 hmin = atoi(strvalue);
13480 hmax = (int)(value);
13488 capacity = (int)value;
13492 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13516 assert(consdata != NULL);
13518 if( varssize < consdata->nvars )
13519 (*success) =
FALSE;
13522 assert(vars != NULL);
13538 assert(consdata != NULL);
13540 (*nvars) = consdata->nvars;
13560 assert(scip != NULL);
13561 assert(eventhdlr != NULL);
13562 assert(eventdata != NULL);
13564 assert(event != NULL);
13567 assert(consdata != NULL);
13570 consdata->propagated =
FALSE;
13604 consEnfolpCumulative, consEnfopsCumulative, consCheckCumulative, consLockCumulative,
13607 assert(conshdlr != NULL);
13612 #ifdef SCIP_STATISTIC 13636 "should time-table (core-times) propagator be used to infer bounds?",
13640 "should edge-finding be used to detect an overload?",
13644 "should edge-finding be used to infer bounds?",
13647 "constraints/" CONSHDLR_NAME "/useadjustedjobs",
"should edge-finding be executed?",
13651 "should time-table edge-finding be used to detect an overload?",
13655 "should time-table edge-finding be used to infer bounds?",
13659 "constraints/" CONSHDLR_NAME "/usebinvars",
"should the binary representation be used?",
13662 "constraints/" CONSHDLR_NAME "/localcuts",
"should cuts be added only locally?",
13665 "constraints/" CONSHDLR_NAME "/usecovercuts",
"should covering cuts be added every node?",
13669 "should the cumulative constraint create cuts as knapsack constraints?",
13673 "shall old sepa algo be applied?",
13677 "constraints/" CONSHDLR_NAME "/fillbranchcands",
"should branching candidates be added to storage?",
13682 "constraints/" CONSHDLR_NAME "/dualpresolve",
"should dual presolving be applied?",
13685 "constraints/" CONSHDLR_NAME "/coeftightening",
"should coefficient tightening be applied?",
13688 "constraints/" CONSHDLR_NAME "/normalize",
"should demands and capacity be normalized?",
13692 "should pairwise constraint comparison be performed in presolving?",
13695 "constraints/" CONSHDLR_NAME "/disjunctive",
"extract disjunctive constraints?",
13700 "number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit)?",
13703 "constraints/" CONSHDLR_NAME "/detectdisjunctive",
"search for conflict set via maximal cliques to detect disjunctive constraints",
13706 "constraints/" CONSHDLR_NAME "/detectvarbounds",
"search for conflict set via maximal cliques to detect variable bound constraints",
13711 "constraints/" CONSHDLR_NAME "/usebdwidening",
"should bound widening be used during the conflict analysis?",
13755 assert(scip != NULL);
13759 if( conshdlr == NULL )
13765 SCIPdebugMsg(scip,
"create cumulative constraint <%s> with %d jobs\n", name, nvars);
13768 SCIP_CALL(
consdataCreate(scip, &consdata, vars, NULL, durations, demands, nvars, capacity, 0, INT_MAX, check) );
13772 initial, separate, enforce, check, propagate,
13773 local, modifiable, dynamic, removable, stickingatnode) );
13782 assert(conshdlrdata != NULL);
13783 assert(conshdlrdata->eventhdlr != NULL);
13811 assert(scip != NULL);
13834 assert(consdata != NULL);
13836 assert(hmin <= consdata->hmax);
13838 consdata->hmin = hmin;
13858 assert(consdata != NULL);
13860 return consdata->hmin;
13879 assert(consdata != NULL);
13880 assert(hmax >= consdata->hmin);
13882 consdata->hmax = hmax;
13902 assert(consdata != NULL);
13904 return consdata->hmax;
13923 assert(consdata != NULL);
13925 return consdata->vars;
13944 assert(consdata != NULL);
13946 return consdata->nvars;
13965 assert(consdata != NULL);
13967 return consdata->capacity;
13986 assert(consdata != NULL);
13988 return consdata->durations;
14007 assert(consdata != NULL);
14009 return consdata->demands;
14030 assert(scip != NULL);
14031 assert(violated != NULL);
14034 violated, cons, printreason) );
14052 nchgcoefs, nchgsides) );
14071 hmin, hmax, split) );
14098 irrelevants, nfixedvars, nchgsides, cutoff) );
14102 irrelevants, nfixedvars, nchgsides, cutoff) );
14129 assert(scip != NULL);
14130 assert(cons != NULL);
14131 assert(initialized != NULL);
14132 assert(*initialized ==
FALSE);
14133 assert(cutoff != NULL);
14134 assert(*cutoff ==
FALSE);
14138 if( conshdlr == NULL )
14145 assert(conshdlrdata != NULL);
14150 nvars, vars, durations, demands, capacity, hmin, hmax, cons,
14151 nchgbds, &redundant, initialized, explanation, cutoff) );
14176 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd,
TRUE, explanation, result) );
14199 file = fopen(filename,
"w");
14210 assert(consdata != NULL);
14212 nvars = consdata->nvars;
14215 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal, NULL), TERMINATE );
14220 for( v = 0; v < nvars; ++v )
14224 var = consdata->vars[v];
14225 assert(var != NULL);
14231 else if( !consdata->downlocks[v] || !consdata->uplocks[v] )
14239 for( v = 0; v < nvars; ++v )
14245 var = consdata->vars[v];
14246 assert(var != NULL);
14251 for( b = 0; b < nvbdvars; ++b )
14255 SCIPgmlWriteArc(file, (
unsigned int)(
size_t)vbdvars[b], (
unsigned int)(
size_t)var, NULL, NULL);
14263 for( b = 0; b < nvbdvars; ++b )
14267 SCIPgmlWriteArc(file, (
unsigned int)(
size_t)var, (
unsigned int)(
size_t)vbdvars[b], NULL, NULL);
14295 if( conshdlr == NULL )
14302 assert(conshdlrdata != NULL);
14304 conshdlrdata->solveCumulative = solveCumulative;
14339 (*infeasible) =
FALSE;
14340 (*unbounded) =
FALSE;
14348 if( conshdlr == NULL )
14356 assert(conshdlrdata != NULL);
14359 if( timelimit > 0.0 && memorylimit > 10 )
14361 SCIP_CALL( conshdlrdata->solveCumulative(njobs, ests, lsts, objvals, durations, demands, capacity,
14362 hmin, hmax, timelimit, memorylimit, maxnodes, solved, infeasible, unbounded, error) );
14398 for( v = 0; v < nvars; ++v )
14400 copydemands[v] = demands[v];
14406 for( v = 0; v < nvars; ++v )
14411 assert(idx >= 0 && idx < nvars);
14414 assert(var != NULL);
14416 duration = durations[idx];
14417 assert(duration > 0);
14425 if( impliedest < impliedlct )
14431 assert(!infeasible);
14435 if( est == impliedest && lct == impliedlct )
14466 for( t = 0; t < ntimepoints - 1; ++t )
14469 if( loads[t] > capacity )
14471 assert(t == 0 || loads[t-1] <= capacity);
14472 return timepoints[t];
14496 for( t = ntimepoints - 1; t >= 0; --t )
14499 if( loads[t] > capacity )
14501 assert(t == ntimepoints-1 || loads[t+1] <= capacity);
14502 return timepoints[t+1];
enum SCIP_Result SCIP_RESULT
static SCIP_RETCODE consdataCatchEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define CONSHDLR_SEPAPRIORITY
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
int SCIPgetNCheckConss(SCIP *scip)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_Bool SCIPinRepropagation(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
static SCIP_RETCODE propagateAllConss(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS **conss, int nconss, SCIP_Bool local, int *nfixedvars, SCIP_Bool *cutoff, SCIP_Bool *branched)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
static SCIP_DECL_CONSCOPY(consCopyCumulative)
enum TCLIQUE_Status TCLIQUE_STATUS
static TCLIQUE_GETNNODES(tcliqueGetnnodesClique)
#define CONSHDLR_PROPFREQ
static int computeEnergyContribution(SCIP_BTNODE *node)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
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)
static SCIP_DECL_CONSGETVARS(consGetVarsCumulative)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
SCIP_STAGE SCIPgetStage(SCIP *scip)
static SCIP_RETCODE consdataDropAllEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
static PROPRULE inferInfoGetProprule(INFERINFO inferinfo)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
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
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)
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int demand)
static SCIP_RETCODE computeMinDistance(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int source, int sink, int *naddconss)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
void * SCIPbtnodeGetData(SCIP_BTNODE *node)
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
struct TCLIQUE_Graph TCLIQUE_GRAPH
static INFERINFO intToInferInfo(int i)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
int SCIPvarGetNVlbs(SCIP_VAR *var)
static void consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
static SCIP_DECL_CONSENFOPS(consEnfopsCumulative)
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 SCIP_RETCODE createCoverCutsTimepoint(SCIP *scip, SCIP_CONS *cons, int *startvalues, int time)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
static void addEndingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *endtimes, int *endindices, int *freecapacity, int *idx, int nvars)
SCIP_Bool SCIPvarIsInitial(SCIP_VAR *var)
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
SCIP_RETCODE SCIPincludeConshdlrCumulative(SCIP *scip)
SCIP_RETCODE SCIPcreateConsBasicCumulative(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPresetConsAge(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)
int SCIPgetHminCumulative(SCIP *scip, SCIP_CONS *cons)
static int computeOverlap(int begin, int end, int est, int lst, int duration)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE constraintNonOverlappingGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
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 void initializeLocks(SCIP_CONSDATA *consdata, SCIP_Bool locked)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
#define SCIP_CALL_FINALLY(x, y)
SCIP_VAR ** SCIPgetVarsCumulative(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_PROP_TIMING
int * SCIPgetValsLinking(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE createDisjuctiveCons(SCIP *scip, SCIP_CONS *cons, int *naddconss)
#define CONSHDLR_CHECKPRIORITY
static int inferInfoGetData1(INFERINFO inferinfo)
static SCIP_RETCODE solveIndependentCons(SCIP *scip, SCIP_CONS *cons, SCIP_Longint maxnodes, int *nchgbds, int *nfixedvars, int *ndelconss, SCIP_Bool *cutoff, SCIP_Bool *unbounded)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
static void updateKeyOnTrace(SCIP_BTNODE *node, SCIP_Real key)
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
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)
int SCIPprofileGetTime(SCIP_PROFILE *profile, int pos)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
static SCIP_RETCODE computePeak(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, int *timepoint)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
static void transitiveClosure(SCIP_Bool **adjmatrix, int *ninarcs, int *noutarcs, int nnodes)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE createCapacityRestrictionIntvars(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool lower)
void SCIPgmlWriteClosing(FILE *file)
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
void SCIPswapPointers(void **pointer1, void **pointer2)
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
static SCIP_Bool isConsIndependently(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE applyAlternativeBoundsFixing(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, int *nfixedvars, SCIP_Bool *cutoff)
static SCIP_DECL_SORTPTRCOMP(compNodeEst)
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 fixIntegerVariableLb(SCIP *scip, SCIP_VAR *var, SCIP_Bool downlock, int *nfixedvars)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
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_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE consdataFreeRows(SCIP *scip, SCIP_CONSDATA **consdata)
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_Real SCIPinfinity(SCIP *scip)
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)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
enum SCIP_Retcode SCIP_RETCODE
static SCIP_DECL_CONSEXITSOL(consExitsolCumulative)
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
static void subtractStartingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *starttimes, int *startindices, int *freecapacity, int *idx, int nvars)
SCIP_Bool SCIPexistsConsLinking(SCIP *scip, SCIP_VAR *intvar)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
int SCIPvarGetNVubs(SCIP_VAR *var)
#define SCIP_PRESOLTIMING_EXHAUSTIVE
static SCIP_RETCODE presolveConsEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *nchgcoefs, int *nchgsides, SCIP_Bool *cutoff)
static SCIP_RETCODE removeIrrelevantJobs(SCIP *scip, SCIP_CONS *cons)
int SCIPvarGetProbindex(SCIP_VAR *var)
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)
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)
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
static SCIP_RETCODE strengthenVarbounds(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *naddconss)
static SCIP_RETCODE getNodeIdx(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_VAR *var, int *idx)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
static void conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
void SCIPsortDownIntInt(int *intarray1, int *intarray2, int len)
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
#define DEFAULT_LOCALCUTS
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
static SCIP_RETCODE deleteLambdaLeaf(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int demand, int *pos, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
#define CONSHDLR_DELAYPROP
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
static SCIP_RETCODE separateCoverCutsCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
#define DEFAULT_USEBINVARS
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
static TCLIQUE_ISEDGE(tcliqueIsedgeClique)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
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)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
#define DEFAULT_COEFTIGHTENING
static SCIP_RETCODE createNodedata(SCIP *scip, SCIP_NODEDATA **nodedata)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddVarVlb(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_Bool SCIPvarIsRemovable(SCIP_VAR *var)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPisTransformed(SCIP *scip)
#define DEFAULT_TTEFCHECK
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 SCIP_DECL_CONSINITLP(consInitlpCumulative)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetHmaxCumulative(SCIP *scip, SCIP_CONS *cons, int hmax)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
#define SCIPdebugMsgPrint
int SCIPprofileGetLoad(SCIP_PROFILE *profile, int pos)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
static SCIP_DECL_CONSPRESOL(consPresolCumulative)
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_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
#define DEFAULT_NORMALIZE
#define SCIP_PRESOLTIMING_FAST
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
static SCIP_RETCODE deleteTrivilCons(SCIP *scip, SCIP_CONS *cons, int *ndelconss, SCIP_Bool *cutoff)
SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
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 removeOversizedJobs(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *nchgcoefs, int *naddconss, SCIP_Bool *cutoff)
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)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE adjustOversizedJobBounds(SCIP *scip, SCIP_CONSDATA *consdata, int pos, int *nchgbds, int *naddconss, SCIP_Bool *cutoff)
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)
static SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipCp)
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)
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)
static void freeTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
static void createSortedEventpointsSol(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices)
int SCIPgetNVarsCumulative(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPsplitCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int *hmin, int *hmax, int *split)
static SCIP_RETCODE enforceSolution(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool branch, SCIP_RESULT *result)
static SCIP_RETCODE updateEnvelop(SCIP *scip, SCIP_BTNODE *node)
static SCIP_RETCODE separateConsBinaryRepresentation(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
static SCIP_RETCODE findPrecedenceConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
static SCIP_DECL_CONSCHECK(consCheckCumulative)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_RETCODE getHighestCapacityUsage(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, int *bestcapacity)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
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)
Constraint handler for knapsack constraints of the form , x binary and .
static const NodeData nodedata[]
int SCIPcomputeHmin(SCIP *scip, SCIP_PROFILE *profile, int capacity)
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_PRESOLTIMING
#define SCIP_PRESOLTIMING_MEDIUM
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
static SCIP_RETCODE collectBranchingCands(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, int *nbranchcands)
#define CONSHDLR_DELAYSEPA
static SCIP_RETCODE findCumulativeConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
static int inferInfoGetData2(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_DECL_CONSLOCK(consLockCumulative)
SCIP_BTNODE * SCIPbtnodeGetParent(SCIP_BTNODE *node)
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, int energy, int *bestub, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE projectVbd(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph)
static SCIP_RETCODE createTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
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_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
static SCIP_RETCODE collectBinaryVars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR ***vars, int **coefs, int *nvars, int *startindices, int curtime, int nstarted, int nfinished)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyCumulative)
#define SCIPallocBuffer(scip, ptr)
int SCIPgetHmaxCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
#define SCIPfreeBufferArrayNull(scip, ptr)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static void traceLambdaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
static SCIP_RETCODE computeEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss, int *nchgsides)
const char * SCIPconsGetName(SCIP_CONS *cons)
static int computeEstOmegaset(SCIP *scip, int duration, int demand, int capacity, int est, int lct, int energy)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_RESULT *result)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
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_DECL_CONSENFORELAX(consEnforelaxCumulative)
static TCLIQUE_NEWSOL(tcliqueNewsolClique)
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 createCumulativeCons(SCIP *scip, const char *name, TCLIQUE_GRAPH *tcliquegraph, int *cliquenodes, int ncliquenodes)
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)
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)
#define CONSHDLR_MAXPREROUNDS
static SCIP_RETCODE createCoverCuts(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss, SCIP_Bool *infeasible)
static int computeTotalEnergy(int *durations, int *demands, int njobs)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
unsigned int SCIP_PRESOLTIMING
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
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)
void SCIPsortDownIntIntInt(int *intarray1, int *intarray2, int *intarray3, int len)
#define SCIPstatisticPrintf
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
static TCLIQUE_SELECTADJNODES(tcliqueSelectadjnodesClique)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
#define DEFAULT_PRESOLPAIRWISE
SCIP_RETCODE SCIPcreateConsBasicKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
#define DEFAULT_DETECTDISJUNCTIVE
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
static SCIP_DECL_CONSFREE(consFreeCumulative)
SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
static SCIP_RETCODE consCapacityConstraintsFinder(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
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 consCheckRedundancy(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *redundant)
constraint handler for linking binary variables to an integer variable
SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
#define SCIPallocBufferArray(scip, ptr, num)
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)
static void traceThetaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
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)
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
static SCIP_RETCODE consdataDropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos)
static SCIP_DECL_CONSPROP(consPropCumulative)
#define DEFAULT_DUALPRESOLVE
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)
#define DEFAULT_USEADJUSTEDJOBS
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PRESOLTIMING presoltiming, int *nchgbds, int *ndelconss, SCIP_Bool *cutoff)
void SCIPprintSysError(const char *message)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
int SCIPgetDepth(SCIP *scip)
#define DEFAULT_USECOVERCUTS
static void freeNodedata(SCIP *scip, SCIP_NODEDATA **nodedata)
SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
static SCIP_DECL_EVENTEXEC(eventExecCumulative)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
#define SCIP_DECL_CONSEXITPRE(x)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
static SCIP_RETCODE normalizeDemands(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
static SCIP_RETCODE computeCoreEngeryAfter(SCIP *scip, SCIP_PROFILE *profile, int nvars, int *ests, int *lcts, int *coreEnergyAfterEst, int *coreEnergyAfterLct)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
void SCIPbtFree(SCIP_BT **tree)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
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)
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
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_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
#define SCIP_PRESOLTIMING_ALWAYS
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
#define BMScopyMemoryArray(ptr, source, num)
int SCIPgetNRuns(SCIP *scip)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
int * SCIPgetDurationsCumulative(SCIP *scip, SCIP_CONS *cons)
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 consdataDeletePos(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons, int pos)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define CONSHDLR_NEEDSCONS
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
static SCIP_RETCODE computeImpliedEst(SCIP *scip, SCIP_VAR *var, SCIP_HASHMAP *addedvars, int *est)
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)
static SCIP_RETCODE tightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs)
static SCIP_DECL_SORTINDCOMP(consdataCompVar)
#define DEFAULT_FILLBRANCHCANDS
static SCIP_Bool checkDemands(SCIP *scip, SCIP_CONS *cons)
int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
int SCIPgetNVars(SCIP *scip)
#define DEFAULT_DETECTVARBOUNDS
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)
static SCIP_DECL_CONSENFOLP(consEnfolpCumulative)
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
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)
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)
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, int energy, int *bestlb, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
static void createSortedEventpoints(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices, SCIP_Bool local)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
void SCIPbtSetRoot(SCIP_BT *tree, SCIP_BTNODE *root)
SCIP_RETCODE SCIPsetHminCumulative(SCIP *scip, SCIP_CONS *cons, int hmin)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPcreateConsLinking(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *intvar, SCIP_VAR **binvars, int *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)
#define SCIPfreeBuffer(scip, ptr)
static SCIP_RETCODE insertThetanode(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node, SCIP_NODEDATA **nodedatas, int *nnodedatas)
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)
#define CONSHDLR_SEPAFREQ
int SCIPgetCapacityCumulative(SCIP *scip, SCIP_CONS *cons)
void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
static SCIP_RETCODE removeRedundantConss(SCIP *scip, SCIP_CONS **conss, int nconss, int *ndelconss)
static SCIP_RETCODE getActiveVar(SCIP *scip, SCIP_VAR **var, int *scalar, int *constant)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE computeAlternativeBounds(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool local, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks)
static void traceLambdaEnergy(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
SCIP_Longint SCIPgetMemUsed(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)
static SCIP_DECL_CONSPRINT(consPrintCumulative)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
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)
static SCIP_RETCODE consdataCollectLinkingCons(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
static SCIP_RETCODE initializeDurations(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
SCIP_RETCODE SCIPgetBinvarsLinking(SCIP *scip, SCIP_CONS *cons, SCIP_VAR ***binvars, int *nbinvars)
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnvelop(SCIP_BTNODE *node)
int SCIPgetNConss(SCIP *scip)
static SCIP_RETCODE constructIncompatibilityGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
static SCIP_RETCODE moveNodeToLambda(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define DEFAULT_CUTSASCONSS
static int computeCoreWithInterval(int begin, int end, int ect, int lst)
static void collectThetaSubtree(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
SCIP_Bool SCIPallowDualReds(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
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)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
static SCIP_RETCODE normalizeCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int *capacity, int *nchgcoefs, int *nchgsides)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateWorstCaseProfile(SCIP *scip, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands)
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)
int * SCIPgetDemandsCumulative(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSSEPASOL(consSepasolCumulative)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
static SCIP_RETCODE applyAlternativeBoundsBranching(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, SCIP_Bool *branched)
static SCIP_DECL_CONSPARSE(consParseCumulative)
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_DECL_CONSTRANS(consTransCumulative)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
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)
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
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 fixIntegerVariableUb(SCIP *scip, SCIP_VAR *var, SCIP_Bool uplock, int *nfixedvars)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
#define DEFAULT_TTEFINFER
void SCIPsortInt(int *intarray, int len)
static SCIP_RETCODE createPrecedenceCons(SCIP *scip, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, int distance)
static INFERINFO getInferInfo(PROPRULE proprule, int data1, int data2)
int SCIPvarGetIndex(SCIP_VAR *var)
static SCIP_RETCODE detectRedundantConss(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS **conss, int nconss, int *naddconss)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
static SCIP_RETCODE varMayRoundUp(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
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_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
static SCIP_RETCODE separateConsOnIntegerVariables(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool lower, SCIP_Bool *separated)
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)
static void consdataCalcSignature(SCIP_CONSDATA *consdata)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
static SCIP_RETCODE createCapacityRestriction(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool cutsasconss)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
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_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
static SCIP_Bool impliesVlbPrecedenceCondition(SCIP *scip, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconst, int duration)
#define DEFAULT_DISJUNCTIVE
SCIP_CONS * SCIPgetConsLinking(SCIP *scip, SCIP_VAR *intvar)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
int SCIPcomputeHmax(SCIP *scip, SCIP_PROFILE *profile, int capacity)
#define BMSclearMemoryArray(ptr, num)
#define DEFAULT_USEBDWIDENING
static SCIP_RETCODE tightenCapacity(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
SCIP_RETCODE SCIPcreateConsBasicSetpart(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
void SCIPswapInts(int *value1, int *value2)
SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
static SCIP_RETCODE collectDemands(SCIP *scip, SCIP_CONSDATA *consdata, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Longint **demands, int *ndemands)
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_DECL_CONSINITPRE(consInitpreCumulative)
static SCIP_DECL_CONSGETNVARS(consGetNVarsCumulative)
static SCIP_RETCODE computeImpliedLct(SCIP *scip, SCIP_VAR *var, int duration, SCIP_HASHMAP *addedvars, int *lct)
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
static SCIP_DECL_CONSDELETE(consDeleteCumulative)
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
SCIP_RETCODE SCIPvisualizeConsCumulative(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnergy(SCIP_BTNODE *node)
static SCIP_DECL_CONSSEPALP(consSepalpCumulative)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated, SCIP_Bool printreason)
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
static int inferInfoToInt(INFERINFO inferinfo)
static TCLIQUE_GETWEIGHTS(tcliqueGetweightsClique)
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 SCIPsetSolveCumulative(SCIP *scip, SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)))
static SCIP_DECL_CONSRESPROP(consRespropCumulative)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
static SCIP_RETCODE varMayRoundDown(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
void SCIPprofileFree(SCIP_PROFILE **profile)
#define CONSHDLR_ENFOPRIORITY
SCIP_RETCODE SCIPfree(SCIP **scip)
#define SCIPreallocBufferArray(scip, ptr, num)
static SCIP_Bool impliesVubPrecedenceCondition(SCIP *scip, SCIP_VAR *var, SCIP_Real vubcoef, SCIP_Real vubconst, int duration)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)