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];
1236 (*infeasible) =
FALSE;
1237 (*unbounded) =
FALSE;
1240 SCIPdebugMessage(
"solve independent cumulative condition with %d variables\n", njobs);
1254 for( v = 0; v < njobs; ++v )
1261 if( objvals ==
NULL )
1264 objval = objvals[v];
1272 njobs, subvars, durations, demands, capacity) );
1319 (*infeasible) =
TRUE;
1323 (*unbounded) =
TRUE;
1332 assert(sol !=
NULL);
1334 for( v = 0; v < njobs; ++v )
1350 for( v = 0; v < njobs; ++v )
1370 for( v = 0; v < njobs; ++v )
1399 (*infeasible) =
FALSE;
1400 (*unbounded) =
FALSE;
1403 SCIPdebugMsg(scip,
"solve independent cumulative condition with %d variables\n", njobs);
1422 for( v = 0; v < njobs; ++v )
1430 if( objvals ==
NULL )
1433 objval = objvals[v];
1439 timeinterval = lst - est + 1;
1440 assert(timeinterval > 0);
1443 minest =
MIN(minest, est);
1444 maxlct =
MAX(maxlct, lst + durations[v]);
1453 for( t = 0; t < timeinterval; ++t )
1466 binvars[v][t] = binvar;
1475 hmin =
MAX(hmin, minest);
1476 hmax =
MIN(hmax, maxlct);
1477 assert(hmin > INT_MIN);
1478 assert(hmax < INT_MAX);
1479 assert(hmin < hmax);
1482 for( t = hmin; t < hmax; ++t )
1493 for( v = 0; v < njobs; ++v )
1506 duration = durations[v];
1507 assert(duration > 0);
1510 if( t < est || t >= lst + duration )
1513 demand = demands[v];
1514 assert(demand >= 0);
1516 start =
MAX(t - duration + 1, est);
1519 assert(start <= end);
1521 for( k = start; k <= end; ++k )
1523 assert(binvars[v][k] !=
NULL);
1558 (*infeasible) =
TRUE;
1562 (*unbounded) =
TRUE;
1570 assert(sol !=
NULL);
1572 for( v = 0; v < njobs; ++v )
1582 timeinterval = lst - est + 1;
1585 for( t = 0; t < timeinterval; ++t )
1605 for( v = 0; v < njobs; ++v )
1615 timeinterval = lst - est + 1;
1618 for( t = 0; t < timeinterval; ++t )
1628 for( t = timeinterval - 1; t >= 0; --t )
1651 for( v = 0; v < njobs; ++v )
1661 timeinterval = lst - est + 1;
1663 for( t = 0; t < timeinterval; ++t )
1697 assert(scip !=
NULL);
1698 assert(conshdlrdata !=
NULL);
1699 assert(eventhdlr !=
NULL);
1704 (*conshdlrdata)->eventhdlr = eventhdlr;
1707 (*conshdlrdata)->solveCumulative = solveCumulativeViaScipCp;
1709 #ifdef SCIP_STATISTIC 1710 (*conshdlrdata)->nlbtimetable = 0;
1711 (*conshdlrdata)->nubtimetable = 0;
1712 (*conshdlrdata)->ncutofftimetable = 0;
1713 (*conshdlrdata)->nlbedgefinder = 0;
1714 (*conshdlrdata)->nubedgefinder = 0;
1715 (*conshdlrdata)->ncutoffedgefinder = 0;
1716 (*conshdlrdata)->ncutoffoverload = 0;
1717 (*conshdlrdata)->ncutoffoverloadTTEF = 0;
1719 (*conshdlrdata)->nirrelevantjobs = 0;
1720 (*conshdlrdata)->nalwaysruns = 0;
1721 (*conshdlrdata)->nremovedlocks = 0;
1722 (*conshdlrdata)->ndualfixs = 0;
1723 (*conshdlrdata)->ndecomps = 0;
1724 (*conshdlrdata)->ndualbranchs = 0;
1725 (*conshdlrdata)->nallconsdualfixs = 0;
1726 (*conshdlrdata)->naddedvarbounds = 0;
1727 (*conshdlrdata)->naddeddisjunctives = 0;
1740 assert(conshdlrdata !=
NULL);
1741 assert(*conshdlrdata !=
NULL);
1764 assert(scip !=
NULL);
1765 assert(consdata !=
NULL);
1766 assert(eventhdlr !=
NULL);
1769 for( v = 0; v < consdata->nvars; ++v )
1787 assert(scip !=
NULL);
1788 assert(consdata !=
NULL);
1789 assert(eventhdlr !=
NULL);
1790 assert(0 <= pos && pos < consdata->nvars);
1791 assert(consdata->vars[pos] !=
NULL);
1809 assert(scip !=
NULL);
1810 assert(consdata !=
NULL);
1813 for( v = 0; v < consdata->nvars; ++v )
1831 nvars = consdata->nvars;
1834 for( v = 0; v < nvars; ++v )
1836 consdata->downlocks[v] = locked;
1837 consdata->uplocks[v] = locked;
1859 assert(scip !=
NULL);
1860 assert(consdata !=
NULL);
1861 assert(vars !=
NULL || nvars > 0);
1862 assert(demands !=
NULL);
1863 assert(durations !=
NULL);
1864 assert(capacity >= 0);
1866 assert(hmin < hmax);
1871 (*consdata)->hmin = hmin;
1872 (*consdata)->hmax = hmax;
1874 (*consdata)->capacity = capacity;
1875 (*consdata)->demandrows =
NULL;
1876 (*consdata)->demandrowssize = 0;
1877 (*consdata)->ndemandrows = 0;
1878 (*consdata)->scoverrows =
NULL;
1879 (*consdata)->nscoverrows = 0;
1880 (*consdata)->scoverrowssize = 0;
1881 (*consdata)->bcoverrows =
NULL;
1882 (*consdata)->nbcoverrows = 0;
1883 (*consdata)->bcoverrowssize = 0;
1884 (*consdata)->nvars = nvars;
1885 (*consdata)->varssize = nvars;
1886 (*consdata)->signature = 0;
1887 (*consdata)->validsignature =
FALSE;
1888 (*consdata)->normalized =
FALSE;
1889 (*consdata)->covercuts =
FALSE;
1890 (*consdata)->propagated =
FALSE;
1891 (*consdata)->varbounds =
FALSE;
1892 (*consdata)->triedsolving =
FALSE;
1896 assert(vars !=
NULL);
1901 (*consdata)->linkingconss =
NULL;
1909 if( linkingconss !=
NULL )
1917 SCIPdebugMsg(scip,
"get tranformed variables and constraints\n");
1925 for( v = 0; v < nvars; ++v )
1930 if( linkingconss !=
NULL )
1935 for( v = 0; v < nvars; ++v )
1936 assert(
SCIPgetConsLinking(scip, (*consdata)->vars[v]) == (*consdata)->linkingconss[v]);
1942 (*consdata)->vars =
NULL;
1943 (*consdata)->downlocks =
NULL;
1944 (*consdata)->uplocks =
NULL;
1945 (*consdata)->demands =
NULL;
1946 (*consdata)->durations =
NULL;
1947 (*consdata)->linkingconss =
NULL;
1951 (*consdata)->resstrength1 = -1.0;
1952 (*consdata)->resstrength2 = -1.0;
1953 (*consdata)->cumfactor1 = -1.0;
1954 (*consdata)->disjfactor1 = -1.0;
1955 (*consdata)->disjfactor2 = -1.0;
1956 (*consdata)->estimatedstrength = -1.0;
1972 assert(consdata !=
NULL);
1973 assert(*consdata !=
NULL);
1975 for( r = 0; r < (*consdata)->ndemandrows; ++r )
1977 assert((*consdata)->demandrows[r] !=
NULL);
1983 (*consdata)->ndemandrows = 0;
1984 (*consdata)->demandrowssize = 0;
1987 for( r = 0; r < (*consdata)->nscoverrows; ++r )
1989 assert((*consdata)->scoverrows[r] !=
NULL);
1995 (*consdata)->nscoverrows = 0;
1996 (*consdata)->scoverrowssize = 0;
1998 for( r = 0; r < (*consdata)->nbcoverrows; ++r )
2000 assert((*consdata)->bcoverrows[r] !=
NULL);
2006 (*consdata)->nbcoverrows = 0;
2007 (*consdata)->bcoverrowssize = 0;
2009 (*consdata)->covercuts =
FALSE;
2024 assert(consdata !=
NULL);
2025 assert(*consdata !=
NULL);
2027 nvars = (*consdata)->nvars;
2028 varssize = (*consdata)->varssize;
2038 if( (*consdata)->linkingconss !=
NULL )
2040 for( v = nvars-1; v >= 0; --v )
2042 assert((*consdata)->linkingconss[v] !=
NULL );
2073 assert(consdata !=
NULL);
2078 for( v = 0; v < consdata->nvars; ++v )
2080 assert(consdata->vars[v] !=
NULL);
2085 consdata->durations[v], consdata->demands[v]);
2087 SCIPinfoMessage(scip, file,
")[%d,%d) <= %d", consdata->hmin, consdata->hmax, consdata->capacity);
2102 assert(scip !=
NULL);
2103 assert(consdata !=
NULL);
2104 assert(cons !=
NULL);
2108 SCIPdebugMsg(scip,
"cumulative constraint <%s>: remove variable <%s>\n",
2114 consdata->downlocks[pos] =
FALSE;
2115 consdata->uplocks[pos] =
FALSE;
2117 if( consdata->linkingconss !=
NULL )
2124 assert(conshdlr !=
NULL);
2126 assert(conshdlrdata !=
NULL);
2127 assert(conshdlrdata->eventhdlr !=
NULL);
2132 SCIPdebugMsg(scip,
"remove variable <%s>[%g,%g] from cumulative constraint <%s>\n",
2139 if( pos != consdata->nvars - 1 )
2141 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
2142 consdata->downlocks[pos] = consdata->downlocks[consdata->nvars-1];
2143 consdata->uplocks[pos] = consdata->uplocks[consdata->nvars-1];
2144 consdata->demands[pos] = consdata->demands[consdata->nvars-1];
2145 consdata->durations[pos] = consdata->durations[consdata->nvars-1];
2147 if( consdata->linkingconss !=
NULL )
2149 consdata->linkingconss[pos]= consdata->linkingconss[consdata->nvars-1];
2154 consdata->validsignature =
FALSE;
2155 consdata->normalized =
FALSE;
2170 assert(scip !=
NULL);
2171 assert(consdata !=
NULL);
2173 nvars = consdata->nvars;
2175 assert(consdata->linkingconss ==
NULL);
2179 for( v = 0; v < nvars; ++v )
2184 var = consdata->vars[v];
2185 assert(var !=
NULL);
2200 consdata->linkingconss[v] = cons;
2209 assert(consdata->linkingconss[v] !=
NULL);
2244 int* startsolvalues;
2254 assert(scip !=
NULL);
2255 assert(violated !=
NULL);
2257 (*violated) =
FALSE;
2262 assert(vars !=
NULL);
2263 assert(demands !=
NULL);
2264 assert(durations !=
NULL);
2273 for ( j = 0; j < nvars; ++j )
2285 startsolvalues[j] =
MAX(solvalue, hmin);
2286 startindices[j] = j;
2288 endsolvalues[j] =
MAX(solvalue + durations[j], hmin);
2299 freecapacity = capacity;
2302 for( j = 0; j < nvars; ++j )
2305 curtime = startsolvalues[j];
2307 if( curtime >= hmax )
2311 freecapacity -= demands[startindices[j]];
2312 while( j+1 < nvars && startsolvalues[j+1] == curtime )
2315 freecapacity -= demands[startindices[j]];
2319 while( endindex < nvars && curtime >= endsolvalues[endindex] )
2321 freecapacity += demands[endindices[endindex]];
2324 assert(freecapacity <= capacity);
2327 if( freecapacity < 0 && curtime >= hmin )
2329 SCIPdebugMsg(scip,
"freecapacity = %3d\n", freecapacity);
2341 ";\nviolation: at time point %d available capacity = %d, needed capacity = %d\n",
2342 curtime, capacity, capacity - freecapacity);
2344 for( i = 0; i <= j; ++i )
2346 if( startsolvalues[i] + durations[startindices[i]] > curtime )
2349 SCIPvarGetName(vars[startindices[i]]), startsolvalues[i], durations[startindices[i]],
2350 demands[startindices[i]]);
2381 assert(scip !=
NULL);
2382 assert(cons !=
NULL);
2383 assert(violated !=
NULL);
2388 assert(consdata !=
NULL);
2392 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
2393 violated, cons, printreason) );
2437 SCIPdebugMsg(scip,
"variable <%s>: (demand %d) resolve propagation of core time algorithm (peak %d)\n",
2442 capacity -= inferdemand;
2452 for( j = 0; j < nvars && capacity >= 0; ++j )
2455 assert(var !=
NULL);
2458 if( var == infervar )
2461 duration = durations[j];
2462 assert(duration > 0);
2470 SCIPdebugMsg(scip,
"variable <%s>: glb=[%g,%g] conflict=[%g,%g] (duration %d, demand %d)\n",
2480 if( inferpeak < ect && lst <= inferpeak )
2482 capacity -= demands[j];
2485 maxlst =
MAX(maxlst, lst);
2486 minect =
MIN(minect, ect);
2487 assert(maxlst < minect);
2489 if( explanation !=
NULL )
2490 explanation[j] =
TRUE;
2507 if( inferpeak < ect && lst <= inferpeak )
2509 capacity -= demands[j];
2512 maxlst =
MAX(maxlst, lst);
2513 minect =
MIN(minect, ect);
2514 assert(maxlst < minect);
2516 if( explanation !=
NULL )
2517 explanation[j] =
TRUE;
2533 for( j = 0; j < nvars; ++j )
2536 assert(var !=
NULL);
2539 if( var == infervar || reported[j] )
2542 duration = durations[j];
2543 assert(duration > 0);
2555 SCIPdebugMsg(scip,
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
2560 if( inferpeak < ect && lst <= inferpeak )
2563 canddemands[ncands] = demands[j];
2566 capacity -= demands[j];
2573 assert(capacity < 0);
2577 while( capacity + canddemands[ncands-1] < 0 )
2580 capacity += canddemands[ncands];
2585 for( c = 0; c < ncands; ++c )
2587 var = vars[cands[c]];
2588 assert(var !=
NULL);
2590 duration = durations[cands[c]];
2595 maxlst =
MAX(maxlst, lst);
2596 minect =
MIN(minect, ect);
2597 assert(maxlst < minect);
2600 SCIPdebugMsg(scip,
"infer peak %d, relaxed peak %d, lst %d, ect %d\n", inferpeak, relaxedpeak, maxlst, minect);
2601 assert(inferpeak >= maxlst);
2602 assert(inferpeak < minect);
2605 if( relaxedpeak < inferpeak )
2607 inferpeak =
MAX(maxlst, relaxedpeak);
2609 else if( relaxedpeak > inferpeak )
2611 inferpeak =
MIN(minect-1, relaxedpeak);
2613 assert(inferpeak >= hmin);
2614 assert(inferpeak < hmax);
2615 assert(inferpeak >= maxlst);
2616 assert(inferpeak < minect);
2619 for( c = 0; c < ncands; ++c )
2621 var = vars[cands[c]];
2622 assert(var !=
NULL);
2626 duration = durations[cands[c]];
2637 if( explanation !=
NULL )
2638 explanation[cands[c]] =
TRUE;
2647 if( provedpeak !=
NULL )
2648 *provedpeak = inferpeak;
2666 INFERINFO inferinfo,
2679 assert(scip !=
NULL);
2699 for( j = 0; j < nvars; ++j )
2709 assert(var !=
NULL);
2711 if( var == infervar )
2713 if( explanation !=
NULL )
2714 explanation[j] =
TRUE;
2722 duration = durations[j];
2723 assert(duration > 0);
2728 left = (est == hmin && lb + duration > hmin) || lb >= est;
2733 right = (lct == hmax && ub < hmax) || ub + duration <= lct;
2750 if( explanation !=
NULL )
2751 explanation[j] =
TRUE;
2774 ect = est + duration;
2775 lct = lst + duration;
2778 if( lct <= end && est >= begin )
2781 assert(lst <= end && ect >= begin);
2789 return MIN3(left, right, end - begin);
2827 requiredenergy = (end - begin) * capacity;
2829 SCIPdebugMsg(scip,
"analysis energy load in [%d,%d) (capacity %d, energy %d)\n", begin, end, capacity, requiredenergy);
2834 for( v = 0; v < nvars; ++v )
2844 assert(var !=
NULL);
2850 demand = demands[v];
2853 duration = durations[v];
2854 assert(duration > 0);
2857 if( infervar == var )
2865 SCIPdebugMsg(scip,
"inference variable <%s>[%g,%g] %s %g (duration %d, demand %d)\n",
2888 right = MIN3(end - lst, end - begin, duration);
2894 assert(begin <= lct);
2898 left =
MIN(lct - begin + 1, end - begin);
2902 overlap =
MIN(left, right);
2903 assert(overlap > 0);
2904 assert(overlap <= end - begin);
2905 assert(overlap <= duration);
2930 assert(ect > begin);
2935 left = MIN3(ect - begin, end - begin, duration);
2945 right =
MIN(end - est + 1, end - begin);
2949 overlap =
MIN(left, right);
2950 assert(overlap > 0);
2951 assert(overlap <= end - begin);
2952 assert(overlap <= duration);
2966 requiredenergy -= overlap * demand;
2968 if( explanation !=
NULL )
2969 explanation[v] =
TRUE;
2983 if( est + duration > begin && lst < end )
2986 glbenergy =
computeOverlap(begin, end, est, lst, duration) * demand;
2989 requiredenergy -= glbenergy;
2991 if( explanation !=
NULL )
2992 explanation[v] =
TRUE;
3002 if( est + duration > begin && lst < end )
3007 locenergies[v] = overlaps[v] * demand - glbenergy;
3008 assert(locenergies[v] >= 0);
3016 for( v = 0; v < nvars && requiredenergy >= 0; ++v )
3026 assert(idx >= 0 && idx < nvars);
3029 assert(var !=
NULL);
3030 assert(var != infervar);
3032 duration = durations[idx];
3033 assert(duration > 0);
3035 overlap = overlaps[v];
3036 assert(overlap > 0);
3038 requiredenergy -= locenergies[v];
3040 if( requiredenergy < -1 )
3044 demand = demands[idx];
3047 overlap += (int)((requiredenergy + 1) / demand);
3050 requiredenergy += locenergies[v];
3051 requiredenergy -= overlap * demand;
3052 assert(requiredenergy < 0);
3055 assert(overlap > 0);
3057 relaxlb = begin - duration + overlap;
3058 relaxub = end - overlap;
3060 SCIPdebugMsg(scip,
"variable <%s> glb=[%g,%g] loc=[%g,%g], conf=[%g,%g], added=[%d,%d] (demand %d, duration %d)\n",
3065 relaxlb, relaxub, demands[idx], duration);
3070 if( explanation !=
NULL )
3071 explanation[idx] =
TRUE;
3074 assert(requiredenergy < 0);
3095 INFERINFO inferinfo,
3117 if( inferpos >= nvars || vars[inferpos] != infervar )
3120 for( inferpos = 0; inferpos < nvars && vars[inferpos] != infervar; ++inferpos )
3123 assert(inferpos < nvars);
3124 assert(vars[inferpos] == infervar);
3126 inferdemand = demands[inferpos];
3127 inferduration = durations[inferpos];
3136 SCIPdebugMsg(scip,
"variable <%s>: upper bound changed from %g to %g (relaxed %g)\n",
3149 relaxedpeak =
MIN(relaxedpeak, hmax-1);
3155 relaxedpeak =
MAX(relaxedpeak, inferpeak);
3156 assert(relaxedpeak >= inferpeak);
3157 assert(relaxedpeak >= hmin);
3163 SCIPdebugMsg(scip,
"variable <%s>: lower bound changed from %g to %g (relaxed %g)\n",
3176 relaxedpeak =
MAX(relaxedpeak, hmin);
3182 relaxedpeak =
MIN(relaxedpeak, inferpeak);
3183 assert(relaxedpeak < hmax);
3188 infervar, inferdemand, inferpeak, relaxedpeak, bdchgidx, usebdwidening, &provedpeak, explanation) );
3217 if( explanation !=
NULL )
3218 explanation[inferpos] =
TRUE;
3230 assert(begin < end);
3232 begin =
MAX(begin, hmin);
3233 end =
MIN(end, hmax);
3236 begin, end, infervar, boundtype, bdchgidx, relaxedbd, usebdwidening, explanation) );
3266 int* alternativelbs,
3267 int* alternativeubs,
3275 for( v = 0; v < nvars; ++v )
3281 assert(var !=
NULL);
3291 if( alternativelbs[v] <= ub )
3309 if( alternativeubs[v] >= lb )
3338 #if defined SCIP_DEBUG && !defined NDEBUG 3341 assert(idx !=
NULL);
3344 assert(idx !=
NULL);
3347 assert(starttimes !=
NULL);
3348 assert(starttimes !=
NULL);
3349 assert(freecapacity !=
NULL);
3350 assert(starttimes[*idx] == curtime);
3351 assert(consdata->demands !=
NULL);
3352 assert(freecapacity != idx);
3355 (*freecapacity) -= consdata->demands[startindices[*idx]];
3357 while( (*idx)+1 < nvars && starttimes[(*idx)+1] == curtime )
3360 (*freecapacity) -= consdata->demands[startindices[(*idx)]];
3361 assert(freecapacity != idx);
3364 assert(oldidx <= *idx);
3380 #if defined SCIP_DEBUG && !defined NDEBUG 3386 while( endtimes[*idx] <= curtime && *idx < nvars)
3388 (*freecapacity) += consdata->demands[endindices[*idx]];
3393 assert(oldidx <= *idx);
3421 assert(consdata !=
NULL);
3423 nvars = consdata->nvars;
3426 *timepoint = consdata->hmax;
3428 assert(consdata->vars !=
NULL);
3437 starttimes, endtimes, startindices, endindices);
3440 freecapacity = consdata->capacity;
3441 hmin = consdata->hmin;
3442 hmax = consdata->hmax;
3445 for( j = 0; j < nvars; ++j )
3447 curtime = starttimes[j];
3448 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
3450 if( curtime >= hmax )
3457 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
3459 assert(freecapacity <= consdata->capacity);
3460 assert(endindex <= nvars);
3466 if( freecapacity < 0 && curtime >= hmin )
3468 *timepoint = curtime;
3495 assert(scip !=
NULL);
3496 assert(conss !=
NULL);
3500 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3502 assert(scip !=
NULL);
3503 assert(conss !=
NULL);
3505 for( c = 0; c < nconss; ++c )
3514 assert(cons !=
NULL);
3520 assert(consdata !=
NULL);
3525 if( curtime < consdata->hmin || curtime >= consdata->hmax )
3529 for( j = 0; j < consdata->nvars; ++j )
3535 var = consdata->vars[j];
3536 assert(var !=
NULL);
3545 if( lb <= curtime && ub + consdata->durations[j] > curtime && lb < ub )
3551 score =
MIN(solval - lb, ub - solval) / ((
SCIP_Real)ub-lb);
3564 SCIPdebugMsg(scip,
"found %d branching candidates\n", *nbranchcands);
3587 if( nbranchcands > 0 )
3598 for( c = 0; c < nconss && !violated; ++c )
3603 assert(cons !=
NULL);
3637 assert(consdata !=
NULL);
3639 nvars = consdata->nvars;
3640 vars = consdata->vars;
3641 downlocks = consdata->downlocks;
3642 uplocks = consdata->uplocks;
3645 for( v = 0; v < nvars; ++v )
3650 assert(var !=
NULL);
3688 assert(scip !=
NULL);
3709 if( ncheckconss == 1 )
3754 assert(consdata !=
NULL);
3759 if( consdata->triedsolving )
3769 consdata->triedsolving =
TRUE;
3771 SCIPdebugMsg(scip,
"the cumulative constraint <%s> is independent from rest of the problem (%d variables, %d constraints)\n",
3775 nvars = consdata->nvars;
3776 vars = consdata->vars;
3782 for( v = 0; v < nvars; ++v )
3790 assert(var !=
NULL);
3813 consdata->hmin, consdata->hmax, timelimit, memorylimit, maxnodes, &solved, cutoff, unbounded, &error) );
3815 if( !(*cutoff) && !(*unbounded) && !error )
3823 for( v = 0; v < nvars; ++v )
3826 if( lbs[v] + 0.5 > ubs[v] )
3829 assert(!infeasible);
3834 consdata->triedsolving =
FALSE;
3840 assert(!infeasible);
3845 consdata->triedsolving =
FALSE;
3849 assert(!infeasible);
3854 consdata->triedsolving =
FALSE;
3896 SCIPdebugMsg(scip,
"detected infeasibility due to adding a core to the core resource profile\n");
3906 infervar, inferdemand, inferpeak, inferpeak,
NULL, usebdwidening,
NULL, explanation) );
3922 *initialized =
TRUE;
3964 assert(var !=
NULL);
3966 duration = durations[idx];
3967 assert(duration > 0);
3969 demand = demands[idx];
3981 SCIPdebugMsg(scip,
"propagate earliest start time (lower bound) (pos %d)\n", pos);
3986 INFERINFO inferinfo;
3996 assert(pos == tmppos);
3999 ect = est + duration;
4026 newlb =
MIN(newlb, ect);
4035 var, duration, demand, newlb-1, usebdwidening, initialized, explanation) );
4037 if( explanation !=
NULL )
4038 explanation[idx] =
TRUE;
4053 assert(!(*infeasible));
4068 assert(est >= newlb);
4107 assert(var !=
NULL);
4108 assert(duration > 0);
4120 lct = lst + duration;
4128 SCIPdebugMsg(scip,
"propagate upper bound (pos %d)\n", pos);
4137 INFERINFO inferinfo;
4149 assert(pos == tmppos);
4177 newub =
MAX(newub, lst) - duration;
4178 assert(newub >= est);
4188 assert(!infeasible);
4203 assert(lst <= newub);
4204 lct = lst + duration;
4227 int* coreEnergyAfterEst,
4228 int* coreEnergyAfterLct
4237 t = ntimepoints - 1;
4241 for( v = nvars-1; v >= 0; --v )
4259 coreEnergyAfterEst[v] = energy;
4262 t = ntimepoints - 1;
4266 for( v = nvars-1; v >= 0; --v )
4284 coreEnergyAfterLct[v] = energy;
4311 for( v = 0; v < nvars; ++ v)
4322 duration = durations[v];
4323 assert(duration > 0);
4327 ect = est + duration;
4328 lct = lst + duration;
4339 leftadjust =
MAX(0, hmin - est);
4342 rightadjust =
MAX(0, lct - hmax);
4345 flexenergies[v] = duration - leftadjust - rightadjust - core;
4346 flexenergies[v] =
MAX(0, flexenergies[v]);
4347 flexenergies[v] *= demands[v];
4348 assert(flexenergies[v] >= 0);
4351 ects[v] =
MIN(ect, lst);
4354 lsts[v] =
MAX(ect, lst);
4388 assert(begin >= hmin);
4389 assert(end <= hmax);
4392 if( !conshdlrdata->ttefinfer )
4396 if( est >= end || ect <= begin )
4402 if( est >= begin && ect <= end )
4408 if( energy >= demand * (
MAX(begin, est) -
MIN(end, ect)) )
4423 newlb = end - energy / demand;
4428 if( newlb > lct - duration )
4450 (*initialized) =
TRUE;
4455 else if( newlb > (*bestlb) )
4457 INFERINFO inferinfo;
4459 assert(newlb > begin);
4501 assert(begin >= hmin);
4502 assert(end <= hmax);
4503 assert(est < begin);
4506 if( !conshdlrdata->ttefinfer )
4510 if( lst >= end || lct <= begin )
4516 if( lst >= begin && lct <= end )
4520 if( energy >= demand * (
MIN(end, lct) -
MAX(begin, lst)) )
4530 assert(energy >= 0);
4537 newub = begin - duration + energy / demand;
4564 (*initialized) =
TRUE;
4569 else if( newub < (*bestub) )
4571 INFERINFO inferinfo;
4573 assert(newub < begin);
4606 int* coreEnergyAfterEst,
4607 int* coreEnergyAfterLct,
4613 int coreEnergyAfterEnd;
4628 for( v = 0; v < nvars; ++v )
4633 est =
MIN(est, start);
4634 lct =
MAX(lct, end);
4638 hmin =
MAX(hmin, est);
4639 hmax =
MIN(hmax, lct);
4642 coreEnergyAfterEnd = -1;
4644 maxavailable = (hmax - hmin) * capacity;
4645 minavailable = maxavailable;
4649 if( (lcts[0] - ests[nvars-1]) * capacity >= totalenergy )
4657 for( v = nvars-1; v >= 0 && !(*cutoff); --v )
4676 assert(v == 0 || lcts[v-1] <= lcts[v]);
4692 if( !conshdlrdata->ttefinfer && end <= hmax && minavailable < maxavailable )
4696 assert(coreEnergyAfterLct[v] >= coreEnergyAfterEnd);
4697 assert(coreEnergyAfterEnd >= 0);
4700 freeenergy = capacity * (end - lct) - coreEnergyAfterLct[v] + coreEnergyAfterEnd;
4702 if( freeenergy <= minavailable )
4704 SCIPdebugMsg(scip,
"skip latest completion time <%d> (minimum available energy <%d>, free energy <%d>)\n", lct, minavailable, freeenergy);
4709 SCIPdebugMsg(scip,
"check intervals ending with <%d>\n", lct);
4712 coreEnergyAfterEnd = coreEnergyAfterLct[v];
4715 minavailable = maxavailable;
4724 for( i = nests-1; i >= 0; --i )
4736 assert(idx < nvars);
4754 if( (end - est) * capacity >= totalenergy )
4758 assert(var !=
NULL);
4760 duration = durations[idx];
4761 assert(duration > 0);
4763 demand = demands[idx];
4774 assert(est <= minbegin);
4775 if( minavailable < maxavailable && est < minbegin )
4781 var, duration, demand, est, lst, lct, minbegin, end, minavailable, &(newubs[idx]), &(ubinferinfos[idx]),
4782 initialized, explanation, cutoff) );
4788 SCIPdebugMsg(scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, lst of free part <%d>\n",
4804 assert(lst >= begin);
4805 assert(flexenergies[idx] >= 0);
4806 flexenergy += flexenergies[idx];
4819 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (end - lst)));
4820 assert(end - lst < duration);
4821 assert(energy >= 0);
4824 flexenergy += energy;
4827 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
4828 assert(candenergy >= 0);
4831 if( candenergy > lbenergy )
4833 lbenergy = candenergy;
4838 SCIPdebugMsg(scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
4839 assert(coreEnergyAfterEst[i] >= coreEnergyAfterEnd);
4842 freeenergy = capacity * (end - begin) - flexenergy - coreEnergyAfterEst[i] + coreEnergyAfterEnd;
4845 if( freeenergy < 0 )
4847 SCIPdebugMsg(scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
4857 conshdlrdata->usebdwidening, explanation) );
4859 (*initialized) =
TRUE;
4871 if( lbenergy > 0 && freeenergy < lbenergy )
4883 newlb = end - (int)(energy / demands[lbcand]);
4895 relaxedbd = lst + 1.0;
4902 conshdlrdata->usebdwidening, explanation) );
4904 (*initialized) =
TRUE;
4910 else if( newlb > newlbs[lbcand] )
4912 INFERINFO inferinfo;
4919 newlbs[lbcand] = newlb;
4924 if( minavailable > freeenergy )
4926 minavailable = freeenergy;
4929 assert(minavailable >= 0);
4957 int* coreEnergyAfterEst,
4958 int* coreEnergyAfterLct,
4964 int coreEnergyAfterStart;
4985 for( v = 0; v < nvars; ++v )
4990 minest =
MIN(minest, start);
4991 maxlct =
MAX(maxlct, end);
4995 hmin =
MAX(hmin, minest);
4996 hmax =
MIN(hmax, maxlct);
4998 maxavailable = (hmax - hmin) * capacity;
5002 if( (lcts[0] - ests[nvars-1]) * capacity >= totalenergy )
5010 for( v = 0; v < nvars; ++v )
5037 assert(est > begin);
5039 SCIPdebugMsg(scip,
"check intervals starting with <%d>\n", est);
5042 coreEnergyAfterStart = coreEnergyAfterEst[v];
5045 minavailable = maxavailable;
5053 for( i = nlcts; i < nvars; ++i )
5065 assert(idx < nvars);
5083 if( (lct - begin) * capacity >= totalenergy )
5087 assert(var !=
NULL);
5089 duration = durations[idx];
5090 assert(duration > 0);
5092 demand = demands[idx];
5103 assert(lct >= minend);
5104 if( minavailable < maxavailable && lct > minend )
5110 var, duration, demand, est, ect, lct, begin, minend, minavailable, &(newlbs[idx]), &(lbinferinfos[idx]),
5111 initialized, explanation, cutoff) );
5117 SCIPdebugMsg(scip,
"check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, ect of free part <%d>\n",
5134 assert(flexenergies[idx] >= 0);
5135 flexenergy += flexenergies[idx];
5148 energy =
MIN(flexenergies[idx], demands[idx] *
MAX(0, (ect - begin)));
5149 assert(ect - begin < duration);
5150 assert(energy >= 0);
5153 flexenergy += energy;
5156 candenergy =
MIN(flexenergies[idx], demands[idx] * (end - begin)) - energy;
5157 assert(candenergy >= 0);
5160 if( candenergy > ubenergy )
5162 ubenergy = candenergy;
5167 SCIPdebugMsg(scip,
"time window [%d,%d) flexible energy <%d>\n", begin, end, flexenergy);
5168 assert(coreEnergyAfterLct[i] <= coreEnergyAfterStart);
5171 freeenergy = capacity * (end - begin) - flexenergy - coreEnergyAfterStart + coreEnergyAfterLct[i];
5174 if( freeenergy < 0 )
5176 SCIPdebugMsg(scip,
"analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
5186 conshdlrdata->usebdwidening, explanation) );
5188 (*initialized) =
TRUE;
5200 if( ubenergy > 0 && freeenergy < ubenergy )
5206 duration = durations[ubcand];
5207 assert(duration > 0);
5215 newub = begin - duration + (int)(energy / demands[ubcand]);
5217 if( newub < ect - duration )
5226 relaxedbd = ect - duration - 1.0;
5233 conshdlrdata->usebdwidening, explanation) );
5235 (*initialized) =
TRUE;
5241 else if( newub < newubs[ubcand] )
5243 INFERINFO inferinfo;
5250 newubs[ubcand] = newub;
5255 if( minavailable > freeenergy )
5257 minavailable = freeenergy;
5260 assert(minavailable >= 0);
5296 int* coreEnergyAfterEst;
5297 int* coreEnergyAfterLct;
5318 if( !conshdlrdata->ttefcheck )
5321 SCIPdebugMsg(scip,
"run time-table edge-finding overload checking\n");
5339 for( v = 0; v < nvars; ++v )
5343 lbinferinfos[v] = 0;
5344 ubinferinfos[v] = 0;
5348 collectDataTTEF(scip, nvars, vars, durations, demands, hmin, hmax, permests, ests, permlcts, lcts, ects, lsts, flexenergies);
5361 newlbs, newubs, lbinferinfos, ubinferinfos, lsts, flexenergies,
5362 permests, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5366 newlbs, newubs, lbinferinfos, ubinferinfos, ects, flexenergies,
5367 permlcts, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5370 for( v = 0; v < nvars && !(*cutoff); ++v )
5378 assert(!infeasible);
5398 INFERINFO inferinfo;
5404 assert(var !=
NULL);
5415 assert(begin < end);
5423 conshdlrdata->usebdwidening, explanation) );
5425 (*initialized) =
TRUE;
5489 assert(scip !=
NULL);
5491 assert(cons !=
NULL);
5492 assert(cutoff !=
NULL);
5499 if( !conshdlrdata->ttinfer )
5502 assert(*initialized ==
FALSE);
5504 SCIPdebugMsg(scip,
"propagate cores of cumulative condition of constraint <%s>[%d,%d) <= %d\n",
5514 for( v = 0; v < nvars; ++v )
5525 assert(var !=
NULL);
5527 duration = durations[v];
5528 assert(duration > 0);
5539 if( lst + duration <= hmin || est >= hmax )
5543 begin =
MAX(hmin, lst);
5544 end =
MIN(hmax, est + duration);
5546 demand = demands[v];
5552 SCIPdebugMsg(scip,
"variable <%s>[%g,%g] (duration %d, demand %d): remove core [%d,%d)\n",
5560 profile, v, nchgbds, conshdlrdata->usebdwidening, initialized, explanation, cutoff) );
5567 profile, v, nchgbds) );
5577 begin =
MAX(hmin, lst);
5578 end =
MIN(hmax, est + duration);
5585 SCIPdebugMsg(scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
5594 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
5596 if( explanation !=
NULL )
5597 explanation[v] =
TRUE;
5614 struct SCIP_NodeData
5631 typedef struct SCIP_NodeData SCIP_NODEDATA;
5641 (*nodedata)->var =
NULL;
5643 (*nodedata)->est = INT_MIN;
5644 (*nodedata)->lct = INT_MAX;
5645 (*nodedata)->duration = 0;
5646 (*nodedata)->demand = 0;
5647 (*nodedata)->enveloptheta = -1;
5648 (*nodedata)->energytheta = 0;
5649 (*nodedata)->enveloplambda = -1;
5650 (*nodedata)->energylambda = -1;
5651 (*nodedata)->idx = -1;
5652 (*nodedata)->intheta =
TRUE;
5680 SCIP_NODEDATA* leftdata;
5681 SCIP_NODEDATA* rightdata;
5683 SCIPdebugMsg(scip,
"update envelop starting from node <%p>\n", (
void*)node);
5688 while( node !=
NULL )
5696 assert(left !=
NULL);
5698 assert(leftdata !=
NULL);
5702 assert(right !=
NULL);
5704 assert(rightdata !=
NULL);
5707 if( leftdata->enveloptheta >= 0 )
5709 assert(rightdata->energytheta != -1);
5710 nodedata->enveloptheta =
MAX(leftdata->enveloptheta + rightdata->energytheta, rightdata->enveloptheta);
5713 nodedata->enveloptheta = rightdata->enveloptheta;
5715 assert(leftdata->energytheta != -1);
5716 assert(rightdata->energytheta != -1);
5717 nodedata->energytheta = leftdata->energytheta + rightdata->energytheta;
5719 if( leftdata->enveloplambda >= 0 )
5721 assert(rightdata->energytheta != -1);
5722 nodedata->enveloplambda =
MAX(leftdata->enveloplambda + rightdata->energytheta, rightdata->enveloplambda);
5725 nodedata->enveloplambda = rightdata->enveloplambda;
5727 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0 )
5728 nodedata->enveloplambda =
MAX(
nodedata->enveloplambda, leftdata->enveloptheta + rightdata->energylambda);
5732 if( leftdata->energylambda >= 0 && rightdata->energylambda >= 0 )
5734 assert(rightdata->energytheta != -1);
5735 assert(leftdata->energytheta != -1);
5736 nodedata->energylambda =
MAX(leftdata->energylambda + rightdata->energytheta, leftdata->energytheta + rightdata->energylambda);
5738 else if( rightdata->energylambda >= 0 )
5740 assert(leftdata->energytheta != -1);
5741 nodedata->energylambda = leftdata->energytheta + rightdata->energylambda;
5743 else if( leftdata->energylambda >= 0 )
5745 assert(rightdata->energytheta != -1);
5746 nodedata->energylambda = leftdata->energylambda + rightdata->energytheta;
5767 assert(node !=
NULL);
5774 assert(parent !=
NULL);
5781 assert(nodedata !=
NULL);
5783 nodedata->key = key;
5804 assert(scip !=
NULL);
5805 assert(tree !=
NULL);
5806 assert(node !=
NULL);
5814 assert(parent !=
NULL);
5825 assert(sibling !=
NULL);
5829 if( grandparent !=
NULL )
5876 assert(scip !=
NULL);
5877 assert(tree !=
NULL);
5878 assert(node !=
NULL);
5885 assert(
nodedata->enveloptheta != -1);
5886 assert(
nodedata->energytheta != -1);
5887 assert(
nodedata->enveloplambda == -1);
5888 assert(
nodedata->energylambda == -1);
5908 SCIP_NODEDATA** nodedatas,
5919 SCIP_NODEDATA* newnodedata;
5920 SCIP_NODEDATA* leafdata;
5927 assert(leaf !=
NULL);
5930 assert(leafdata !=
NULL);
5933 assert(nodedata !=
NULL);
5934 assert(nodedata->intheta);
5939 if( nodedata->key < leafdata->key )
5945 assert(leafdata !=
NULL);
5948 assert(leaf !=
NULL);
5949 assert(leaf != node);
5956 assert(newnode !=
NULL);
5959 nodedatas[*nnodedatas] = newnodedata;
5964 if( parent !=
NULL )
5981 if( nodedata->key < leafdata->key )
5986 newnodedata->key = nodedata->key;
5993 newnodedata->key = leafdata->key;
6015 SCIP_NODEDATA* leftdata;
6016 SCIP_NODEDATA* rightdata;
6018 assert(node !=
NULL);
6031 assert(left !=
NULL);
6034 assert(leftdata !=
NULL);
6037 assert(right !=
NULL);
6040 assert(rightdata !=
NULL);
6042 assert(
nodedata->energylambda != -1);
6043 assert(rightdata->energytheta != -1);
6045 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6048 assert(leftdata->energytheta != -1);
6049 assert(rightdata->energylambda != -1);
6050 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6064 SCIP_NODEDATA* leftdata;
6065 SCIP_NODEDATA* rightdata;
6067 assert(node !=
NULL);
6080 assert(left !=
NULL);
6083 assert(leftdata !=
NULL);
6086 assert(right !=
NULL);
6089 assert(rightdata !=
NULL);
6091 assert(
nodedata->enveloplambda != -1);
6092 assert(rightdata->energytheta != -1);
6095 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6097 else if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6098 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6101 assert(rightdata->enveloplambda != -1);
6102 assert(
nodedata->enveloplambda == rightdata->enveloplambda);
6134 omegaset[*nelements] = node;
6154 assert(node !=
NULL);
6165 SCIP_NODEDATA* leftdata;
6166 SCIP_NODEDATA* rightdata;
6169 assert(nodedata !=
NULL);
6173 assert(left !=
NULL);
6176 assert(leftdata !=
NULL);
6179 assert(right !=
NULL);
6182 assert(rightdata !=
NULL);
6185 assert(nodedata !=
NULL);
6187 assert(nodedata->enveloptheta != -1);
6188 assert(rightdata->energytheta != -1);
6190 if( leftdata->enveloptheta >= 0 && nodedata->enveloptheta == leftdata->enveloptheta + rightdata->energytheta )
6197 assert(rightdata->enveloptheta != -1);
6198 assert(nodedata->enveloptheta == rightdata->enveloptheta);
6218 SCIP_NODEDATA* leftdata;
6219 SCIP_NODEDATA* rightdata;
6221 assert(node !=
NULL);
6231 assert(left !=
NULL);
6234 assert(leftdata !=
NULL);
6237 assert(right !=
NULL);
6240 assert(rightdata !=
NULL);
6242 assert(
nodedata->energylambda != -1);
6243 assert(rightdata->energytheta != -1);
6245 if( leftdata->energylambda >= 0 &&
nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6252 assert(leftdata->energytheta != -1);
6253 assert(rightdata->energylambda != -1);
6254 assert(
nodedata->energylambda == leftdata->energytheta + rightdata->energylambda);
6275 SCIP_NODEDATA* leftdata;
6276 SCIP_NODEDATA* rightdata;
6278 assert(node !=
NULL);
6291 assert(left !=
NULL);
6294 assert(leftdata !=
NULL);
6297 assert(right !=
NULL);
6300 assert(rightdata !=
NULL);
6302 assert(
nodedata->enveloplambda != -1);
6303 assert(rightdata->energytheta != -1);
6305 if( leftdata->enveloplambda >= 0 &&
nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6312 if( leftdata->enveloptheta >= 0 && rightdata->energylambda >= 0
6313 &&
nodedata->enveloplambda == leftdata->enveloptheta + rightdata->energylambda )
6320 assert(rightdata->enveloplambda != -1);
6321 assert(
nodedata->enveloplambda == rightdata->enveloplambda);
6341 assert(duration > 0);
6343 SCIPdebugMessage(
"variable <%s>: loc=[%g,%g] glb=[%g,%g] (duration %d, demand %d)\n",
6348 return nodedata->demand * duration;
6361 return (est1 - est2);
6371 lct1 = ((SCIP_NODEDATA*)elem1)->lct;
6372 lct2 = ((SCIP_NODEDATA*)elem2)->lct;
6374 return (lct1 - lct2);
6405 SCIPdebugMsg(scip,
"est=%d, lct=%d, propest %u, reportedenergy %d, shift %d\n", est, lct, propest, reportedenergy, shift);
6408 energy = (lct - est) * capacity;
6416 for( j = 0; j < nleaves && reportedenergy <= energy; ++j )
6421 assert(nodedata !=
NULL);
6426 if( nodedata->est < est )
6428 est = nodedata->est;
6429 energy = (lct - est) * capacity;
6432 assert(reportedenergy > energy);
6434 SCIPdebugMsg(scip,
"time window [%d,%d) available energy %d, required energy %d\n", est, lct, energy, reportedenergy);
6460 for( j = nleaves-1; j >= 0; --j )
6465 assert(nodedata !=
NULL);
6466 assert(nodedata->var !=
NULL);
6480 if( explanation !=
NULL )
6481 explanation[nodedata->idx] =
TRUE;
6484 (*initialized) =
TRUE;
6507 assert(scip !=
NULL);
6509 if( energy > (capacity - demand) * (lct - est) )
6511 if( energy + demand * duration > capacity * (lct - est) )
6543 SCIP_NODEDATA* rootdata;
6549 assert(rootdata !=
NULL);
6552 for( j = ncands-1; j >= 0 && !(*cutoff); --j )
6560 assert(nodedata->est != -1);
6563 while( !(*cutoff) && rootdata->enveloplambda > capacity * nodedata->lct )
6567 SCIP_NODEDATA* leafdata;
6578 assert(leaf !=
NULL);
6582 assert(leafdata !=
NULL);
6583 assert(!leafdata->intheta);
6584 assert(leafdata->duration > 0);
6585 assert(leafdata->est >= 0);
6588 if( leafdata->est + leafdata->duration >= nodedata->lct )
6594 assert(rootdata !=
NULL);
6609 assert(nelements > 0);
6610 assert(nelements < ncands);
6612 newest =
computeEstOmegaset(scip, leafdata->duration, leafdata->demand, capacity, est, lct, energy);
6617 SCIPdebugMsg(scip,
"an overload was detected duration edge-finder propagattion\n");
6621 conshdlrdata->usebdwidening, initialized, explanation) );
6627 else if( newest > 0 )
6631 INFERINFO inferinfo;
6638 SCIPdebugMsg(scip,
"variable <%s> adjust lower bound from %g to %d\n",
6652 SCIPdebugMsg(scip,
"variable <%s> adjust upper bound from %g to %d\n",
6665 leafdata->est = newest;
6676 SCIPdebugMsg(scip,
"edge-finder dectected an infeasibility\n");
6684 if( explanation !=
NULL )
6685 explanation[leafdata->idx] =
TRUE;
6688 for( i = 0; i < nelements; ++i )
6691 assert(nodedata !=
NULL);
6696 if( explanation !=
NULL )
6697 explanation[nodedata->idx] =
TRUE;
6700 (*initialized) =
TRUE;
6718 assert(rootdata !=
NULL);
6753 SCIP_NODEDATA** nodedatas;
6765 assert(scip !=
NULL);
6766 assert(cons !=
NULL);
6767 assert(initialized !=
NULL);
6768 assert(cutoff !=
NULL);
6769 assert(*cutoff ==
FALSE);
6791 for( j = 0; j < nvars; ++j )
6796 shift =
MAX(shift, lct);
6803 for( j = 0; j < nvars; ++j )
6815 assert(var !=
NULL);
6817 duration = durations[j];
6818 assert(duration > 0);
6829 if( conshdlrdata->useadjustedjobs )
6833 leftadjust = (hmin - est);
6838 rightadjust = (lct - hmax);
6845 if( duration - leftadjust - rightadjust <= 0 )
6848 else if( est < hmin || lct > hmax )
6851 energy = demands[j] * (duration - leftadjust - rightadjust);
6854 totalenergy += energy;
6880 nodedata->key = est + j / (2.0 * nvars);
6881 nodedata->var = var;
6882 nodedata->est = est;
6883 nodedata->lct = lct;
6884 nodedata->demand = demands[j];
6885 nodedata->duration = duration;
6886 nodedata->leftadjust = leftadjust;
6887 nodedata->rightadjust = rightadjust;
6893 nodedata->enveloptheta = capacity * est + energy;
6894 nodedata->energytheta = energy;
6895 nodedata->enveloplambda = -1;
6896 nodedata->energylambda = -1;
6899 nodedata->intheta =
TRUE;
6905 nnodedatas = ncands;
6908 SCIPsortPtr((
void**)nodedatas, compNodedataLct, ncands);
6915 for( j = 0; j < ncands; ++j )
6918 SCIP_NODEDATA* rootdata;
6923 if( (nodedatas[j]->lct - nodedatas[j]->est) * capacity >= totalenergy )
6926 nodedatas[j]->est = -1;
6935 assert(nnodedatas <= 2*nvars);
6938 leaves[ninsertcands] = leaf;
6943 assert(rootdata !=
NULL);
6946 if( rootdata->enveloptheta > capacity * nodedatas[j]->lct )
6948 SCIPdebugMsg(scip,
"detects cutoff due to overload in time window [?,%d) (ncands %d)\n", nodedatas[j]->lct, j);
6966 est = nodedatas[j]->est;
6967 lct = nodedatas[j]->lct;
6972 for( j = j+1; j < ncands; ++j )
6979 nodedata = nodedatas[j];
6980 assert(nodedata !=
NULL);
6982 duration = nodedata->duration - nodedata->leftadjust - nodedata->rightadjust;
6990 duration -= (est - glbest);
6993 duration -= (glblct - lct);
6997 glbenery += nodedata->demand * duration;
6999 if( explanation !=
NULL )
7000 explanation[nodedata->idx] =
TRUE;
7006 conshdlrdata->usebdwidening, initialized, explanation) );
7008 else if( ninsertcands > 1 && conshdlrdata->efinfer )
7012 propest, shift, initialized, explanation, nchgbds, cutoff) );
7016 for( j = nnodedatas - 1; j >= 0; --j )
7060 if( !conshdlrdata->efcheck )
7065 cons,
TRUE, initialized, explanation, nchgbds, cutoff) );
7072 if( !conshdlrdata->efinfer )
7077 cons,
FALSE, initialized, explanation, nchgbds, cutoff) );
7114 assert(scip !=
NULL);
7115 assert(redundant !=
NULL);
7117 (*redundant) =
TRUE;
7123 assert(vars !=
NULL);
7133 for( j = 0; j < nvars; ++j )
7135 assert(durations[j] > 0);
7136 assert(demands[j] > 0);
7139 assert(var !=
NULL);
7145 if( lb >= hmax || ub + durations[j] <= hmin )
7148 starttimes[njobs] =
MAX(lb, hmin);
7149 startindices[njobs] = j;
7151 endtimes[njobs] =
MIN(ub + durations[j], hmax);
7152 endindices[njobs] = j;
7153 assert(starttimes[njobs] <= endtimes[njobs]);
7162 freecapacity = capacity;
7165 for( j = 0; j < njobs; ++j )
7167 curtime = starttimes[j];
7170 if( curtime >= hmax )
7174 freecapacity -= demands[startindices[j]];
7175 while( j+1 < njobs && starttimes[j+1] == curtime )
7178 freecapacity -= demands[startindices[j]];
7182 while( endtimes[endindex] <= curtime )
7184 freecapacity += demands[endindices[endindex]];
7187 assert(freecapacity <= capacity);
7190 if( freecapacity < 0 && curtime >= hmin )
7192 (*redundant) =
FALSE;
7229 for( v = 0; v < nvars; ++v )
7242 assert(var !=
NULL);
7246 duration = durations[v];
7247 assert(duration > 0);
7249 demand = demands[v];
7257 if( lst + duration <= hmin || est >= hmax )
7261 begin =
MAX(hmin, lst);
7262 end =
MIN(hmax, est + duration);
7268 SCIPdebugMsg(scip,
"variable <%s>[%d,%d] (duration %d, demand %d): add core [%d,%d)\n",
7282 var, duration, demand,
SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
7284 if( explanation !=
NULL )
7285 explanation[v] =
TRUE;
7324 assert(nchgbds !=
NULL);
7325 assert(initialized !=
NULL);
7326 assert(cutoff !=
NULL);
7341 SCIP_CALL_TERMINATE( retcode,
createCoreProfile(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax,
7342 initialized, explanation, cutoff), TERMINATE );
7347 SCIP_CALL_TERMINATE( retcode,
propagateTimetable(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7348 nchgbds, initialized, explanation, cutoff), TERMINATE );
7354 SCIP_CALL_TERMINATE( retcode,
propagateEdgeFinding(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
7355 cons, initialized, explanation, nchgbds, cutoff), TERMINATE );
7361 SCIP_CALL_TERMINATE( retcode,
propagateTTEF(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7362 nchgbds, initialized, explanation, cutoff), TERMINATE );
7389 assert(scip !=
NULL);
7390 assert(cons !=
NULL);
7393 assert(consdata !=
NULL);
7395 oldnchgbds = *nchgbds;
7396 initialized =
FALSE;
7410 consdata->nvars, consdata->vars, consdata->durations, consdata->demands, consdata->capacity,
7411 consdata->hmin, consdata->hmax, cons,
7412 nchgbds, &redundant, &initialized,
NULL, cutoff) );
7416 SCIPdebugMsg(scip,
"%s deletes cumulative constraint <%s> since it is redundant\n",
7430 assert(*cutoff ==
TRUE);
7436 if( *cutoff || *nchgbds > oldnchgbds )
7443 consdata->propagated =
TRUE;
7478 assert(probingpos >= 0);
7479 assert(probingpos < nvars);
7480 assert(success !=
NULL);
7481 assert(cutoff !=
NULL);
7483 var = vars[probingpos];
7484 assert(var !=
NULL);
7497 leftimpllbs, leftimplubs, leftproplbs, leftpropubs, cutoff) );
7532 rightimpllbs, rightimplubs, rightproplbs, rightpropubs, cutoff) );
7562 assert(roundable !=
NULL);
7579 assert(scalar != 0);
7611 assert(roundable !=
NULL);
7628 assert(scalar != 0);
7660 int* alternativelbs,
7661 int* alternativeubs,
7670 for( c = 0; c < nconss; ++c )
7679 assert(cons !=
NULL);
7686 assert(consdata !=
NULL);
7687 assert(consdata->nvars > 1);
7708 hmin = consdata->hmin;
7709 hmax = consdata->hmax;
7713 assert(consdata !=
NULL);
7715 nvars = consdata->nvars;
7717 for( v = 0; v < nvars; ++v )
7723 var = consdata->vars[v];
7724 assert(var !=
NULL);
7739 if( consdata->downlocks[v] )
7746 ect = est + consdata->durations[v];
7748 if( ect <= hmin || hmin >= hmax )
7750 else if( est < hmin && alternativelbs[idx] >= (hmin + 1 - constant) / scalar )
7752 alternativelbs[idx] = (hmin + 1 - constant) / scalar;
7758 if( consdata->uplocks[v] )
7764 duration = consdata->durations[v];
7768 lct = lst + duration;
7770 if( lst >= hmax || hmin >= hmax )
7772 else if( lct > hmax && alternativeubs[idx] <= ((hmax - 1 - constant) / scalar) - duration )
7774 alternativeubs[idx] = ((hmax - 1 - constant) / scalar) - duration;
7790 int* alternativelbs,
7791 int* alternativeubs,
7818 for( v = 0; v < nvars; ++v )
7828 assert(var !=
NULL);
7844 if( alternativelbs[v] > ub )
7847 assert(!infeasible);
7866 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7867 nfixedvars, &success, cutoff) );
7891 if( alternativeubs[v] < lb )
7894 assert(!infeasible);
7913 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7914 nfixedvars, &success, cutoff) );
7954 int* alternativelbs;
7955 int* alternativeubs;
7964 oldnfixedvars = *nfixedvars;
7973 for( v = 0; v < nvars; ++v )
7977 alternativelbs[v] = INT_MAX;
7978 alternativeubs[v] = INT_MIN;
7986 nfixedvars, cutoff) );
7988 if( !(*cutoff) && oldnfixedvars == *nfixedvars && branched !=
NULL )
8035 assert(cons !=
NULL);
8039 assert(consdata !=
NULL );
8041 nvars = consdata->nvars;
8048 remainingcap = consdata->capacity;
8051 for( j = 0; j < nvars; ++j )
8058 if( startvalues[j] <= time && ub + consdata->durations[j] > time )
8061 if( startvalues[j] == ub )
8063 remainingcap -= consdata->demands[j];
8067 demands[nflexible] = consdata->demands[j];
8068 flexibleids[nflexible] = j;
8073 assert(remainingcap >= 0);
8089 while( j < nflexible && sumdemand <= remainingcap )
8091 sumdemand += demands[j];
8097 assert(sumdemand > remainingcap);
8098 assert(bigcoversize < nflexible);
8110 for( j = 0; j < nflexible; ++j )
8122 idx = flexibleids[j];
8126 assert(nbinvars != 0);
8129 assert(vals !=
NULL);
8135 start = time - consdata->durations[idx] + 1;
8136 end =
MIN(time, ub);
8139 for( b = 0; b < nbinvars; ++b )
8141 if( vals[b] < start || vals[b] < lb )
8147 assert(binvars[b] !=
NULL);
8155 if( consdata->bcoverrowssize == 0 )
8157 consdata->bcoverrowssize = 10;
8160 if( consdata->nbcoverrows == consdata->bcoverrowssize )
8162 consdata->bcoverrowssize *= 2;
8166 consdata->bcoverrows[consdata->nbcoverrows] = row;
8167 consdata->nbcoverrows++;
8177 while( sumdemand <= remainingcap )
8180 sumdemand += demands[j];
8184 smallcoversize = nflexible - (j + 1) - 1;
8185 while( j > 0 && demands[j] == demands[nflexible-1] )
8188 assert(smallcoversize < nflexible);
8190 if( smallcoversize != 1 || smallcoversize != nflexible - (j + 1) - 1 )
8199 for( j = j + 1; j < nflexible; ++j )
8211 idx = flexibleids[j];
8215 assert(nbinvars != 0);
8218 assert(vals !=
NULL);
8224 start = time - consdata->durations[idx] + 1;
8225 end =
MIN(time, ub);
8228 for( b = 0; b < nbinvars; ++b )
8230 if( vals[b] < start || vals[b] < lb )
8236 assert(binvars[b] !=
NULL);
8243 if( consdata->scoverrowssize == 0 )
8245 consdata->scoverrowssize = 10;
8248 if( consdata->nscoverrows == consdata->scoverrowssize )
8250 consdata->scoverrowssize *= 2;
8254 consdata->scoverrows[consdata->nscoverrows] = row;
8255 consdata->nscoverrows++;
8276 int* startvaluessorted;
8277 int* endvaluessorted;
8292 assert(scip !=
NULL);
8293 assert(cons !=
NULL);
8296 assert(consdata !=
NULL);
8299 if( consdata->vars ==
NULL )
8302 nvars = consdata->nvars;
8303 hmin = consdata->hmin;
8304 hmax = consdata->hmax;
8314 for ( j = 0; j < nvars; ++j )
8317 startvaluessorted[j] = startvalues[j];
8320 endvaluessorted[j] = endvalues[j];
8322 startindices[j] = j;
8332 freecapacity = consdata->capacity;
8335 for( j = 0; j < nvars; ++j )
8337 curtime = startvaluessorted[j];
8338 if( curtime >= hmax )
8342 freecapacity -= consdata->demands[startindices[j]];
8344 while( j+1 < nvars && startvaluessorted[j+1] == curtime )
8347 freecapacity -= consdata->demands[startindices[j]];
8351 while( endidx < nvars && curtime >= endvaluessorted[endidx] )
8353 freecapacity += consdata->demands[endindices[endidx]];
8357 assert(freecapacity <= consdata->capacity);
8358 assert(endidx <= nvars);
8368 if( freecapacity < 0 && curtime >= hmin )
8370 int nextprofilechange;
8374 nextprofilechange =
MIN( startvaluessorted[j+1], endvaluessorted[endidx] );
8376 nextprofilechange = endvaluessorted[endidx];
8378 nextprofilechange =
MIN(nextprofilechange, hmax);
8380 for( t = curtime; t < nextprofilechange; ++t )
8382 SCIPdebugMsg(scip,
"add cover constraint for time %d\n", curtime);
8392 consdata->covercuts =
TRUE;
8427 assert(nstarted > nfinished);
8430 assert(consdata !=
NULL);
8431 assert(consdata->nvars > 0);
8433 capacity = consdata->capacity;
8434 assert(capacity > 0);
8450 for( b = 0; b < nbinvars; ++b )
8466 for( b = 0; b < nbinvars; ++b )
8474 if( consdata->demandrowssize == 0 )
8476 consdata->demandrowssize = 10;
8479 if( consdata->ndemandrows == consdata->demandrowssize )
8481 consdata->demandrowssize *= 2;
8485 consdata->demandrows[consdata->ndemandrows] = row;
8486 consdata->ndemandrows++;
8522 assert(scip !=
NULL);
8523 assert(cons !=
NULL);
8526 assert(consdata !=
NULL);
8528 nvars = consdata->nvars;
8534 assert(consdata->vars !=
NULL);
8541 SCIPdebugMsg(scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
8546 starttimes, endtimes, startindices, endindices,
FALSE);
8549 freecapacity = consdata->capacity;
8550 hmin = consdata->hmin;
8551 hmax = consdata->hmax;
8554 for( j = 0; j < nvars; ++j )
8556 curtime = starttimes[j];
8557 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
8559 if( curtime >= hmax )
8566 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
8568 assert(freecapacity <= consdata->capacity);
8569 assert(endindex <= nvars);
8575 if( freecapacity < 0 && curtime >= hmin )
8582 nextstarttime = starttimes[j+1];
8584 nextstarttime = endtimes[nvars-1];
8586 nextstarttime =
MIN(nextstarttime, hmax);
8593 for( t = curtime+1 ; t < nextstarttime; ++t )
8598 if( freecapacity < 0 )
8601 SCIPdebugMsg(scip,
"add capacity constraint at time %d\n", t);
8639 assert(consdata !=
NULL);
8640 assert(consdata->demandrows ==
NULL);
8641 assert(consdata->ndemandrows == 0);
8644 if( consdata->linkingconss ==
NULL )
8684 assert(consdata !=
NULL);
8686 if( consdata->demandrows ==
NULL )
8690 assert(consdata->ndemandrows == 0 || consdata->demandrows !=
NULL);
8692 for( r = 0; r < consdata->ndemandrows && !(*infeasible); ++r )
8696 assert(consdata->demandrows[r] !=
NULL);
8718 assert(scip !=
NULL);
8719 assert(cons !=
NULL);
8720 assert(separated !=
NULL);
8721 assert(cutoff !=
NULL);
8727 assert(consdata !=
NULL);
8731 if( consdata->demandrows ==
NULL )
8735 assert(consdata->ndemandrows == 0 || consdata->demandrows !=
NULL);
8740 for( r = 0; r < consdata->ndemandrows; ++r )
8771 (*separated) =
TRUE;
8792 assert(scip !=
NULL);
8793 assert(cons !=
NULL);
8794 assert(separated !=
NULL);
8795 assert(cutoff !=
NULL);
8801 assert(consdata !=
NULL);
8806 if( consdata->linkingconss ==
NULL )
8811 if( !consdata->covercuts )
8820 for( r = 0; r < consdata->nscoverrows; ++r )
8826 assert(consdata->scoverrows[r] !=
NULL);
8832 if( minfeasibility > feasibility )
8834 minfeasibility = feasibility;
8835 row = consdata->scoverrows[r];
8842 SCIPdebugMsg(scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8845 assert(row !=
NULL);
8850 (*separated) =
TRUE;
8857 for( r = 0; r < consdata->nbcoverrows; ++r )
8863 assert(consdata->bcoverrows[r] !=
NULL);
8869 if( minfeasibility > feasibility )
8871 minfeasibility = feasibility;
8872 row = consdata->bcoverrows[r];
8879 SCIPdebugMsg(scip,
"cumulative constraint <%s> separated 1 cover cut with feasibility %g\n",
8882 assert(row !=
NULL);
8887 (*separated) =
TRUE;
8916 assert(nstarted > nfinished);
8919 assert(consdata !=
NULL);
8920 assert(consdata->nvars > 0);
8925 SCIP_CALL(
collectIntVars(scip, consdata, &activevars, startindices, curtime, nstarted, nfinished, lower, &lhs ) );
8943 for( v = 0; v < nstarted - nfinished; ++v )
8952 assert( ! infeasible );
8989 assert(scip !=
NULL);
8990 assert(cons !=
NULL);
8993 assert(consdata !=
NULL);
8995 nvars = consdata->nvars;
9001 assert(consdata->vars !=
NULL);
9008 SCIPdebugMsg(scip,
"create sorted event points for cumulative constraint <%s> with %d jobs\n",
9017 freecapacity = consdata->capacity;
9018 hmin = consdata->hmin;
9019 hmax = consdata->hmax;
9022 for( j = 0; j < nvars; ++j )
9024 curtime = starttimes[j];
9026 if( curtime >= hmax )
9033 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
9035 assert(freecapacity <= consdata->capacity);
9036 assert(endindex <= nvars);
9042 if( freecapacity < 0 && curtime >= hmin)
9082 assert(scip !=
NULL);
9083 assert(cons !=
NULL);
9086 assert(consdata !=
NULL);
9088 nvars = consdata->nvars;
9094 assert(consdata->vars !=
NULL);
9095 capacity = consdata->capacity;
9098 for ( j = 0; j < nvars; ++j )
9100 if( consdata->demands[j] > capacity )
9122 assert(scip !=
NULL);
9123 assert(cons !=
NULL);
9126 assert(consdata !=
NULL);
9128 if( consdata->nvars == 0 )
9135 else if( consdata->nvars == 1 )
9137 if( consdata->demands[0] > consdata->capacity )
9170 assert(scip !=
NULL);
9171 assert(cons !=
NULL);
9174 assert(consdata !=
NULL);
9176 hmin = consdata->hmin;
9177 hmax = consdata->hmax;
9179 SCIPdebugMsg(scip,
"check for irrelevant jobs within cumulative constraint <%s>[%d,%d)\n",
9182 for( j = consdata->nvars-1; j >= 0; --j )
9184 var = consdata->vars[j];
9185 demand = consdata->demands[j];
9186 duration = consdata->durations[j];
9192 if( demand == 0 || duration == 0 )
9195 SCIPdebugMsg(scip,
" remove variable <%s> due to zero %s\n",
9201 else if( est >= hmax || lct <= hmin )
9203 SCIPdebugMsg(scip,
" remove variable <%s>[%d,%d] with duration <%d>\n",
9234 assert(scip !=
NULL);
9237 assert(consdata->durations[pos] > 0);
9238 assert(consdata->demands[pos] > 0);
9240 var = consdata->vars[pos];
9241 assert(var !=
NULL);
9242 duration = consdata->durations[pos];
9245 SCIPdebugMsg(scip,
" variable <%s>: demand <%d> is larger than the capacity <%d>\n",
9246 SCIPvarGetName(var), consdata->demands[pos], consdata->capacity);
9253 if( ect - duration >= consdata->hmax || lst + duration <= consdata->hmin)
9256 if( ect > consdata->hmin && lst < consdata->hmax )
9261 else if( lst < consdata->hmax )
9269 else if( ect > consdata->hmin )
9294 leftbound = consdata->hmin - duration;
9295 rightbound = consdata->hmax;
9339 assert(consdata !=
NULL);
9345 capacity = consdata->capacity;
9347 for( j = consdata->nvars-1; j >= 0 && !(*cutoff); --j )
9349 if( consdata->demands[j] > capacity )
9386 assert(uplock ==
TRUE || uplock ==
FALSE);
9387 assert((
int)
TRUE == 1);
9388 assert((
int)
FALSE == 0);
9405 assert(!infeasible);
9438 assert(downlock ==
TRUE || downlock ==
FALSE);
9439 assert((
int)
TRUE == 1);
9440 assert((
int)
FALSE == 0);
9452 assert(!infeasible);
9481 if( *capacity == 1 || nvars <= 1 )
9484 assert(demands[nvars-1] <= *capacity);
9485 assert(demands[nvars-2] <= *capacity);
9488 mindemand1 =
MIN(demands[nvars-1], demands[nvars-2]);
9489 mindemand2 =
MAX(demands[nvars-1], demands[nvars-2]);
9491 for( v = nvars-2; v >= 0 && (gcd >= 2 || mindemand1 + mindemand2 > *capacity); --v )
9493 assert(mindemand1 <= mindemand2);
9494 assert(demands[v] <= *capacity);
9498 if( mindemand1 > demands[v] )
9500 mindemand2 = mindemand1;
9501 mindemand1 = demands[v];
9503 else if( mindemand2 > demands[v] )
9504 mindemand2 = demands[v];
9507 if( mindemand1 + mindemand2 > *capacity )
9509 SCIPdebugMsg(scip,
"update cumulative condition (%d + %d > %d) to unary cumulative condition\n", mindemand1, mindemand2, *capacity);
9511 for( v = 0; v < nvars; ++v )
9516 (*nchgcoefs) += nvars;
9521 SCIPdebugMsg(scip,
"cumulative condition: dividing demands by %" SCIP_LONGINT_FORMAT
"\n", gcd);
9523 for( v = 0; v < nvars; ++v )
9528 (*nchgcoefs) += nvars;
9550 assert(nchgcoefs !=
NULL);
9551 assert(nchgsides !=
NULL);
9555 assert(consdata !=
NULL);
9557 if( consdata->normalized )
9560 capacity = consdata->capacity;
9565 consdata->demands, &consdata->capacity, nchgcoefs, nchgsides) );
9567 consdata->normalized =
TRUE;
9569 if( capacity > consdata->capacity )
9570 consdata->varbounds =
FALSE;
9628 for( t = 0; t < ntimepoints; ++t )
9631 if( timepoints[t] <= *hmin )
9635 if( timepoints[t] >= *hmax )
9641 if( loads[t] <= capacity )
9643 (*split) = timepoints[t];
9696 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
9725 assert(consdata !=
NULL);
9727 if( consdata->nvars <= 1 )
9731 consdata->durations, consdata->demands, consdata->capacity, &hmin, &hmax, &split) );
9734 if( consdata->hmin < hmin )
9738 consdata->hmin = hmin;
9743 if( consdata->hmax > hmax )
9746 consdata->hmax = hmax;
9751 if( consdata->hmax <= consdata->hmin )
9753 SCIPdebugMsg(scip,
"constraint <%s> is redundant since hmax(%d) <= hmin(%d)\n",
9759 else if( consdata->hmin < split && split < consdata->hmax )
9764 SCIPdebugMsg(scip,
"split cumulative constraint <%s>[%d,%d) with %d jobs at time point %d\n",
9765 SCIPconsGetName(cons), consdata->hmin, consdata->hmax, consdata->nvars, split);
9767 assert(split < consdata->hmax);
9771 consdata->durations, consdata->demands, consdata->capacity, split, consdata->hmax,
9776 consdata->hmax = split;
9778 assert(consdata->hmin < consdata->hmax);
9854 assert(scip !=
NULL);
9856 assert(cons !=
NULL);
9858 SCIPdebugMsg(scip,
"check for irrelevant variable for cumulative condition (hmin %d) w.r.t. earlier start time\n", hmin);
9860 firstminect = INT_MAX;
9861 secondminect = INT_MAX;
9864 for( v = 0; v < nvars; ++v )
9870 if( ect < firstminect )
9872 secondminect = firstminect;
9875 else if( ect < secondminect )
9880 for( v = 0; v < nvars; ++v )
9893 assert(var !=
NULL);
9895 duration = durations[v];
9896 assert(duration > 0);
9902 ect = est + duration;
9904 lct = lst + duration;
9907 if( ect == firstminect )
9908 minect = secondminect;
9910 minect = firstminect;
9913 alternativelb =
MAX(hmin+1, minect);
9914 alternativelb =
MIN(alternativelb, hmax);
9921 SCIPdebugMsg(scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
9925 irrelevants[v] =
TRUE;
9936 assert(downlocks !=
NULL);
9937 assert(uplocks !=
NULL);
9948 SCIPdebugMsg(scip,
" variables <%s>[%d,%d] (duration <%d>) is irrelevant due to no up lock\n",
9952 irrelevants[v] =
TRUE;
9960 SCIPdebugMsg(scip,
" remove down lock of variable <%s>[%g,%g] with duration <%d>\n",
9964 downlocks[v] =
FALSE;
9971 else if( ect <= hmin )
9989 SCIPdebugMsg(scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt EST\n",
9996 irrelevants[v] =
TRUE;
10004 assert(downlocks !=
NULL);
10019 if( alternativelb > lst )
10025 assert(!infeasible);
10044 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10045 nfixedvars, &success, cutoff) );
10056 SCIPdebugMsg(scip,
"********* check variable <%s>[%g,%g] with duration <%d> (hmin %d)\n",
10139 assert(scip !=
NULL);
10141 assert(cons !=
NULL);
10143 SCIPdebugMsg(scip,
"check for irrelevant variable for cumulative condition (hmax %d) w.r.t. latest completion time\n", hmax);
10145 firstmaxlst = INT_MIN;
10146 secondmaxlst = INT_MIN;
10149 for( v = 0; v < nvars; ++v )
10155 if( lst > firstmaxlst )
10157 secondmaxlst = firstmaxlst;
10160 else if( lst > secondmaxlst )
10161 secondmaxlst = lst;
10165 for( v = 0; v < nvars; ++v )
10177 assert(var !=
NULL);
10179 duration = durations[v];
10180 assert(duration > 0);
10186 ect = est + duration;
10190 if( lst == firstmaxlst )
10191 maxlst = secondmaxlst;
10193 maxlst = firstmaxlst;
10196 alternativeub =
MIN(hmax - 1, maxlst) - duration;
10197 alternativeub =
MAX(alternativeub, hmin);
10204 SCIPdebugMsg(scip,
" variable <%s>[%g,%g] with duration <%d> is irrelevant\n",
10208 irrelevants[v] =
TRUE;
10215 assert(downlocks !=
NULL);
10216 assert(uplocks !=
NULL);
10222 if( !downlocks[v] )
10228 SCIPdebugMsg(scip,
" variables <%s>[%d,%d] with duration <%d> is irrelevant due to no down lock\n",
10232 irrelevants[v] =
TRUE;
10240 SCIPdebugMsg(scip,
" remove up lock of variable <%s>[%g,%g] with duration <%d>\n",
10244 uplocks[v] =
FALSE;
10251 else if( lst >= hmax )
10269 SCIPdebugMsg(scip,
" variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt LCT\n",
10276 irrelevants[v] =
TRUE;
10284 assert(uplocks !=
NULL);
10299 if( alternativeub < est )
10305 assert(!infeasible);
10324 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10325 nfixedvars, &success, cutoff) );
10366 assert(scip !=
NULL);
10367 assert(cons !=
NULL);
10368 assert(!(*cutoff));
10371 assert(consdata !=
NULL);
10373 nvars = consdata->nvars;
10383 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10384 irrelevants, nfixedvars, nchgsides, cutoff) );
10388 consdata->hmin, consdata->hmax, consdata->downlocks, consdata->uplocks, cons,
10389 irrelevants, nfixedvars, nchgsides, cutoff) );
10394 for( v = nvars-1; v >= 0; --v )
10396 if( irrelevants[v] )
10402 var = consdata->vars[v];
10403 assert(var !=
NULL);
10409 if( lst <= consdata->hmin && ect >= consdata->hmax )
10411 if( consdata->capacity < consdata->demands[v] )
10417 consdata->capacity -= consdata->demands[v];
10418 consdata->varbounds =
FALSE;
10447 assert(demands !=
NULL);
10448 assert(ndemands !=
NULL);
10451 startindex = nstarted - 1;
10456 while( nstarted - nfinished > ncountedvars )
10463 varidx = startindices[startindex];
10464 assert(varidx >= 0 && varidx < consdata->nvars);
10466 var = consdata->vars[varidx];
10467 assert(var !=
NULL);
10472 if( endtime > curtime )
10474 if( consdata->demands[varidx] < consdata->capacity )
10476 (*demands)[*ndemands] = consdata->demands[varidx];
10510 assert(nstarted > nfinished);
10513 assert(consdata !=
NULL);
10514 assert(consdata->nvars > 0);
10515 assert(consdata->capacity > 0);
10521 SCIP_CALL(
collectDemands(scip, consdata, startindices, curtime, nstarted, nfinished, &demands, &ndemands) );
10526 for( j = 0; j < ndemands; ++j )
10575 assert(scip !=
NULL);
10576 assert(cons !=
NULL);
10577 assert(nchgsides !=
NULL);
10580 assert(consdata !=
NULL);
10582 nvars = consdata->nvars;
10585 if( nvars <= 1 || consdata->capacity <= 1 )
10588 assert(consdata->vars !=
NULL);
10590 SCIPdebugMsg(scip,
"try to tighten capacity for cumulative constraint <%s> with capacity %d\n",
10600 starttimes, endtimes, startindices, endindices,
FALSE);
10604 freecapacity = consdata->capacity;
10607 for( j = 0; j < nvars && bestcapacity < consdata->capacity; ++j )
10609 curtime = starttimes[j];
10610 SCIPdebugMsg(scip,
"look at %d-th job with start %d\n", j, curtime);
10616 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
10618 assert(freecapacity <= consdata->capacity);
10619 assert(endindex <= nvars);
10625 if( freecapacity < 0 )
10635 bestcapacity =
MAX(bestcapacity, newcapacity);
10636 SCIPdebugMsg(scip,
"after highest cap usage: bestcapacity = %d\n", bestcapacity);
10640 if( freecapacity > 0 && freecapacity != consdata->capacity )
10642 bestcapacity =
MAX(bestcapacity, consdata->capacity - freecapacity);
10643 SCIPdebugMsg(scip,
"after peak < cap: bestcapacity = %d\n", bestcapacity);
10647 if( freecapacity == 0 && consdata->demands[startindices[j]] < consdata->capacity)
10650 SCIPdebugMsg(scip,
"--> cannot decrease capacity since sum equals capacity\n");
10651 bestcapacity = consdata->capacity;
10663 if( bestcapacity < consdata->capacity )
10669 SCIPdebugMsg(scip,
"+-+-+-+-+-+ --> CHANGE capacity of cons<%s> from %d to %d\n",
10672 for( j = 0; j < nvars; ++j )
10674 if( consdata->demands[j] == consdata->capacity )
10676 consdata->demands[j] = bestcapacity;
10681 consdata->capacity = bestcapacity;
10684 SCIPdebugMsgPrint(scip,
"; changed additionally %d coefficients\n", (*nchgcoefs) - oldnchgcoefs);
10686 consdata->varbounds =
FALSE;
10709 assert(scip !=
NULL);
10710 assert(cons !=
NULL);
10711 assert(nchgcoefs !=
NULL);
10715 assert(consdata !=
NULL);
10717 nvars = consdata->nvars;
10718 oldnchgcoefs = *nchgcoefs;
10727 mindemand = consdata->demands[0];
10728 for( j = 0; j < nvars; ++j )
10730 mindemand =
MIN(mindemand, consdata->demands[j]);
10734 for( j = 0; j < nvars; ++j )
10736 if( mindemand + consdata->demands[j] > consdata->capacity && consdata->demands[j] < consdata->capacity )
10739 consdata->demands[j], consdata->capacity);
10740 consdata->demands[j] = consdata->capacity;
10749 for( j = 0; j < nvars; ++j )
10756 assert(consdata->demands[j] <= consdata->capacity);
10758 if( consdata->demands[j] == consdata->capacity )
10766 for( i = 0; i < nvars; ++i )
10777 if( est_i >= lct_j || est_j >= lct_i )
10780 if( consdata->demands[j] + consdata->demands[i] <= consdata->capacity )
10790 consdata->demands[j], consdata->capacity);
10791 consdata->demands[j] = consdata->capacity;
10797 if( (*nchgcoefs) > oldnchgcoefs )
10799 SCIPdebugMsg(scip,
"+-+-+-+-+-+changed %d coefficients of variables of cumulative constraint<%s>\n",
10822 assert(cons !=
NULL);
10824 nvars = consdata->nvars;
10827 hmin = consdata->hmin;
10828 hmax = consdata->hmax;
10829 assert(hmin < hmax);
10831 for( v = 0; v < nvars; ++v )
10840 var = consdata->vars[v];
10841 assert(var !=
NULL);
10843 duration = consdata->durations[v];
10846 ect = est + duration;
10848 lct = lst + duration;
10851 assert(lst > hmin || ect < hmax);
10853 if( lst <= hmin && est < hmin - lct +
MIN(hmin, ect) )
10862 shift = est - (hmin - lct +
MIN(hmin, ect));
10865 duration = hmin - lct;
10867 SCIPdebugMsg(scip,
"replace variable <%s>[%g,%g] by [%d,%d]\n",
10876 assert(!infeasible);
10877 assert(!redundant);
10878 assert(aggregated);
10881 consdata->durations[v] = duration;
10882 consdata->vars[v] = aggrvar;
10917 assert(consdata !=
NULL);
10919 capacity = consdata->capacity;
10921 if( capacity == 1 )
10928 halfcapacity = capacity / 2;
10929 mindemand = consdata->capacity;
10933 for( v = 0; v < consdata->nvars; ++v )
10935 if( consdata->demands[v] > halfcapacity )
10937 vars[nvars] = consdata->vars[v];
10938 demands[nvars] = 1;
10939 durations[nvars] = consdata->durations[v];
10942 mindemand =
MIN(mindemand, consdata->demands[v]);
10951 for( v = 0; v < consdata->nvars; ++v )
10953 if( consdata->demands[v] > halfcapacity )
10956 if( mindemand + consdata->demands[v] > capacity )
10958 demands[nvars] = 1;
10959 durations[nvars] = consdata->durations[v];
10960 vars[nvars] = consdata->vars[v];
11019 if( *cutoff || *unbounded || presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE )
11036 if( conshdlrdata->normalize )
11048 if( conshdlrdata->coeftightening )
11060 SCIP_CALL( reformulateCons(scip, cons, naggrvars) );
11072 struct TCLIQUE_Graph
11090 assert(tcliquegraph !=
NULL);
11092 return tcliquegraph->nnodes;
11099 assert(tcliquegraph !=
NULL);
11101 return tcliquegraph->weights;
11108 assert(tcliquegraph !=
NULL);
11109 assert(0 <= node1 && node1 < tcliquegraph->
nnodes);
11110 assert(0 <= node2 && node2 < tcliquegraph->nnodes);
11113 if( tcliquegraph->precedencematrix[node1][node2] || tcliquegraph->precedencematrix[node2][node1] )
11117 if( tcliquegraph->demandmatrix[node1][node2] )
11132 assert(tcliquegraph !=
NULL);
11133 assert(0 <= node && node < tcliquegraph->
nnodes);
11134 assert(nnodes == 0 || nodes !=
NULL);
11135 assert(adjnodes !=
NULL);
11139 for( i = 0; i <
nnodes; i++ )
11142 assert(0 <= nodes[i] && nodes[i] < tcliquegraph->nnodes);
11143 assert(i == 0 || nodes[i-1] < nodes[i]);
11146 if( tcliqueIsedgeClique(tcliquegraph, node, nodes[i]) )
11149 adjnodes[nadjnodes] = nodes[i];
11178 nnodes = tcliquegraph->nnodes;
11180 for( i = 0; i <
nnodes; ++i )
11182 for( j = 0; j <
nnodes; ++j )
11184 SCIPinfoMessage(scip,
NULL,
"(%d/%d) ", tcliquegraph->precedencematrix[i][j], tcliquegraph->demandmatrix[i][j]);
11207 if(
SCIPisEQ(scip, vlbcoef, 1.0) )
11219 bound = (duration - vlbcoef) / (vlbcoef - 1.0);
11221 if(
SCIPisLT(scip, vlbcoef, 1.0) )
11235 assert(
SCIPisGT(scip, vlbcoef, 1.0));
11266 vlbcoef = 1.0 / vubcoef;
11267 vlbconst = -vubconst / vubcoef;
11299 if( tcliquegraph->size == tcliquegraph->nnodes )
11304 tcliquegraph->size = size;
11312 for( v = 0; v < tcliquegraph->nnodes; ++v )
11318 assert(tcliquegraph->nnodes < tcliquegraph->size);
11320 pos = tcliquegraph->nnodes;
11323 tcliquegraph->durations[pos] = 0;
11324 tcliquegraph->weights[pos] = 0;
11325 tcliquegraph->vars[pos] = var;
11335 tcliquegraph->nnodes++;
11337 for( v = 0; v < tcliquegraph->nnodes; ++v )
11339 tcliquegraph->precedencematrix[v][pos] = 0;
11340 tcliquegraph->demandmatrix[v][pos] = 0;
11343 (*idx) = tcliquegraph->nnodes;
11380 for( v = 0; v < nvars; ++v )
11391 assert(var !=
NULL);
11396 if( tcliquegraph->durations[idx1] == 0 )
11404 for( b = 0; b < nvbdvars; ++b )
11411 if( tcliquegraph->durations[idx2] == 0 )
11415 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11423 for( b = 0; b < nvbdvars; ++b )
11430 if( tcliquegraph->durations[idx2] == 0 )
11434 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11437 for( b = v+1; b < nvars; ++b )
11444 if( tcliquegraph->durations[idx2] == 0 )
11449 tcliquegraph->precedencematrix[idx1][idx2] =
TRUE;
11453 tcliquegraph->precedencematrix[idx2][idx1] =
TRUE;
11473 for( i = 0; i <
nnodes; ++i )
11475 for( j = 0; j <
nnodes; ++j )
11477 if( adjmatrix[i][j] )
11482 for( k = 0; k <
nnodes; ++k )
11484 if( adjmatrix[j][k] )
11485 adjmatrix[i][k] =
TRUE;
11504 for( c = 0; c < nconss; ++c )
11514 assert(consdata !=
NULL);
11516 vars = consdata->vars;
11517 demands = consdata->demands;
11519 nvars = consdata->nvars;
11520 capacity = consdata->capacity;
11525 for( i = 0; i < nvars; ++i )
11533 if( tcliquegraph->durations[idx1] == 0 || tcliquegraph->durations[idx1] > consdata->durations[i] )
11536 for( j = i+1; j < nvars; ++j )
11538 assert(consdata->durations[j] > 0);
11540 if( demands[i] + demands[j] > capacity )
11553 if( est1 < consdata->hmin && est2 < consdata->hmin )
11560 if( lct1 > consdata->hmax && lct2 > consdata->hmax )
11565 assert(idx1 != idx2);
11567 if( tcliquegraph->durations[idx2] == 0 || tcliquegraph->durations[idx2] > consdata->durations[j] )
11572 assert(tcliquegraph->durations[idx1] > 0);
11573 assert(tcliquegraph->durations[idx2] > 0);
11575 tcliquegraph->demandmatrix[idx1][idx2] =
TRUE;
11576 tcliquegraph->demandmatrix[idx2][idx1] =
TRUE;
11597 assert(scip !=
NULL);
11598 assert(tcliquegraph !=
NULL);
11604 transitiveClosure(tcliquegraph->precedencematrix, tcliquegraph->ninarcs, tcliquegraph->noutarcs, tcliquegraph->nnodes);
11635 for( v = 0; v < ncliquenodes; ++v )
11637 durations[v] = tcliquegraph->durations[cliquenodes[v]];
11638 assert(durations[v] > 0);
11640 vars[v] = tcliquegraph->vars[cliquenodes[v]];
11680 nnodes = tcliquegraph->nnodes;
11684 for( v = 0; v <
nnodes; ++v )
11686 tcliquegraph->weights[v] = tcliquegraph->durations[v];
11697 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
11706 if( tcliquegraph->durations[v] == 0 )
11716 for( c = 0; c <
nnodes; ++c )
11718 precedencerow[c] = tcliquegraph->precedencematrix[v][c];
11719 precedencecol[c] = tcliquegraph->precedencematrix[c][v];
11721 demandrow[c] = tcliquegraph->demandmatrix[v][c];
11722 demandcol[c] = tcliquegraph->demandmatrix[c][v];
11725 if( precedencerow[c] || precedencecol[c] )
11727 tcliquegraph->demandmatrix[v][c] =
FALSE;
11728 tcliquegraph->demandmatrix[c][v] =
FALSE;
11732 tcliquegraph->precedencematrix[c][v] =
FALSE;
11733 tcliquegraph->precedencematrix[v][c] =
FALSE;
11737 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11738 tcliquegraph, tcliqueNewsolClique,
NULL,
11739 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11740 10000, 1000, 1000, v, &ntreenodes, &tcliquestatus);
11742 SCIPdebugMsg(scip,
"tree nodes %d clique size %d (weight %d, status %d)\n", ntreenodes, ncliquenodes, cliqueweight, tcliquestatus);
11744 if( ncliquenodes == 1 )
11754 for( c = 0; c < ncliquenodes; ++c )
11760 for( c = 0; c <
nnodes; ++c )
11762 tcliquegraph->precedencematrix[v][c] = precedencerow[c];
11763 tcliquegraph->precedencematrix[c][v] = precedencecol[c];
11765 tcliquegraph->demandmatrix[v][c] = demandrow[c];
11766 tcliquegraph->demandmatrix[c][v] = demandcol[c];
11778 (*naddconss) += nconss;
11834 if( !tcliquegraph->precedencematrix[source][sink] )
11837 nnodes = tcliquegraph->nnodes;
11838 vars = tcliquegraph->vars;
11848 for( i = 0; i <
nnodes; ++i )
11854 assert(var !=
NULL);
11856 duration = tcliquegraph->durations[i];
11858 if( i == source || i == sink )
11861 tcliquegraph->weights[i] = 0;
11863 else if( tcliquegraph->precedencematrix[source][i] && tcliquegraph->precedencematrix[i][sink] )
11866 tcliquegraph->weights[i] = duration;
11872 tcliquegraph->weights[i] = duration;
11875 tcliquegraph->weights[i] = 0;
11881 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11882 tcliquegraph, tcliqueNewsolClique,
NULL,
11883 cliquenodes, &ncliquenodes, &cliqueweight, 1, 1,
11884 10000, 1000, 1000, -1, &ntreenodes, &tcliquestatus);
11886 if( ncliquenodes > 1 )
11897 distance = cliqueweight + tcliquegraph->durations[source];
11928 nnodes = tcliquegraph->nnodes;
11938 for( i = 0; i <
nnodes; ++i )
11940 if( tcliquegraph->ninarcs[i] == 0 )
11942 sources[nsources] = i;
11946 if( tcliquegraph->ninarcs[i] == 0 )
11969 (*naddconss) += nconss;
11992 for( c = 0; c < nconss; ++c )
12000 assert(consdata !=
NULL);
12002 vars = consdata->vars;
12003 nvars = consdata->nvars;
12005 for( v = 0; v < nvars; ++v )
12016 tcliquegraph->durations[idx] =
MAX(tcliquegraph->durations[idx], consdata->durations[v]);
12017 assert(tcliquegraph->durations[idx] > 0);
12074 for( v = 0; v < nvars; ++v )
12079 assert(var !=
NULL);
12092 (*tcliquegraph)->nnodes = nvars;
12093 (*tcliquegraph)->varmap = varmap;
12094 (*tcliquegraph)->precedencematrix = precedencematrix;
12095 (*tcliquegraph)->demandmatrix = demandmatrix;
12096 (*tcliquegraph)->weights = weights;
12097 (*tcliquegraph)->ninarcs = ninarcs;
12098 (*tcliquegraph)->noutarcs = noutarcs;
12099 (*tcliquegraph)->durations = durations;
12100 (*tcliquegraph)->size = nvars;
12114 for( v = (*tcliquegraph)->nnodes-1; v >= 0; --v )
12156 if( conshdlrdata->detectvarbounds )
12162 if( conshdlrdata->detectdisjunctive )
12183 if( consdata->validsignature )
12186 vars = consdata->vars;
12187 nvars = consdata->nvars;
12189 for( v = 0; v < nvars; ++v )
12191 consdata->signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(vars[v]) % (
sizeof(
unsigned int) * 8)));
12194 consdata->validsignature =
TRUE;
12203 assert(consdata !=
NULL);
12204 assert(0 <= ind1 && ind1 < consdata->nvars);
12205 assert(0 <= ind2 && ind2 < consdata->nvars);
12207 return SCIPvarCompare(consdata->vars[ind1], consdata->vars[ind2]);
12222 for( i = 0; i < nconss; ++i )
12228 assert(cons0 !=
NULL);
12231 assert(consdata0 !=
NULL);
12234 assert(consdata0->validsignature);
12236 for( j = i+1; j < nconss; ++j )
12242 assert(cons1 !=
NULL);
12245 assert(consdata1 !=
NULL);
12247 if( consdata0->capacity != consdata1->capacity )
12251 assert(consdata1->validsignature);
12253 if( (consdata1->signature & (~consdata0->signature)) == 0 )
12257 assert((consdata0->signature & (~consdata1->signature)) == 0);
12260 if( (consdata0->signature & (~consdata1->signature)) == 0 )
12267 if( consdata0->nvars > consdata1->nvars )
12270 if( consdata0->hmin < consdata1->hmin )
12273 if( consdata0->hmax > consdata1->hmax )
12280 SCIPsort(perm0, consdataCompVar, (
void*)consdata0, consdata0->nvars);
12281 SCIPsort(perm1, consdataCompVar, (
void*)consdata1, consdata1->nvars);
12283 for( v0 = 0, v1 = 0; v0 < consdata0->nvars && v1 < consdata1->nvars; )
12294 var0 = consdata0->vars[idx0];
12296 var1 = consdata1->vars[idx1];
12307 demand0 = consdata0->demands[idx0];
12308 duration0 = consdata0->durations[idx0];
12310 demand1 = consdata1->demands[idx1];
12311 duration1 = consdata1->durations[idx1];
12313 if( demand0 != demand1 )
12316 if( duration0 != duration1 )
12322 else if( comp > 0 )
12328 if( v0 == consdata0->nvars )
12369 assert(consdata !=
NULL);
12372 if( consdata->varbounds )
12375 vars = consdata->vars;
12376 durations = consdata->durations;
12377 demands = consdata->demands;
12378 capacity = consdata->capacity;
12379 nvars = consdata->nvars;
12393 var = consdata->vars[i];
12394 assert(var !=
NULL);
12401 for( b = 0; b < nvbdvars; ++b )
12403 if(
SCIPisEQ(scip, vbdcoefs[b], 1.0) )
12407 for( j = 0; j < nvars; ++j )
12409 if( vars[j] == vbdvars[b] )
12415 if( demands[i] + demands[j] > capacity &&
SCIPconvertRealToInt(scip, vbdconsts[b]) < durations[j] )
12430 assert(!infeasible);
12432 (*nchgbds) += nlocalbdchgs;
12439 (*naddconss) += nconss;
12441 consdata->varbounds =
TRUE;
12461 assert(conshdlr !=
NULL);
12463 assert(nconss == 0 || conss !=
NULL);
12464 assert(result !=
NULL);
12466 if( solinfeasible )
12472 SCIPdebugMsg(scip,
"constraint enforcing %d useful cumulative constraints of %d constraints for %s solution\n", nusefulconss, nconss,
12473 sol ==
NULL ?
"LP" :
"relaxation");
12476 assert(conshdlrdata !=
NULL);
12480 if( conshdlrdata->usebinvars )
12489 for( c = 0; c < nusefulconss; ++c )
12495 assert(cons !=
NULL);
12510 for( ; c < nconss && !separated; ++c )
12516 assert(cons !=
NULL);
12554 assert(scip !=
NULL);
12555 assert(conshdlr !=
NULL);
12574 assert(conshdlr !=
NULL);
12578 assert(conshdlrdata !=
NULL);
12580 #ifdef SCIP_STATISTIC 12581 if( !conshdlrdata->iscopy )
12584 SCIPstatisticPrintf(
"time-table: lb=%" SCIP_LONGINT_FORMAT
", ub=%" SCIP_LONGINT_FORMAT
", cutoff=%" SCIP_LONGINT_FORMAT
"\n",
12585 conshdlrdata->nlbtimetable, conshdlrdata->nubtimetable, conshdlrdata->ncutofftimetable);
12586 SCIPstatisticPrintf(
"edge-finder: lb=%" SCIP_LONGINT_FORMAT
", ub=%" SCIP_LONGINT_FORMAT
", cutoff=%" SCIP_LONGINT_FORMAT
"\n",
12587 conshdlrdata->nlbedgefinder, conshdlrdata->nubedgefinder, conshdlrdata->ncutoffedgefinder);
12588 SCIPstatisticPrintf(
"overload: time-table=%" SCIP_LONGINT_FORMAT
" time-time edge-finding=%" SCIP_LONGINT_FORMAT
"\n",
12589 conshdlrdata->ncutoffoverload, conshdlrdata->ncutoffoverloadTTEF);
12609 assert(conshdlrdata !=
NULL);
12611 conshdlrdata->detectedredundant =
FALSE;
12613 for( c = 0; c < nconss; ++c )
12626 #ifdef SCIP_STATISTIC 12634 assert(conshdlrdata !=
NULL);
12636 for( c = 0; c < nconss; ++c )
12638 SCIP_CALL( evaluateCumulativeness(scip, conss[c]) );
12645 if( !conshdlrdata->iscopy )
12647 SCIPstatisticPrintf(
"@11 added variables bounds constraints %d\n", conshdlrdata->naddedvarbounds);
12648 SCIPstatisticPrintf(
"@22 added disjunctive constraints %d\n", conshdlrdata->naddeddisjunctives);
12670 assert(conshdlr !=
NULL);
12674 for( c = 0; c < nconss; ++c )
12677 assert(consdata !=
NULL);
12690 assert(conshdlr !=
NULL);
12692 assert(consdata !=
NULL );
12693 assert(*consdata !=
NULL );
12701 assert(conshdlrdata !=
NULL);
12720 assert(conshdlr !=
NULL);
12722 assert(sourcecons !=
NULL);
12723 assert(targetcons !=
NULL);
12726 assert(sourcedata !=
NULL);
12727 assert(sourcedata->demandrows ==
NULL);
12733 assert(conshdlrdata !=
NULL);
12734 assert(conshdlrdata->eventhdlr !=
NULL);
12738 sourcedata->durations, sourcedata->demands, sourcedata->nvars, sourcedata->capacity,
12762 assert(conshdlr !=
NULL);
12764 assert(conshdlrdata !=
NULL);
12766 *infeasible =
FALSE;
12768 SCIPdebugMsg(scip,
"initialize LP relaxation for %d cumulative constraints\n", nconss);
12770 if( conshdlrdata->usebinvars )
12773 for( c = 0; c < nconss && !(*infeasible); ++c )
12778 if( conshdlrdata->cutsasconss )
12802 assert(conshdlr !=
NULL);
12804 assert(nconss == 0 || conss !=
NULL);
12805 assert(result !=
NULL);
12807 assert(conshdlrdata !=
NULL);
12809 SCIPdebugMsg(scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12815 if( !conshdlrdata->localcuts &&
SCIPgetDepth(scip) > 0 )
12820 if( conshdlrdata->usebinvars )
12823 for( c = 0; c < nusefulconss && !cutoff; ++c )
12828 if( !cutoff && conshdlrdata->usecovercuts )
12830 for( c = 0; c < nusefulconss; ++c )
12837 if( conshdlrdata->sepaold )
12840 for( c = 0; c < nusefulconss; ++c )
12849 else if( separated )
12864 assert(conshdlr !=
NULL);
12866 assert(nconss == 0 || conss !=
NULL);
12867 assert(result !=
NULL);
12870 assert(conshdlrdata !=
NULL);
12872 if( !conshdlrdata->localcuts &&
SCIPgetDepth(scip) > 0 )
12875 SCIPdebugMsg(scip,
"separating %d/%d cumulative constraints\n", nusefulconss, nconss);
12881 if( conshdlrdata->usebinvars )
12884 for( c = 0; c < nusefulconss && !cutoff; ++c )
12889 if( !cutoff && conshdlrdata->usecovercuts )
12891 for( c = 0; c < nusefulconss; ++c )
12897 if( conshdlrdata->sepaold )
12900 for( c = 0; c < nusefulconss; ++c )
12909 else if( separated )
12939 SCIPdebugMsg(scip,
"method: enforce pseudo solution\n");
12941 assert(conshdlr !=
NULL);
12943 assert(nconss == 0 || conss !=
NULL);
12944 assert(result !=
NULL);
12946 if( objinfeasible )
12955 assert(conshdlrdata !=
NULL);
12968 assert(conshdlr !=
NULL);
12970 assert(nconss == 0 || conss !=
NULL);
12971 assert(result !=
NULL);
12975 SCIPdebugMsg(scip,
"check %d cumulative constraints\n", nconss);
12977 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
13003 SCIPdebugMsg(scip,
"propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss);
13005 assert(conshdlr !=
NULL);
13007 assert(nconss == 0 || conss !=
NULL);
13008 assert(result !=
NULL);
13011 assert(conshdlrdata !=
NULL);
13019 for( c = 0; c < nusefulconss && !cutoff; ++c )
13024 assert(cons !=
NULL);
13030 &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) );
13033 &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) );
13045 if( !cutoff && nchgbds == 0 )
13048 for( c = nusefulconss; c < nconss && !cutoff; ++c )
13055 if( !cutoff && conshdlrdata->dualpresolve &&
SCIPallowDualReds(scip) && nconss > 1 )
13066 else if( nchgbds > 0 )
13068 SCIPdebugMsg(scip,
"delete (locally) %d constraints and changed %d variable bounds\n", ndelconss, nchgbds);
13094 assert(conshdlr !=
NULL);
13096 assert(scip !=
NULL);
13097 assert(result !=
NULL);
13099 SCIPdebugMsg(scip,
"presolve %d cumulative constraints\n", nconss);
13102 assert(conshdlrdata !=
NULL);
13106 oldnfixedvars = *nfixedvars;
13107 oldnchgbds = *nchgbds;
13108 oldnchgsides = *nchgsides;
13109 oldnchgcoefs = *nchgcoefs;
13110 oldnupgdconss = *nupgdconss;
13111 oldndelconss = *ndelconss;
13112 oldnaddconss = *naddconss;
13117 for( c = 0; c < nconss && !cutoff; ++c )
13130 nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) );
13133 nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) );
13136 if( cutoff || unbounded )
13144 if( nrounds == 1 &&
SCIPgetNRuns(scip) == 1 && conshdlrdata->disjunctive )
13163 nfixedvars, &cutoff,
NULL) );
13167 if( !cutoff &&
SCIPgetNRuns(scip) == 1 && !conshdlrdata->detectedredundant
13168 && (conshdlrdata->detectvarbounds || conshdlrdata->detectdisjunctive)
13175 conshdlrdata->detectedredundant =
TRUE;
13183 SCIPdebugMsg(scip,
"delete %d constraints and changed %d variable bounds (cutoff %u)\n",
13184 *ndelconss - oldndelconss, *nchgbds - oldnchgbds, cutoff);
13188 else if( unbounded )
13190 else if( *nchgbds > oldnchgbds || *nfixedvars > oldnfixedvars || *nchgsides > oldnchgsides
13191 || *nchgcoefs > oldnchgcoefs || *nupgdconss > oldnupgdconss || *ndelconss > oldndelconss || *naddconss > oldnaddconss )
13206 assert(conshdlr !=
NULL);
13208 assert(scip !=
NULL);
13209 assert(result !=
NULL);
13210 assert(infervar !=
NULL);
13211 assert(bdchgidx !=
NULL);
13214 assert(conshdlrdata !=
NULL);
13217 assert(cons !=
NULL);
13220 assert(consdata !=
NULL);
13222 SCIPdebugMsg(scip,
"resolve propagation: variable <%s>, cumulative constraint <%s> (capacity %d, propagation %d, H=[%d,%d))\n",
13227 consdata->durations, consdata->demands, consdata->capacity, consdata->hmin, consdata->hmax,
13228 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, conshdlrdata->usebdwidening,
NULL, result) );
13241 SCIPdebugMsg(scip,
"lock cumulative constraint <%s> with nlockspos = %d, nlocksneg = %d\n",
SCIPconsGetName(cons), nlockspos, nlocksneg);
13243 assert(scip !=
NULL);
13244 assert(cons !=
NULL);
13247 assert(consdata !=
NULL);
13249 vars = consdata->vars;
13250 assert(vars !=
NULL);
13252 for( v = 0; v < consdata->nvars; ++v )
13254 if( consdata->downlocks[v] && consdata->uplocks[v] )
13259 else if( consdata->downlocks[v] )
13263 else if( consdata->uplocks[v] )
13277 assert(scip !=
NULL);
13278 assert(conshdlr !=
NULL);
13279 assert(cons !=
NULL);
13293 const char* consname;
13299 assert(sourceconsdata !=
NULL);
13302 nvars = sourceconsdata->nvars;
13303 sourcevars = sourceconsdata->vars;
13313 for( v = 0; v < nvars && *valid; ++v )
13316 assert(!(*valid) || vars[v] !=
NULL);
13329 sourceconsdata->durations, sourceconsdata->demands, sourceconsdata->capacity,
13330 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13333 if( sourceconsdata->hmin > 0 )
13339 if( sourceconsdata->hmax < INT_MAX )
13371 SCIPdebugMsg(scip,
"parse <%s> as cumulative constraint\n", str);
13394 duration = atoi(strvalue);
13398 demand = atoi(strvalue);
13404 demands[nvars] = demand;
13405 durations[nvars] = duration;
13409 while( var !=
NULL );
13413 hmin = atoi(strvalue);
13418 hmax = (int)(value);
13426 capacity = (int)value;
13430 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13454 assert(consdata !=
NULL);
13456 if( varssize < consdata->nvars )
13457 (*success) =
FALSE;
13460 assert(vars !=
NULL);
13476 assert(consdata !=
NULL);
13478 (*nvars) = consdata->nvars;
13498 assert(scip !=
NULL);
13499 assert(eventhdlr !=
NULL);
13500 assert(eventdata !=
NULL);
13502 assert(event !=
NULL);
13505 assert(consdata !=
NULL);
13508 consdata->propagated =
FALSE;
13542 consEnfolpCumulative, consEnfopsCumulative, consCheckCumulative, consLockCumulative,
13545 assert(conshdlr !=
NULL);
13550 #ifdef SCIP_STATISTIC 13574 "should time-table (core-times) propagator be used to infer bounds?",
13578 "should edge-finding be used to detect an overload?",
13582 "should edge-finding be used to infer bounds?",
13585 "constraints/" CONSHDLR_NAME "/useadjustedjobs",
"should edge-finding be executed?",
13589 "should time-table edge-finding be used to detect an overload?",
13593 "should time-table edge-finding be used to infer bounds?",
13597 "constraints/" CONSHDLR_NAME "/usebinvars",
"should the binary representation be used?",
13600 "constraints/" CONSHDLR_NAME "/localcuts",
"should cuts be added only locally?",
13603 "constraints/" CONSHDLR_NAME "/usecovercuts",
"should covering cuts be added every node?",
13607 "should the cumulative constraint create cuts as knapsack constraints?",
13611 "shall old sepa algo be applied?",
13615 "constraints/" CONSHDLR_NAME "/fillbranchcands",
"should branching candidates be added to storage?",
13620 "constraints/" CONSHDLR_NAME "/dualpresolve",
"should dual presolving be applied?",
13623 "constraints/" CONSHDLR_NAME "/coeftightening",
"should coefficient tightening be applied?",
13626 "constraints/" CONSHDLR_NAME "/normalize",
"should demands and capacity be normalized?",
13630 "should pairwise constraint comparison be performed in presolving?",
13633 "constraints/" CONSHDLR_NAME "/disjunctive",
"extract disjunctive constraints?",
13638 "number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit)?",
13641 "constraints/" CONSHDLR_NAME "/detectdisjunctive",
"search for conflict set via maximal cliques to detect disjunctive constraints",
13644 "constraints/" CONSHDLR_NAME "/detectvarbounds",
"search for conflict set via maximal cliques to detect variable bound constraints",
13649 "constraints/" CONSHDLR_NAME "/usebdwidening",
"should bound widening be used during the conflict analysis?",
13693 assert(scip !=
NULL);
13697 if( conshdlr ==
NULL )
13703 SCIPdebugMsg(scip,
"create cumulative constraint <%s> with %d jobs\n", name, nvars);
13706 SCIP_CALL(
consdataCreate(scip, &consdata, vars,
NULL, durations, demands, nvars, capacity, 0, INT_MAX, check) );
13710 initial, separate, enforce, check, propagate,
13711 local, modifiable, dynamic, removable, stickingatnode) );
13720 assert(conshdlrdata !=
NULL);
13721 assert(conshdlrdata->eventhdlr !=
NULL);
13749 assert(scip !=
NULL);
13772 assert(consdata !=
NULL);
13774 assert(hmin <= consdata->hmax);
13776 consdata->hmin = hmin;
13796 assert(consdata !=
NULL);
13798 return consdata->hmin;
13817 assert(consdata !=
NULL);
13818 assert(hmax >= consdata->hmin);
13820 consdata->hmax = hmax;
13840 assert(consdata !=
NULL);
13842 return consdata->hmax;
13861 assert(consdata !=
NULL);
13863 return consdata->vars;
13882 assert(consdata !=
NULL);
13884 return consdata->nvars;
13903 assert(consdata !=
NULL);
13905 return consdata->capacity;
13924 assert(consdata !=
NULL);
13926 return consdata->durations;
13945 assert(consdata !=
NULL);
13947 return consdata->demands;
13968 assert(scip !=
NULL);
13969 assert(violated !=
NULL);
13972 violated, cons, printreason) );
13990 nchgcoefs, nchgsides) );
14009 hmin, hmax, split) );
14036 irrelevants, nfixedvars, nchgsides, cutoff) );
14040 irrelevants, nfixedvars, nchgsides, cutoff) );
14067 assert(scip !=
NULL);
14068 assert(cons !=
NULL);
14069 assert(initialized !=
NULL);
14070 assert(*initialized ==
FALSE);
14071 assert(cutoff !=
NULL);
14072 assert(*cutoff ==
FALSE);
14076 if( conshdlr ==
NULL )
14083 assert(conshdlrdata !=
NULL);
14088 nvars, vars, durations, demands, capacity, hmin, hmax, cons,
14089 nchgbds, &redundant, initialized, explanation, cutoff) );
14114 infervar,
intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd,
TRUE, explanation, result) );
14137 file = fopen(filename,
"w");
14148 assert(consdata !=
NULL);
14150 nvars = consdata->nvars;
14153 SCIPvarGetHashkey, SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL), TERMINATE );
14158 for( v = 0; v < nvars; ++v )
14162 var = consdata->vars[v];
14163 assert(var !=
NULL);
14169 else if( !consdata->downlocks[v] || !consdata->uplocks[v] )
14177 for( v = 0; v < nvars; ++v )
14183 var = consdata->vars[v];
14184 assert(var !=
NULL);
14189 for( b = 0; b < nvbdvars; ++b )
14201 for( b = 0; b < nvbdvars; ++b )
14234 if( conshdlr ==
NULL )
14241 assert(conshdlrdata !=
NULL);
14243 conshdlrdata->solveCumulative = solveCumulative;
14278 (*infeasible) =
FALSE;
14279 (*unbounded) =
FALSE;
14287 if( conshdlr ==
NULL )
14295 assert(conshdlrdata !=
NULL);
14298 if( timelimit > 0.0 && memorylimit > 10 )
14300 SCIP_CALL( conshdlrdata->solveCumulative(njobs, ests, lsts, objvals, durations, demands, capacity,
14301 hmin, hmax, timelimit, memorylimit, maxnodes, solved, infeasible, unbounded, error) );
14337 for( v = 0; v < nvars; ++v )
14339 copydemands[v] = demands[v];
14345 for( v = 0; v < nvars; ++v )
14350 assert(idx >= 0 && idx < nvars);
14353 assert(var !=
NULL);
14355 duration = durations[idx];
14356 assert(duration > 0);
14364 if( impliedest < impliedlct )
14370 assert(!infeasible);
14374 if( est == impliedest && lct == impliedlct )
14405 for( t = 0; t < ntimepoints - 1; ++t )
14408 if( loads[t] > capacity )
14410 assert(t == 0 || loads[t-1] <= capacity);
14411 return timepoints[t];
14435 for( t = ntimepoints - 1; t >= 0; --t )
14438 if( loads[t] > capacity )
14440 assert(t == ntimepoints-1 || loads[t+1] <= capacity);
14441 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)
static SCIP_RETCODE createCapacityRestrictionIntvars(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool lower)
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)
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)
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)
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)
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)
#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)
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
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)
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Bool allowaddcons, SCIP_RESULT *result)
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)
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)
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)