cons_cumulative.c
Go to the documentation of this file.
23 * - a set of jobs, represented by their integer start time variables \f$S_j\f$, their array of processing times \f$p_j\f$ and of
27 * The cumulative constraint ensures that for each point in time \f$t\f$ \f$\sum_{j: S_j \leq t < S_j + p_j} d_j \leq C\f$ holds.
41 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
61 #define CONSHDLR_ENFOPRIORITY -2040000 /**< priority of the constraint handler for constraint enforcing */
62 #define CONSHDLR_CHECKPRIORITY -3030000 /**< priority of the constraint handler for checking feasibility */
63 #define CONSHDLR_SEPAFREQ 1 /**< frequency for separating cuts; zero means to separate only in the root node */
64 #define CONSHDLR_PROPFREQ 1 /**< frequency for propagating domains; zero means only preprocessing propagation */
65 #define CONSHDLR_EAGERFREQ 100 /**< frequency for using all instead of only the useful constraints in separation,
67 #define CONSHDLR_MAXPREROUNDS -1 /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
68 #define CONSHDLR_DELAYSEPA FALSE /**< should separation method be delayed, if other separators found cuts? */
69 #define CONSHDLR_DELAYPROP FALSE /**< should propagation method be delayed, if other propagators found reductions? */
70 #define CONSHDLR_NEEDSCONS TRUE /**< should the constraint handler be skipped, if no constraints are available? */
92 #define DEFAULT_TTINFER TRUE /**< should time-table (core-times) propagator be used to infer bounds? */
95 #define DEFAULT_USEADJUSTEDJOBS FALSE /**< should during edge-finding jobs be adusted which run on the border of the effective time horizon? */
96 #define DEFAULT_TTEFCHECK TRUE /**< should time-table edge-finding be used to detect an overload? */
103 #define DEFAULT_PRESOLPAIRWISE TRUE /**< should pairwise constraint comparison be performed in presolving? */
105 #define DEFAULT_DETECTDISJUNCTIVE TRUE /**< search for conflict set via maximal cliques to detect disjunctive constraints */
106 #define DEFAULT_DETECTVARBOUNDS TRUE /**< search for conflict set via maximal cliques to detect variable bound constraints */
107 #define DEFAULT_MAXNODES 10000LL /**< number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit) */
113 #define DEFAULT_USEBDWIDENING TRUE /**< should bound widening be used during conflict analysis? */
168 unsigned int varbounds:1; /**< bool to store if variable bound strengthening was already preformed */
169 unsigned int triedsolving:1; /**< bool to store if we tried already to solve that constraint as independent subproblem */
182 SCIP_Bool cutsasconss; /**< should the cumulative constraint create cuts as knapsack constraints? */
186 SCIP_Bool useadjustedjobs; /**< should during edge-finding jobs be adusted which run on the border of the effective time horizon? */
199 SCIP_Bool detectdisjunctive; /**< search for conflict set via maximal cliques to detect disjunctive constraints */
200 SCIP_Bool detectvarbounds; /**< search for conflict set via maximal cliques to detect variable bound constraints */
202 SCIP_Bool presolpairwise; /**< should pairwise constraint comparison be performed in presolving? */
205 SCIP_Longint maxnodes; /**< number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit) */
207 SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)); /**< method to use a single cumulative condition */
211 SCIP_Longint nlbtimetable; /**< number of times the lower bound was tightened by the time-table propagator */
212 SCIP_Longint nubtimetable; /**< number of times the upper bound was tightened by the time-table propagator */
213 SCIP_Longint ncutofftimetable; /**< number of times the a cutoff was detected due to time-table propagator */
214 SCIP_Longint nlbedgefinder; /**< number of times the lower bound was tightened by the edge-finder propagator */
215 SCIP_Longint nubedgefinder; /**< number of times the upper bound was tightened by the edge-finder propagator */
216 SCIP_Longint ncutoffedgefinder; /**< number of times the a cutoff was detected due to edge-finder propagator */
217 SCIP_Longint ncutoffoverload; /**< number of times the a cutoff was detected due to overload checking via edge-finding */
218 SCIP_Longint nlbTTEF; /**< number of times the lower bound was tightened by time-table edge-finding */
219 SCIP_Longint nubTTEF; /**< number of times the upper bound was tightened by time-table edge-finding */
220 SCIP_Longint ncutoffoverloadTTEF;/**< number of times the a cutoff was detected due to overload checking via time-table edge-finding */
222 int nirrelevantjobs; /**< number of time a irrelevant/redundant jobs was removed form a constraint */
223 int nalwaysruns; /**< number of time a job removed form a constraint which run completely during the effective horizon */
227 int ndualbranchs; /**< number of times a dual branch was discoverd and applicable via probing */
228 int nallconsdualfixs; /**< number of times a dual fix was performed due to knowledge of all cumulative constraints */
238 * An inference information can be passed with each domain reduction to SCIP. This information is passed back to the
239 * constraint handler if the corresponding bound change has to be explained. It can be used to store information which
240 * help to construct a reason/explanation for a bound change. The inference information is limited to size of integer.
242 * In case of the cumulative constraint handler we store the used propagation algorithms for that particular bound
250 {
254 };
324 /** constructs an inference information out of a propagation rule, an earliest start and a latest completion time */
375 #define computeCoreWithInterval(begin, end, ect, lst) (MAX(0, MIN((end), (ect)) - MAX((lst), (begin))))
400 /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */
468 /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */
510 /** collects all necessary binary variables to represent the jobs which can be active at time point of interest */
555 /* check the end time of this job is larger than the curtime; in this case the job is still running */
664 /* check the end time of this job is larger than the curtime; in this case the job is still running */
724 /* sort the arrays not-decreasing according to startsolvalues and endsolvalues (and sort the indices in the same way) */
763 /* sort the arrays not-decreasing according to startsolvalues and endsolvalues (and sort the indices in the same way) */
813 SCIPdebugMsg(scip, "%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
814 *nvars, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), SCIPgetSolVal(scip, sol, var),
833 SCIPdebugMsg(scip, "%d: variable <%s>[%g,%g] (sol %g, duration %d) starttime %d, endtime = %d, demand = %d\n",
834 *nvars, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), SCIPgetSolVal(scip, sol, var),
843 /* sort the arrays not-decreasing according to startsolvalues and endsolvalues (and sort the indices in the same way) */
878 SCIP_Real** cumulativedemands, /**< array to store the estimated cumulative demand for each point in time */
886 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
887 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
912 createSortedEventpoints(scip, nvars, vars, durations, starttimes, endtimes, startindices, endindices, TRUE);
1098 disjfactor2 = MAX( disjfactor2, (peak-(SCIP_Real)capacity)/peak * (nlarge/(SCIP_Real)ndemands) );
1099 cumfactor1 = MAX( cumfactor1, (peak-capacity)/peak * (capacity-deltademand)/(SCIP_Real)capacity );
1138 SCIPstatisticPrintf("cumulative constraint<%s>: DISJ1=%g, DISJ2=%g, CUM=%g, RS1 = %g, RS2 = %g, EST = %g\n",
1139 SCIPconsGetName(cons), consdata->disjfactor1, disjfactor2, cumfactor1, resstrength1, resstrength2,
1221 SCIP_Real* objvals, /**< array of objective coefficients for each job (linear objective function), or NULL if none */
1269 SCIP_CALL( SCIPcreateVarBasic(subscip, &subvars[v], name, ests[v], lsts[v], objval, SCIP_VARTYPE_INTEGER) );
1287 * @note This "meta" setting has to be set first since this call overwrite all parameters including for example the
1313 SCIPdebugMsg(subscip, "solved single cumulative condition with status %d\n", SCIPgetStatus(subscip));
1385 {
1454 /* create for each job and time step a binary variable which is one if this jobs starts at this time point and a set
1495 SCIP_CALL( SCIPcreateVarBasic(subscip, &binvar, name, 0.0, 1.0, objval, SCIP_VARTYPE_BINARY) );
1498 /* add binary varibale to the set partitioning constraint which ensures that the job is started */
1509 /* adjusted the smallest earliest start time and the largest latest completion time with the effective horizon */
1516 /* create for each time a knapsack constraint which ensures that the resource capacity is not exceeded */
1525 SCIP_CALL( SCIPcreateConsBasicKnapsack(subscip, &cons, name, 0, NULL, NULL, (SCIP_Longint)capacity) );
1586 SCIPdebugMsg(scip, "solved single cumulative condition with status %d\n", SCIPgetStatus(subscip));
1652 /* check which binary varibale is the first binary varibale which is not globally fixed to zero */
1662 /* check which binary varibale is the last binary varibale which is not globally fixed to zero */
1717 * Method used to create and free the constraint handler data when including and removing the cumulative constraint
1882 SCIP_CONS** linkingconss, /**< array of linking constraints for the integer variables, or NULL */
1941 /* initialize variable lock data structure; the locks are only used if the contraint is a check constraint */
1946 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(*consdata)->linkingconss, linkingconss, nvars) );
1955 SCIP_CALL( SCIPgetTransformedVars(scip, (*consdata)->nvars, (*consdata)->vars, (*consdata)->vars) );
1957 /* multi-aggregated variables cannot be replaced by active variable; therefore we mark all variables for not
1968 SCIP_CALL( SCIPtransformConss(scip, (*consdata)->nvars, (*consdata)->linkingconss, (*consdata)->linkingconss) );
2122 SCIPinfoMessage(scip, file, ")[%d,%d) <= %d", consdata->hmin, consdata->hmax, consdata->capacity);
2147 SCIP_CALL( SCIPunlockVarCons(scip, consdata->vars[pos], cons, consdata->downlocks[pos], consdata->uplocks[pos]) );
2168 SCIPvarGetName(consdata->vars[pos]), SCIPvarGetLbGlobal(consdata->vars[pos]), SCIPvarGetUbGlobal(consdata->vars[pos]), SCIPconsGetName(cons));
2170 /* in case the we did not remove the variable in the last slot of the arrays we move the current last to this
2221 SCIPdebugMsg(scip, "linking constraint (%d of %d) for variable <%s>\n", v+1, nvars, SCIPvarGetName(var));
2244 assert(strcmp(SCIPconshdlrGetName(SCIPconsGetHdlr(consdata->linkingconss[v])), "linking") == 0 );
2259 /** check for the given starting time variables with their demands and durations if the cumulative conditions for the
2267 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
2280 int* startindices; /* we will sort the startsolvalues, thus we need to know which index of a job it corresponds to */
2281 int* endindices; /* we will sort the endsolvalues, thus we need to know which index of a job it corresponds to */
2303 /* compute time points where we have to check whether capacity constraint is infeasible or not */
2314 /* the constraint of the cumulative constraint handler should be called after the integrality check */
2319 /* we need to ensure that we check at least one time point during the effective horizon; therefore we project all
2329 /* sort the arrays not-decreasing according to start solution values and end solution values (and sort the
2417 /** check if the given constrait is valid; checks each starting point of a job whether the remaining capacity is at
2470 SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
2473 SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
2487 SCIPdebugMsg(scip, "variable <%s>: (demand %d) resolve propagation of core time algorithm (peak %d)\n",
2499 /* first we loop over all variables and adjust the capacity with those jobs which provide a global core at the
2500 * inference peak and those where the current conflict bounds provide a core at the inference peak
2514 /* compute cores of jobs; if core overlaps interval of inference variable add this job to the array */
2515 assert(!SCIPvarIsActive(var) || SCIPisFeasEQ(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, TRUE), SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE)));
2517 assert(!SCIPvarIsActive(var) || SCIPisFeasEQ(scip, SCIPgetVarLbAtIndex(scip, var, bdchgidx, TRUE), SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE)));
2527 /* check if the inference peak is part of the global bound core; if so we decreasing the capacity by the demand of
2545 /* collect the conflict bound core (the conflict bounds are those bounds which are already part of the conflict)
2546 * hence these bound are already reported by other resolve propation steps. In case a bound (lower or upper) is
2552 /* check if the inference peak is part of the conflict bound core; if so we decreasing the capacity by the demand
2555 * @note we do not need to reported that job to SCIP since the required bounds are already reported
2582 /* collect all cores of the variables which lay in the considered time window except the inference variable */
2595 /* compute cores of jobs; if core overlaps interval of inference variable add this job to the array */
2596 assert(!SCIPvarIsActive(var) || SCIPisFeasEQ(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, TRUE), SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE)));
2598 assert(!SCIPvarIsActive(var) || SCIPisFeasEQ(scip, SCIPgetVarLbAtIndex(scip, var, bdchgidx, TRUE), SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE)));
2606 SCIPvarGetName(var), SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE), SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE),
2650 SCIPdebugMsg(scip, "infer peak %d, relaxed peak %d, lst %d, ect %d\n", inferpeak, relaxedpeak, maxlst, minect);
2678 SCIP_CALL( SCIPaddConflictRelaxedLb(scip, var, bdchgidx, (SCIP_Real)(inferpeak - duration + 1)) );
2704 /** repropagation of edge finding algorithm simplified version from Petr Vilim only a small subset is reported such that
2718 SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
2720 SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
2733 SCIPdebugMsg(scip, "repropagate edge-finding with short reasons for variable <%s>\n", SCIPvarGetName(infervar));
2775 /* in case the earliest start time is equal to hmin we have to also consider the jobs which run in that region
2780 /* in case the latest completion time is equal to hmax we have to also consider the jobs which run in that region
2809 /** compute the minimum overlaps w.r.t. the duration of the job and the time window [begin,end) */
2842 /** an overload was detected due to the time-time edge-finding propagate; initialized conflict analysis, add an initial
2845 * @note the conflict analysis is not performend, only the initialized SCIP_Bool pointer is set to TRUE
2859 SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
2862 SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
2879 SCIPdebugMsg(scip, "analysis energy load in [%d,%d) (capacity %d, energy %d)\n", begin, end, capacity, requiredenergy);
2881 /* collect global contribution and adjusted the required energy by the amount of energy the inference variable
2916 SCIPvarGetName(var), SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE), SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE),
2919 /* compute the amount of energy which needs to be available for enforcing the propagation and report the bound
2926 /* get the latest start time of the infer start time variable before the propagation took place */
2929 /* the latest start time of the inference start time variable before the propagation needs to be smaller as
2930 * the end of the time interval; meaning the job needs be overlap with the time interval in case the job is
2935 /* compute the overlap of the job in case it would be scheduled w.r.t. its latest start time and the time
2940 /* the job needs to overlap with the interval; otherwise the propagation w.r.t. this time window is not valid */
2945 assert(bdchgidx == NULL || SCIPconvertRealToInt(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, TRUE)) < begin);
2959 assert(SCIPconvertRealToInt(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE)) <= (end - overlap));
2973 /* get the earliest completion time of the infer start time variable before the propagation took place */
2976 /* the earliest start time of the inference start time variable before the propagation needs to be larger as
2977 * than the beginning of the time interval; meaning the job needs be overlap with the time interval in case
2982 /* compute the overlap of the job in case it would be scheduled w.r.t. its earliest start time and the time
2987 /* the job needs to overlap with the interval; otherwise the propagation w.r.t. this time window is not valid */
3006 assert(SCIPconvertRealToInt(scip, SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE)) >= (begin + overlap - duration));
3007 SCIP_CALL( SCIPaddConflictRelaxedLb(scip, var, bdchgidx, (SCIP_Real)(begin + overlap - duration)) );
3015 /* subtract the amount of energy which is available due to the overlap of the inference start time */
3030 /* check if the has any overlap w.r.t. global bound; meaning some parts of the job will run for sure within the
3049 /* check if the job has any overlap w.r.t. local bound; meaning some parts of the job will run for sure within the
3110 SCIPdebugMsg(scip, "variable <%s> glb=[%g,%g] loc=[%g,%g], conf=[%g,%g], added=[%d,%d] (demand %d, duration %d)\n",
3147 SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
3150 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
3151 SCIP_RESULT* result /**< pointer to store the result of the propagation conflict resolving call */
3181 /* we propagated the latest start time (upper bound) step wise with a step length of at most the duration of
3184 assert(SCIPgetVarUbAtIndex(scip, infervar, bdchgidx, FALSE) - SCIPgetVarUbAtIndex(scip, infervar, bdchgidx, TRUE) < inferduration + 0.5);
3192 /* the bound passed back to be resolved might be tighter as the bound propagted by the core time propagator;
3193 * this can happen if the variable is not activ and aggregated to an activ variable with a scale != 1.0
3195 assert(SCIPconvertRealToInt(scip, SCIPgetVarUbAtIndex(scip, infervar, bdchgidx, TRUE)) + inferduration <= inferpeak);
3219 /* the bound passed back to be resolved might be tighter as the bound propagted by the core time propagator;
3220 * this can happen if the variable is not activ and aggregated to an activ variable with a scale != 1.0
3222 assert(SCIPconvertRealToInt(scip, SCIPgetVarLbAtIndex(scip, infervar, bdchgidx, TRUE)) - 1 >= inferpeak);
3237 SCIP_CALL( resolvePropagationCoretimes(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
3238 infervar, inferdemand, inferpeak, relaxedpeak, bdchgidx, usebdwidening, &provedpeak, explanation) );
3258 SCIP_CALL( SCIPaddConflictRelaxedLb(scip, infervar, bdchgidx, (SCIP_Real)(provedpeak - inferduration + 1)) );
3335 if( SCIPvarGetNLocksDownType(var, SCIP_LOCKTYPE_MODEL) == downlocks[v] && !SCIPisNegative(scip, objval) )
3343 SCIP_CALL( SCIPbranchVarHole(scip, var, SCIPvarGetLbLocal(var), (SCIP_Real)alternativelbs[v], NULL, NULL) );
3353 if( SCIPvarGetNLocksUpType(var, SCIP_LOCKTYPE_MODEL) == uplocks[v] && !SCIPisPositive(scip, objval) )
3361 SCIP_CALL( SCIPbranchVarHole(scip, var, (SCIP_Real)alternativeubs[v], SCIPvarGetUbLocal(var), NULL, NULL) );
3446 /** computes a point in time when the capacity is exceeded returns hmax if this does not happen */
3457 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
3458 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
3503 subtractStartingJobDemands(consdata, curtime, starttimes, startindices, &freecapacity, &j, nvars);
3531 /** checks all cumulative constraints for infeasibility and add branching candidates to storage */
3709 /** in case the cumulative constraint is independent of every else, solve the cumulative problem and apply the fixings
3716 SCIP_Longint maxnodes, /**< number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit) */
3742 /* if SCIP is in probing mode or repropagation we cannot perform this dual reductions since this dual reduction
3748 /* constraints for which the check flag is set to FALSE, did not contribute to the lock numbers; therefore, we cannot
3756 /* if the cumulative constraint is the only constraint of the original problem or the only check constraint in the
3770 /* after 250 conflict we force a restart since then the variable statistics are reasonable initialized */
3806 /* check if already tried to solve that constraint as independent sub problem; we do not want to try it again if we
3816 /* mark the constraint to be tried of solving it as independent sub problem; in case that is successful the
3821 SCIPdebugMsg(scip, "the cumulative constraint <%s> is independent from rest of the problem (%d variables, %d constraints)\n",
3836 /* if a variables array is given, use the variable bounds otherwise the default values stored in the ests and lsts
3854 /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
3862 SCIP_CALL( SCIPsolveCumulative(scip, nvars, lbs, ubs, objvals, consdata->durations, consdata->demands, consdata->capacity,
3863 consdata->hmin, consdata->hmax, timelimit, memorylimit, maxnodes, &solved, cutoff, unbounded, &error) );
3943 SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
3946 SCIPdebugMsg(scip, "detected infeasibility due to adding a core to the core resource profile\n");
3947 SCIPdebugMsg(scip, "variable <%s>[%g,%g] (demand %d, duration %d)\n", SCIPvarGetName(infervar),
3955 SCIP_CALL( resolvePropagationCoretimes(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
3960 /* add both bound of the inference variable since these biuld the core which we could not inserted */
3963 SCIP_CALL( SCIPaddConflictRelaxedLb(scip, infervar, NULL, (SCIP_Real)(inferpeak - inferduration + 1)) );
3978 /** We are using the core resource profile which contains all core except the one of the start time variable which we
3979 * want to propagate, to incease the earliest start time. This we are doing in steps of length at most the duration of
3980 * the job. The reason for that is, that this makes it later easier to resolve this propagation during the conflict
3999 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
4026 /* first we find left position of earliest start time (lower bound) in resource profile; this position gives us the
4052 /* we search for a peak within the core profile which conflicts with the demand of the start time variable; we
4065 /* if we found no peak that means current the job could be scheduled at its earliest start time without
4071 /* the peak position gives us a time point where the start time variable is in conflict with the resource
4072 * profile. That means we have to move it to the next time point in the resource profile but at most to the
4084 SCIP_CALL( analyseInfeasibelCoreInsertion(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
4095 /* construct the inference information which we are using with the conflict analysis to resolve that particular
4101 SCIP_CALL( SCIPinferVarLbCons(scip, var, (SCIP_Real)newlb, cons, inferInfoToInt(inferinfo), TRUE, infeasible, &tightened) );
4105 SCIPdebugMsg(scip, "variable <%s> new lower bound <%d> -> <%d>\n", SCIPvarGetName(var), est, newlb);
4108 /* for the statistic we count the number of times a lower bound was tightened due the the time-table algorithm */
4113 * @note We are taking the lower of the start time variable on purpose instead of newlb. This is due the fact that
4114 * the proposed lower bound might be even strength by be the core which can be the case if aggregations are
4131 /** We are using the core resource profile which contains all core except the one of the start time variable which we
4132 * want to propagate, to decrease the latest start time. This we are doing in steps of length at most the duration of
4133 * the job. The reason for that is, that this makes it later easier to resolve this propagation during the conflict
4172 /* first we find left position of latest completion time minus 1 (upper bound + duration) in resource profile; That
4173 * is the last time point where the job would run if schedule it at its latest start time (upper bound). This
4203 /* we search for a peak within the core profile which conflicts with the demand of the start time variable; we
4215 /* if we found no peak that means the current job could be scheduled at its latest start time without conflicting
4221 /* the peak position gives us a time point where the start time variable is in conflict with the resource
4222 * profile. That means the job has be done until that point. Hence that gives us the latest completion
4223 * time. Note that that we want to move the bound by at most the duration length (the remaining move we are
4230 /* construct the inference information which we are using with the conflict analysis to resolve that particular
4236 SCIP_CALL( SCIPinferVarUbCons(scip, var, (SCIP_Real)newub, cons, inferInfoToInt(inferinfo), TRUE, &infeasible, &tightened) );
4240 SCIPdebugMsg(scip, "variable <%s>: new upper bound <%d> -> <%d>\n", SCIPvarGetName(var), lst, newub);
4243 /* for the statistic we count the number of times a upper bound was tightened due the the time-table algorithm */
4248 * @note We are taking the upper of the start time variable on purpose instead of newub. This is due the fact that
4249 * the proposed upper bound might be even strength by be the core which can be the case if aggregations are
4267 /** compute for the different earliest start and latest completion time the core energy of the corresponding time
4277 int* coreEnergyAfterEst, /**< array to store the core energy after the earliest start time of each job */
4278 int* coreEnergyAfterLct /**< array to store the core energy after the latest completion time of each job */
4297 energy += SCIPprofileGetLoad(profile, t-1) * (SCIPprofileGetTime(profile, t) - SCIPprofileGetTime(profile, t-1));
4306 coreEnergyAfterEst[v] = energy + SCIPprofileGetLoad(profile, t-1) * (SCIPprofileGetTime(profile, t) - ests[v]);
4322 energy += SCIPprofileGetLoad(profile, t-1) * (SCIPprofileGetTime(profile, t) - SCIPprofileGetTime(profile, t-1));
4331 coreEnergyAfterLct[v] = energy + SCIPprofileGetLoad(profile, t-1) * (SCIPprofileGetTime(profile, t) - lcts[v]);
4428 SCIP_Longint energy, /**< available energy for the flexible part of the hob within the time window */
4430 int* inferinfos, /**< pointer to store the inference information which is need for the (best) lower bound change */
4432 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
4445 /* if the job can be processed completely before or after the time window, nothing can be tightened */
4449 /* if flexible part runs completely within the time window (assuming it is scheduled on its earliest start time), we
4455 /* check if the available energy in the time window is to small to handle the flexible part if it is schedule on its
4461 /* adjust the available energy for the job; the given available energy assumes that the core of the considered job is
4464 * @note the variable ect define the earliest completion time of the flexible part of the job; hence we need to
4469 /* compute a latest start time (upper bound) such that the job consums at most the available energy
4475 /* check if we detected an infeasibility which is the case if the new lower bound is larger than the current upper
4498 begin, end, var, SCIP_BOUNDTYPE_LOWER, NULL, relaxedbd, conshdlrdata->usebdwidening, explanation) );
4541 SCIP_Longint energy, /**< available energy for the flexible part of the hob within the time window */
4543 int* inferinfos, /**< pointer to store the inference information which is need for the (best) upper bound change */
4545 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
4559 /* if flexible part of the job can be processed completely before or after the time window, nothing can be tightened */
4563 /* if flexible part runs completely within the time window (assuming it is scheduled on its latest start time), we
4569 /* check if the available energy in the time window is to small to handle the flexible part of the job */
4573 /* adjust the available energy for the job; the given available energy assumes that the core of the considered job is
4576 * @note the variable lst define the latest start time of the flexible part of the job; hence we need to compute the
4582 /* compute a latest start time (upper bound) such that the job consums at most the available energy
4589 /* check if we detected an infeasibility which is the case if the new upper bound is smaller than the current lower
4612 begin, end, var, SCIP_BOUNDTYPE_UPPER, NULL, relaxedbd, conshdlrdata->usebdwidening, explanation) );
4635 /** propagate the upper bounds and "opportunistically" the lower bounds using the time-table edge-finding algorithm */
4649 int* lbinferinfos, /**< array to store the inference information for the lower bound changes */
4650 int* ubinferinfos, /**< array to store the inference information for the upper bound changes */
4651 int* lsts, /**< array of latest start time of the flexible part in the same order as the variables */
4653 int* perm, /**< permutation of the variables w.r.t. the non-decreasing order of the earliest start times */
4659 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
4698 /* check if the smallest interval has a size such that the total energy fits, if so we can skip the propagator */
4704 /* loop over all variable in non-increasing order w.r.t. the latest completion time; thereby, the latest completion
4717 /* if the latest completion time is larger then hmax an infeasibility cannot be detected, since after hmax an
4730 /* if the latest completion time equals to previous end time, we can continue since this particular interval
4738 /* In case we only want to detect an overload (meaning no bound propagation) we can skip the interval; this is
4739 * the case if the free energy (the energy which is not occupied by any core) is smaller than the previous minimum
4750 freeenergy = capacity * ((SCIP_Longint) end - lct) - coreEnergyAfterLct[v] + coreEnergyAfterEnd;
4754 SCIPdebugMsg(scip, "skip latest completion time <%d> (minimum available energy <%d>, free energy <%d>)\n", lct, minavailable, freeenergy);
4770 /* loop over the job in non-increasing order w.r.t. the earliest start time; these earliest start time are
4771 * defining the beginning of the time interval under investigation; Thereby, the time interval gets wider and
4792 /* if the job starts after the current end, we can skip it and do not need to consider it again since the
4801 /* check if the interval has a size such that the total energy fits, if so we can skip all intervals with the
4821 /* in case the earliest start time is equal to minbegin, the job lies completely within the time window under
4830 SCIP_CALL( tightenUbTTEF(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
4831 var, duration, demand, est, lst, lct, minbegin, end, minavailable, &(newubs[idx]), &(ubinferinfos[idx]),
4838 SCIPdebugMsg(scip, "check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, lst of free part <%d>\n",
4839 SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), duration, demand, est, lst);
4844 /* if the earliest start time is smaller than hmin we can stop here since the next job will not decrease the
4864 /* compute the flexible energy which is part of the time interval for sure if the job is scheduled
4876 /* compute the flexible energy of the job which is not part of flexible energy of the time interval */
4892 freeenergy = capacity * ((SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterEst[i] + coreEnergyAfterEnd;
4897 SCIPdebugMsg(scip, "analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
4914 /* for the statistic we count the number of times a cutoff was detected due the time-time-edge-finding */
4915 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffoverloadTTEF++ );
4920 /* check if the available energy is not sufficent to schedule the flexible energy of the best candidate job */
4931 energy = freeenergy + (computeCoreWithInterval(begin, end, ect, lst) + MAX(0, (SCIP_Longint) end - lsts[lbcand])) * demands[lbcand];
4986 /** propagate the lower bounds and "opportunistically" the upper bounds using the time-table edge-finding algorithm */
5000 int* lbinferinfos, /**< array to store the inference information for the lower bound changes */
5001 int* ubinferinfos, /**< array to store the inference information for the upper bound changes */
5002 int* ects, /**< array of earliest completion time of the flexible part in the same order as the variables */
5004 int* perm, /**< permutation of the variables w.r.t. the non-decreasing order of the latest completion times */
5010 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
5051 /* check if the smallest interval has a size such that the total energy fits, if so we can skip the propagator */
5057 /* loop over all variable in non-decreasing order w.r.t. the earliest start times; thereby, the earliest start times
5071 /* if the earliest start time is smaller then hmin an infeasibility cannot be detected, since before hmin an
5081 /* if the latest earliest start time equals to previous start time, we can continue since this particular interval
5100 /* loop over the job in non-decreasing order w.r.t. the latest completion time; these latest completion times are
5101 * defining the ending of the time interval under investigation; thereby, the time interval gets wider and wider
5121 /* if the job has a latest completion time before the the current start, we can skip it and do not need to
5122 * consider it again since the earliest start times (which define the start) are scant in non-decreasing order
5130 /* check if the interval has a size such that the total energy fits, if so we can skip all intervals which
5150 /* in case the latest completion time is equal to minend, the job lies completely within the time window under
5159 SCIP_CALL( tightenLbTTEF(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
5160 var, duration, demand, est, ect, lct, begin, minend, minavailable, &(newlbs[idx]), &(lbinferinfos[idx]),
5167 SCIPdebugMsg(scip, "check variable <%s>[%g,%g] (duration %d, demands %d, est <%d>, ect of free part <%d>\n",
5168 SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), duration, demand, est, ect);
5173 /* if the latest completion time is larger than hmax we can stop here since the next job will not decrease the
5193 /* compute the flexible energy which is part of the time interval for sure if the job is scheduled
5205 /* compute the flexible energy of the job which is not part of flexible energy of the time interval */
5221 freeenergy = capacity * ((SCIP_Longint) end - begin) - flexenergy - coreEnergyAfterStart + coreEnergyAfterLct[i];
5226 SCIPdebugMsg(scip, "analyze overload within time window [%d,%d) capacity %d\n", begin, end, capacity);
5243 /* for the statistic we count the number of times a cutoff was detected due the time-time-edge-finding */
5244 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffoverloadTTEF++ );
5249 /* check if the available energy is not sufficent to schedule the flexible energy of the best candidate job */
5263 energy = freeenergy + (computeCoreWithInterval(begin, end, ect, lst) + MAX(0, (SCIP_Longint) ects[ubcand] - begin)) * demands[ubcand];
5317 /** checks whether the instance is infeasible due to a overload within a certain time frame using the idea of time-table
5321 * - Petr Vilim, "Timetable Edge Finding Filtering Algorithm for Discrete Cumulative Resources", In: Tobias
5322 * Achterberg and J. Christopher Beck (Eds.), Integration of AI and OR Techniques in Constraint Programming for
5324 * - Andreas Schutt, Thibaut Feydy, and Peter J. Stuckey, "Explaining Time-Table-Edge-Finding Propagation for the
5342 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
5388 /* we need to buffer the bound changes since the propagation algorithm cannot handle new bound dynamically */
5398 collectDataTTEF(scip, nvars, vars, durations, demands, hmin, hmax, permests, ests, permlcts, lcts, ects, lsts, flexenergies);
5404 /* compute for the different earliest start and latest completion time the core energy of the corresponding time
5407 SCIP_CALL( computeCoreEngeryAfter(scip, profile, nvars, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct) );
5410 SCIP_CALL( propagateUbTTEF(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
5412 permests, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5415 SCIP_CALL( propagateLbTTEF(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
5417 permlcts, ests, lcts, coreEnergyAfterEst, coreEnergyAfterLct, initialized, explanation, cutoff) );
5425 SCIP_CALL( SCIPinferVarLbCons(scip, vars[v], (SCIP_Real)newlbs[v], cons, lbinferinfos[v], TRUE, &infeasible, &tightened) );
5438 SCIP_CALL( SCIPinferVarUbCons(scip, vars[v], (SCIP_Real)newubs[v], cons, ubinferinfos[v], TRUE, &infeasible, &tightened) );
5440 /* since upper bound was compute w.r.t. the "old" bound the previous lower bound update together with this upper
5478 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffoverloadTTEF++ );
5512 /** a cumulative condition is not satisfied if its capacity is exceeded at a time where jobs cannot be shifted (core)
5513 * anymore we build up a cumulative profile of all cores of jobs and try to improve bounds of all jobs; also known as
5531 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
5553 SCIPdebugMsg(scip, "propagate cores of cumulative condition of constraint <%s>[%d,%d) <= %d\n",
5587 /* check if the job runs completely outside of the effective horizon [hmin, hmax); if so skip it */
5602 SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), duration, demand, begin, end);
5608 SCIP_CALL( coretimesUpdateLb(scip, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
5642 SCIP_CALL( analyseInfeasibelCoreInsertion(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
5643 var, duration, demand, SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
5651 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutofftimetable++ );
5665 SCIP_VAR* var; /**< start time variable of the job if the node data belongs to a leaf, otherwise NULL */
5673 SCIP_Longint enveloptheta; /**< the maximal energy of a subset of jobs part of the theta set */
5759 nodedata->enveloptheta = MAX(leftdata->enveloptheta + rightdata->energytheta, rightdata->enveloptheta);
5771 nodedata->enveloplambda = MAX(leftdata->enveloplambda + rightdata->energytheta, rightdata->enveloplambda);
5777 nodedata->enveloplambda = MAX(nodedata->enveloplambda, leftdata->enveloptheta + rightdata->energylambda);
5785 nodedata->energylambda = MAX(leftdata->energylambda + rightdata->energytheta, leftdata->energytheta + rightdata->energylambda);
6093 if( leftdata->energylambda >= 0 && nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6143 if( leftdata->enveloplambda >= 0 && nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6180 SCIPdebugMessage("add variable <%s> as elements %d to omegaset\n", SCIPvarGetName(nodedata->var), *nelements);
6185 (*energy) += (nodedata->duration - nodedata->leftadjust - nodedata->rightadjust) * nodedata->demand;
6237 if( leftdata->enveloptheta >= 0 && nodedata->enveloptheta == leftdata->enveloptheta + rightdata->energytheta )
6292 if( leftdata->energylambda >= 0 && nodedata->energylambda == leftdata->energylambda + rightdata->energytheta )
6352 if( leftdata->enveloplambda >= 0 && nodedata->enveloplambda == leftdata->enveloplambda + rightdata->energytheta )
6391 SCIPvarGetName(nodedata->var), SCIPvarGetLbLocal(nodedata->var), SCIPvarGetUbLocal(nodedata->var),
6392 SCIPvarGetLbGlobal(nodedata->var), SCIPvarGetUbGlobal(nodedata->var), duration, nodedata->demand);
6401 {
6414 {
6427 * @note the conflict analysis is not performend, only the initialized SCIP_Bool pointer is set to TRUE
6438 SCIP_Bool propest, /**< should the earliest start times be propagated, otherwise the latest completion times */
6442 SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
6452 SCIPdebugMsg(scip, "est=%d, lct=%d, propest %u, reportedenergy %d, shift %d\n", est, lct, propest, reportedenergy, shift);
6460 /* collect the energy of the responsible leaves until the cumulative energy is large enough to detect an overload;
6481 SCIPdebugMsg(scip, "time window [%d,%d) available energy %d, required energy %d\n", est, lct, energy, reportedenergy);
6504 /* report the variables and relax their bounds to final time interval [est,lct) which was been detected to be
6518 SCIP_CALL( SCIPaddConflictRelaxedUb(scip, nodedata->var, NULL, (SCIP_Real)(est - nodedata->leftadjust)) );
6519 SCIP_CALL( SCIPaddConflictRelaxedLb(scip, nodedata->var, NULL, (SCIP_Real)(lct - nodedata->duration + nodedata->rightadjust)) );
6536 /** computes a new latest starting time of the job in 'respleaf' due to the energy consumption and stores the
6560 newest = (int)SCIPfeasCeil(scip, (energy - (SCIP_Real)(capacity - demand) * (lct - est)) / (SCIP_Real)demand);
6568 /** propagates start time using an edge finding algorithm which is based on binary trees (theta lambda trees)
6570 * @note The algorithm is based on the paper: Petr Vilim, "Edge Finding Filtering Algorithm for Discrete Cumulative
6582 SCIP_Bool propest, /**< should the earliest start times be propagated, otherwise the latest completion times */
6585 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
6598 /* iterate over all added candidate (leaves) in non-increasing order w.r.t. their latest completion time */
6659 newest = computeEstOmegaset(scip, leafdata->duration, leafdata->demand, capacity, est, lct, energy);
6661 /* if the computed earliest start time is greater than the latest completion time of the omega set we detected an overload */
6667 SCIP_CALL( analyzeConflictOverload(scip, omegaset, capacity, nelements, est, lct, 0, propest, shift,
6672 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffedgefinder++ );
6682 /* constuct inference information; store used propagation rule and the the time window of the omega set */
6691 /* for the statistic we count the number of times a lower bound was tightened due the edge-finder */
6696 /* constuct inference information; store used propagation rule and the the time window of the omega set */
6700 SCIPvarGetName(leafdata->var), SCIPvarGetUbLocal(leafdata->var), shift - newest - leafdata->duration);
6702 SCIP_CALL( SCIPinferVarUbCons(scip, leafdata->var, (SCIP_Real)(shift - newest - leafdata->duration),
6705 /* for the statistic we count the number of times a upper bound was tightened due the edge-finder */
6753 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffedgefinder++ );
6775 /** checks whether the instance is infeasible due to a overload within a certain time frame using the idea of theta trees
6777 * @note The algorithm is based on the paper: Petr Vilim, "Max Energy Filtering Algorithm for Discrete Cumulative
6778 * Resources". In: Willem Jan van Hoeve and John N. Hooker (Eds.), Integration of AI and OR Techniques in
6779 * Constraint Programming for Combinatorial Optimization Problems (CPAIOR 2009), LNCS 5547, pp 294--308
6793 SCIP_Bool propest, /**< should the earliest start times be propagated, otherwise the latest completion times */
6795 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
6818 SCIPdebugMsg(scip, "check overload of cumulative condition of constraint <%s> (capacity %d)\n", SCIPconsGetName(cons), capacity);
6835 /* compute the latest completion time of all jobs which define the shift we apply to run the algorithm for the
6847 /* collect earliest and latest completion times and ignore jobs which do not run completion within the effective
6873 /* adjust the duration, earliest start time, and latest completion time of jobs which do not lie completely in the
6889 /* only consider jobs which have a (adjusted) duration greater than zero (the amound which will run defenetly
6926 /* adjust earliest start time to make it unique in case several jobs have the same earliest start time */
6936 /* the envelop is the energy of the job plus the total amount of energy which is available in the time period
6937 * before that job can start, that is [0,est). The envelop is later used to compare the energy consumption of a
6959 /* iterate over all jobs in non-decreasing order of their latest completion times and add them to the theta set until
6967 /* check if the new job opens a time window which size is so large that it offers more energy than the total
6995 SCIPdebugMsg(scip, "detects cutoff due to overload in time window [?,%d) (ncands %d)\n", nodedatas[j]->lct, j);
6999 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutoffoverload++ );
7005 /* in case an overload was detected and the conflict analysis is applicable, create an initialize explanation */
7016 /* scan the remaining candidates for a global contributions within the time window of the last inserted candidate
7052 SCIP_CALL( analyzeConflictOverload(scip, leaves, capacity, ninsertcands, est, lct, glbenery, propest, shift,
7058 SCIP_CALL( inferboundsEdgeFinding(scip, conshdlrdata, cons, tree, leaves, capacity, ninsertcands,
7078 /** checks whether the instance is infeasible due to a overload within a certain time frame using the idea of theta trees
7080 * @note The algorithm is based on the paper: Petr Vilim, "Max Energy Filtering Algorithm for Discrete Cumulative
7081 * Resources". In: Willem Jan van Hoeve and John N. Hooker (Eds.), Integration of AI and OR Techniques in
7082 * Constraint Programming for Combinatorial Optimization Problems (CPAIOR 2009), LNCS 5547, pp 294--308
7097 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
7111 SCIP_CALL( checkOverloadViaThetaTree(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
7123 SCIP_CALL( checkOverloadViaThetaTree(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
7129 /** checks if the constraint is redundant; that is the case if its capacity can never be exceeded; therefore we check
7130 * with respect to the lower and upper bounds of the integer start time variables the maximum capacity usage for all
7149 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
7150 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
7203 /* sort the arrays not-decreasing according to startsolvalues and endsolvalues (and sort the indices in the same way) */
7252 /** creates the worst case resource profile, that is, all jobs are inserted with the earliest start and latest
7261 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
7268 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
7302 /* check if the job runs completely outside of the effective horizon [hmin, hmax); if so skip it */
7327 SCIP_CALL( analyseInfeasibelCoreInsertion(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
7328 var, duration, demand, SCIPprofileGetTime(profile, pos), conshdlrdata->usebdwidening, initialized, explanation) );
7336 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->ncutofftimetable++ );
7362 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
7378 SCIP_CALL( consCheckRedundancy(scip, nvars, vars, durations, demands, capacity, hmin, hmax, redundant) );
7387 SCIP_CALL_TERMINATE( retcode, createCoreProfile(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax,
7393 SCIP_CALL_TERMINATE( retcode, propagateTimetable(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7400 SCIP_CALL_TERMINATE( retcode, propagateEdgeFinding(scip, conshdlrdata, nvars, vars, durations, demands, capacity, hmin, hmax,
7407 SCIP_CALL_TERMINATE( retcode, propagateTTEF(scip, conshdlrdata, profile, nvars, vars, durations, demands, capacity, hmin, hmax, cons,
7495 /** it is dual feasible to remove the values {leftub+1, ..., rightlb-1} since SCIP current does not feature domain holes
7496 * we use the probing mode to check if one of the two branches is infeasible. If this is the case the dual redundant can
7507 SCIP_Real* leftimpllbs, /**< lower bounds after applying implications and cliques in left branch, or NULL */
7508 SCIP_Real* leftimplubs, /**< upper bounds after applying implications and cliques in left branch, or NULL */
7511 SCIP_Real* rightimpllbs, /**< lower bounds after applying implications and cliques in right branch, or NULL */
7512 SCIP_Real* rightimplubs, /**< upper bounds after applying implications and cliques in right branch, or NULL */
7513 SCIP_Real* rightproplbs, /**< lower bounds after applying domain propagation in right branch */
7514 SCIP_Real* rightpropubs, /**< upper bounds after applying domain propagation in right branch */
7515 int* nfixedvars, /**< pointer to counter which is increased by the number of deduced variable fixations */
7541 SCIP_CALL( SCIPapplyProbingVar(scip, vars, nvars, probingpos, SCIP_BOUNDTYPE_UPPER, leftub, -1,
7558 /* note that probing can change the upper bound and thus the right branch may have been detected infeasible if
7576 SCIP_CALL( SCIPapplyProbingVar(scip, vars, nvars, probingpos, SCIP_BOUNDTYPE_LOWER, rightlb, -1,
7615 /* in case the variable is not active we need to check the object coefficient of the active variable */
7634 /* rounding the integer variable down is only a valid dual reduction if the object coefficient is zero or positive
7639 if( (scalar > 0 && SCIPisNegative(scip, objval)) || (scalar < 0 && SCIPisPositive(scip, objval)) )
7664 /* in case the variable is not active we need to check the object coefficient of the active variable */
7683 /* rounding the integer variable up is only a valid dual reduction if the object coefficient is zero or negative
7688 if( (scalar > 0 && SCIPisPositive(scip, objval)) || (scalar < 0 && SCIPisNegative(scip, objval)) )
7694 /** For each variable we compute an alternative lower and upper bounds. That is, if the variable is not fixed to its
7695 * lower or upper bound the next reasonable lower or upper bound would be this alternative bound (implying that certain
7696 * values are not of interest). An alternative bound for a particular is only valied if the cumulative constarints are
7744 retcode = SCIPcreateWorstCaseProfile(scip, profile, consdata->nvars, consdata->vars, consdata->durations, consdata->demands);
7775 /* multi-aggregated variables should appear here since we mark the variables to be not mutlt-aggregated */
7842 int* nfixedvars, /**< pointer to counter which is increased by the number of deduced variable fixations */
7903 /* for the statistic we count the number of jobs which are dual fixed due the information of all cumulative
7906 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nallconsdualfixs++ );
7912 /* In the current version SCIP, variable domains are single intervals. Meaning that domain holes or not
7913 * representable. To retrieve a potential dual reduction we using probing to check both branches. If one in
7916 SCIP_CALL( applyProbingVar(scip, vars, nvars, v, (SCIP_Real) lb, (SCIP_Real) alternativelbs[v],
7917 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7922 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nallconsdualfixs++ );
7949 /* for the statistic we count the number of jobs which are dual fixed due the information of all cumulative
7952 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nallconsdualfixs++ );
7958 /* In the current version SCIP, variable domains are single intervals. Meaning that domain holes or not
7959 * representable. To retrieve a potential dual reduction we using probing to check both branches. If one in
7962 SCIP_CALL( applyProbingVar(scip, vars, nvars, v, (SCIP_Real) alternativeubs[v], (SCIP_Real) ub,
7963 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
7968 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nallconsdualfixs++ );
7996 int* nfixedvars, /**< pointer to counter which is increased by the number of deduced variable fixations */
7998 SCIP_Bool* branched /**< pointer to store if a branching was applied, or NULL to avoid branching */
8032 SCIP_CALL( computeAlternativeBounds(scip, conss, nconss, local, alternativelbs, alternativeubs, downlocks, uplocks) );
8035 SCIP_CALL( applyAlternativeBoundsFixing(scip, vars, nvars, alternativelbs, alternativeubs, downlocks, uplocks,
8040 SCIP_CALL( applyAlternativeBoundsBranching(scip, vars, nvars, alternativelbs, alternativeubs, downlocks, uplocks, branched) );
8065 int* startvalues, /**< upper bounds on finishing time per job for activities from 0,..., nactivities -1 */
8156 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &row, SCIPconsGetHdlr(cons), rowname, -SCIPinfinity(scip), (SCIP_Real)bigcoversize,
8213 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &consdata->bcoverrows, consdata->nbcoverrows, consdata->bcoverrowssize) );
8244 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &row, SCIPconsGetHdlr(cons), rowname, -SCIPinfinity(scip), (SCIP_Real)smallcoversize,
8301 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &consdata->scoverrows, consdata->nscoverrows, consdata->scoverrowssize) );
8328 int* startindices; /* we sort the startvalues, so we need to know wich index of a job it corresponds to */
8329 int* endindices; /* we sort the endvalues, so we need to know wich index of a job it corresponds to */
8369 endvalues[j] = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(consdata->vars[j])) + consdata->durations[j];
8421 /* we can create covering constraints for each pint in time in interval [curtime; nextprofilechange[ */
8452 /** this method creates a row for time point curtime which insures the capacity restriction of the cumulative
8484 SCIP_CALL( collectBinaryVars(scip, consdata, &binvars, &coefs, &nbinvars, startindices, curtime, nstarted, nfinished) );
8487 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%d[%d]", SCIPconsGetName(cons), nstarted-1, curtime);
8494 SCIP_CALL( SCIPcreateConsKnapsack(scip, &lincons, name, 0, NULL, NULL, (SCIP_Longint)(capacity),
8510 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &row, SCIPconsGetHdlr(cons), name, -SCIPinfinity(scip), (SCIP_Real)capacity, FALSE, FALSE, SCIPconsIsRemovable(cons)) );
8529 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &consdata->demandrows, consdata->ndemandrows, consdata->demandrowssize) );
8542 /** this method checks how many cumulatives can run at most at one time if this is greater than the capacity it creates
8556 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
8557 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
8610 subtractStartingJobDemands(consdata, curtime, starttimes, startindices, &freecapacity, &j, nvars);
8627 /* step forward until next job is released and see whether capacity constraint is met or not */
8636 SCIP_CALL( createCapacityRestriction(scip, cons, startindices, curtime, j+1, endindex, cutsasconss) );
8638 /* create for all points in time between the current event point and next start event point a row if the free
8651 SCIP_CALL( createCapacityRestriction(scip, cons, startindices, t, j+1, endindex, cutsasconss) );
8668 /** creates LP rows corresponding to cumulative constraint; therefore, check each point in time if the maximal needed
8723 SCIP_Bool cutsasconss, /**< should the cumulative constraint create the cuts as constraints? */
8820 SCIPdebugMsg(scip, "cumulative constraint <%s> separated %d cuts\n", SCIPconsGetName(cons), ncuts);
8949 /** this method creates a row for time point @p curtime which ensures the capacity restriction of the cumulative constraint */
8979 SCIP_CALL( collectIntVars(scip, consdata, &activevars, startindices, curtime, nstarted, nfinished, lower, &lhs ) );
8985 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &row, SCIPconsGetHdlr(cons), name, (SCIP_Real) lhs, SCIPinfinity(scip),
8991 SCIP_CALL( SCIPcreateEmptyRowCons(scip, &row, SCIPconsGetHdlr(cons), name, -SCIPinfinity(scip), (SCIP_Real) lhs,
9030 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
9031 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
9065 createSelectedSortedEventpointsSol(scip, consdata, sol, starttimes, endtimes, startindices, endindices, &nvars, lower);
9083 subtractStartingJobDemands(consdata, curtime, starttimes, startindices, &freecapacity, &j, nvars);
9098 SCIP_CALL( createCapacityRestrictionIntvars(scip, cons, startindices, curtime, j+1, endindex, lower, cutoff) );
9121 /** returns TRUE if all demands are smaller than the capacity of the cumulative constraint and if the total demand is
9143 /* if no activities are associated with this cumulative then this constraint is not infeasible, return */
9204 /** remove jobs which have a duration or demand of zero (zero energy) or lay outside the efficient horizon [hmin, hmax);
9263 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nirrelevantjobs++ );
9297 /* jobs with a demand greater than the the capacity have to moved outside the time interval [hmin,hmax) */
9305 /* the jobs has to have an overlap with the efficient horizon otherwise it would be already removed */
9311 /* the job will at least run partly in the time interval [hmin,hmax) this means the problem is infeasible */
9317 SCIP_CALL( SCIPtightenVarUb(scip, var, (SCIP_Real)(consdata->hmin - duration), TRUE, cutoff, &tightened) );
9325 SCIP_CALL( SCIPtightenVarLb(scip, var, (SCIP_Real)(consdata->hmax), TRUE, cutoff, &tightened) );
9332 /* this job can run before or after the time interval [hmin,hmax) thus we create a bound disjunction
9362 SCIP_CALL( SCIPcreateConsBounddisjunction(scip, &cons, name, 2, vartuple, boundtypetuple, boundtuple,
9412 SCIPdebugMsg(scip, "cumulative constraint <%s> has %d jobs left, cutoff %u\n", SCIPconsGetName(cons), consdata->nvars, *cutoff);
9417 /** fix integer variable to upper bound if the rounding locks and the object coefficient are in favor of that */
9430 /* if SCIP is in probing mode or repropagation we cannot perform this dual reductions since this dual reduction
9436 /* rounding the variable to the upper bound is only a feasible dual reduction if the cumulative constraint
9448 /* rounding the integer variable up is only a valid dual reduction if the object coefficient is zero or negative
9462 SCIPdebugMsg(scip, "fix variable <%s> to upper bound %g\n", SCIPvarGetName(var), SCIPvarGetUbLocal(var));
9469 /** fix integer variable to lower bound if the rounding locks and the object coefficient are in favor of that */
9482 /* if SCIP is in probing mode or repropagation we cannot perform this dual reductions since this dual reduction
9488 /* rounding the variable to the lower bound is only a feasible dual reduction if the cumulative constraint
9509 SCIPdebugMsg(scip, "fix variable <%s> to lower bound %g\n", SCIPvarGetName(var), SCIPvarGetLbLocal(var));
9562 SCIPdebugMsg(scip, "update cumulative condition (%d + %d > %d) to unary cumulative condition\n", mindemand1, mindemand2, *capacity);
9574 SCIPdebugMsg(scip, "cumulative condition: dividing demands by %" SCIP_LONGINT_FORMAT "\n", gcd);
9588 /** divides demands by their greatest common divisor and divides capacity by the same value, rounding down the result;
9589 * in case the the smallest demands add up to more than the capacity we reductions all demands to one as well as the
9615 /**@todo sort items w.r.t. the demands, because we can stop earlier if the smaller weights are evaluated first */
9617 SCIP_CALL( normalizeCumulativeCondition(scip, consdata->nvars, consdata->vars, consdata->durations,
9633 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
9648 SCIP_CALL_FINALLY( SCIPcreateWorstCaseProfile(scip, profile, nvars, vars, durations, demands), SCIPprofileFree(&profile) );
9668 /* If SCIP is repropagating the root node, it is not possible to decompose the constraints. This is the case since
9669 * the conflict analysis stores the constraint pointer for bound changes made by this constraint. These pointer
9670 * are used during the resolve propagation phase to explain bound changes. If we would decompose certain jobs into
9671 * a new cumulative constraint, the "old" pointer is not valid. More precise, the "old" constraint is not able to
9680 /* check if there exist a time point within the effective horizon [hmin,hmax) such that the capacity is not exceed w.r.t. worst case profile */
9691 /* check if the current time point does not exceed the capacity w.r.t. worst case resource profile; if so we
9714 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
9738 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
9740 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
9748 SCIP_CALL( SCIPcreateConsCumulative(scip, &cons, name, nvars, vars, durations, demands, capacity,
9749 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
9789 SCIPdebugMsg(scip, "cumulative constraint <%s> adjust hmin <%d> -> <%d>\n", SCIPconsGetName(cons), consdata->hmin, hmin);
9798 SCIPdebugMsg(scip, "cumulative constraint <%s> adjust hmax <%d> -> <%d>\n", SCIPconsGetName(cons), consdata->hmax, hmax);
9825 SCIPconsIsInitial(cons), SCIPconsIsSeparated(cons), SCIPconsIsEnforced(cons), SCIPconsIsChecked(cons), SCIPconsIsPropagated(cons),
9826 SCIPconsIsLocal(cons), SCIPconsIsModifiable(cons), SCIPconsIsDynamic(cons), SCIPconsIsRemovable(cons), SCIPconsIsStickingAtNode(cons)) );
9842 /** presolve cumulative condition w.r.t. the earlier start times (est) and the hmin of the effective horizon
9844 * (1) If the latest completion time (lct) of a job is smaller or equal than hmin, the corresponding job can be removed
9845 * form the constraint. This is the case since it cannot effect any assignment within the effective horizon
9847 * (2) If the latest start time (lst) of a job is smaller or equal than hmin it follows that the this jobs can run
9848 * before the effective horizon or it overlaps with the effective horizon such that hmin in included. Hence, the
9851 * (3) If the earlier completion time (ect) of a job is smaller or equal than hmin, the cumulative is the only one
9852 * locking the corresponding variable down, and the objective coefficient of the start time variable is not
9855 * (4) If the earlier start time (est) of job is smaller than the hmin, the cumulative is the only one locking the
9856 * corresponding variable down, and the objective coefficient of the start time variable is not negative, than
9859 * (5) If the earlier start time (est) of job is smaller than the smallest earlier completion times of all other jobs
9860 * (lets denote this with minect), the cumulative is the only one locking the corresponding variable down, and the
9861 * objective coefficient of the start time variable is not negative, than removing the values {est+1,...,minect-1}
9864 * @note That method does not remove any variable form the arrays. It only marks the variables which are irrelevant for
9878 SCIP_Bool* irrelevants, /**< array mark those variables which are irrelevant for the cumulative condition */
9911 SCIPdebugMsg(scip, "check for irrelevant variable for cumulative condition (hmin %d) w.r.t. earlier start time\n", hmin);
9951 /* collect earlier start time (est), earlier completion time (ect), latest start time (lst), and latest completion
9971 /* (1) check if the job runs completely before the effective horizon; if so the job can be removed form the
9981 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nirrelevantjobs++ );
9985 /* (2) check if the jobs overlaps with the time point hmin if it overlaps at all with the effective horizon; if
9998 * We mark the job to be deletable. The removement together with the capacity reducion is done later
10001 SCIPdebugMsg(scip, " variables <%s>[%d,%d] (duration <%d>) is irrelevant due to no up lock\n",
10007 /* for the statistic we count the number of jobs which always run during the effective horizon */
10026 /* (3) check if the job can finish before the effective horizon starts; if so and the job can be fixed to its
10027 * earliest start time (which implies that it finishes before the effective horizon starts), the job can be
10031 /* job can be removed from the constraint only if the integer start time variable can be fixed to its lower
10042 SCIPdebugMsg(scip, " variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt EST\n",
10045 /* after fixing the start time variable to its lower bound, the (new) earliest completion time should be smaller or equal ti hmin */
10061 /* check if the cumulative constraint is the only one looking this variable down and if the objective function
10083 /* for the statistic we count the number of jobs which are dual fixed due the information of all cumulative
10092 /* In the current version SCIP, variable domains are single intervals. Meaning that domain holes or not
10093 * representable. To retrieve a potential dual reduction we using probing to check both branches. If one in
10097 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10126 /** presolve cumulative condition w.r.t. the latest completion times (lct) and the hmax of the effective horizon
10128 * (1) If the earliest start time (est) of a job is larger or equal than hmax, the corresponding job can be removed
10129 * form the constraint. This is the case since it cannot effect any assignment within the effective horizon
10131 * (2) If the earliest completion time (ect) of a job is larger or equal than hmax it follows that the this jobs can run
10132 * before the effective horizon or it overlaps with the effective horizon such that hmax in included. Hence, the
10135 * (3) If the latest start time (lst) of a job is larger or equal than hmax, the cumulative is the only one
10136 * locking the corresponding variable up, and the objective coefficient of the start time variable is not
10139 * (4) If the latest completion time (lct) of job is larger than the hmax, the cumulative is the only one locking the
10140 * corresponding variable up, and the objective coefficient of the start time variable is not positive, than
10141 * removing the values {hmax - p_j, ..., lst-1} form variable domain is dual feasible (p_j is the processing time
10144 * (5) If the latest completion time (lct) of job is smaller than the largerst latest start time of all other jobs
10145 * (lets denote this with maxlst), the cumulative is the only one locking the corresponding variable up, and the
10146 * objective coefficient of the start time variable is not positive, than removing the values {maxlst - p_j + 1,
10147 * ..., lst-1} form variable domain is dual feasible (p_j is the processing time of the corresponding job).
10149 * @note That method does not remove any variable form the arrays. It only marks the variables which are irrelevant for
10163 SCIP_Bool* irrelevants, /**< array mark those variables which are irrelevant for the cumulative condition */
10164 int* nfixedvars, /**< pointer to counter which is increased by the number of deduced variable fixations */
10196 SCIPdebugMsg(scip, "check for irrelevant variable for cumulative condition (hmax %d) w.r.t. latest completion time\n", hmax);
10235 /* collect earlier start time (est), earlier completion time (ect), latest start time (lst), and latest completion
10254 /* (1) check if the job runs completely after the effective horizon; if so the job can be removed form the
10264 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->nirrelevantjobs++ );
10271 /* (2) check if the jobs overlaps with the time point hmax if it overlaps at all with the effective horizon; if
10281 SCIPdebugMsg(scip, " variables <%s>[%d,%d] with duration <%d> is irrelevant due to no down lock\n",
10287 /* for the statistic we count the number of jobs which always run during the effective horizon */
10306 /* (3) check if the job can start after the effective horizon finishes; if so and the job can be fixed to its
10307 * latest start time (which implies that it starts after the effective horizon finishes), the job can be
10311 /* job can be removed from the constraint only if the integer start time variable can be fixed to its upper
10322 SCIPdebugMsg(scip, " variable <%s>[%d,%d] with duration <%d> is irrelevant due to dual fixing wrt LCT\n",
10325 /* after fixing the start time variable to its upper bound, the (new) latest start time should be greather or equal ti hmax */
10341 /* check if the cumulative constraint is the only one looking this variable down and if the objective function
10363 /* for the statistic we count the number of jobs which are dual fixed due the information of all cumulative
10372 /* In the current version SCIP, variable domains are single intervals. Meaning that domain holes or not
10373 * representable. To retrieve a potential dual reduction we using probing to check both branches. If one
10377 downimpllbs, downimplubs, downproplbs, downpropubs, upimpllbs, upimplubs, upproplbs, uppropubs,
10444 /* remove variables from the cumulative constraint which are marked to be deleted; we need to that in the reverse
10484 /** stores all demands which are smaller than the capacity of those jobs that are running at 'curtime' */
10524 /* check the end time of this job is larger than the curtime; in this case the job is still running */
10541 /** this method creates a row for time point curtime which insures the capacity restriction of the cumulative
10574 SCIP_CALL( collectDemands(scip, consdata, startindices, curtime, nstarted, nfinished, &demands, &ndemands) );
10586 SCIP_CALL( SCIPsolveKnapsackExactly(scip, ndemands, demands, profits, (SCIP_Longint)consdata->capacity,
10616 int* startindices; /* we will sort the startsolvalues, thus we need to know wich index of a job it corresponds to */
10617 int* endindices; /* we will sort the endsolvalues, thus we need to know wich index of a job it corresponds to */
10637 /* if no activities are associated with this cumulative or the capacity is 1, then this constraint is redundant */
10643 SCIPdebugMsg(scip, "try to tighten capacity for cumulative constraint <%s> with capacity %d\n",
10666 subtractStartingJobDemands(consdata, curtime, starttimes, startindices, &freecapacity, &j, nvars);
10669 addEndingJobDemands(consdata, curtime, endtimes, endindices, &freecapacity, &endindex, nvars);
10685 SCIP_CALL( getHighestCapacityUsage(scip, cons, startindices, curtime, j+1, endindex, &newcapacity) );
10692 /* also those points in time, where the capacity limit is not exceeded, must be taken into account */
10699 /* capacity cannot be decreased if the demand sum over more than one job equals the capacity */
10738 SCIPdebugMsgPrint(scip, "; changed additionally %d coefficients\n", (*nchgcoefs) - oldnchgcoefs);
10790 if( mindemand + consdata->demands[j] > consdata->capacity && consdata->demands[j] < consdata->capacity )
10792 SCIPdebugMsg(scip, "+-+-+-+-+-+change demand of var<%s> from %d to capacity %d\n", SCIPvarGetName(consdata->vars[j]),
10818 lct_j = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(consdata->vars[j])) + consdata->durations[j];
10829 lct_i = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(consdata->vars[i])) + consdata->durations[i];
10843 SCIPdebugMsg(scip, "+-+-+-+-+-+change demand of var<%s> from %d to capacity %d\n", SCIPvarGetName(consdata->vars[j]),
10852 SCIPdebugMsg(scip, "+-+-+-+-+-+changed %d coefficients of variables of cumulative constraint<%s>\n",
10924 SCIP_CALL( SCIPcreateVar(scip, &aggrvar, name, (SCIP_Real)(est+shift), (SCIP_Real)lst, 0.0, SCIPvarGetType(var),
10927 SCIP_CALL( SCIPaggregateVars(scip, var, aggrvar, 1.0, -1.0, (SCIP_Real)shift, &infeasible, &redundant, &aggregated) );
10938 SCIP_CALL( SCIPunlockVarCons(scip, var, cons, consdata->downlocks[v], consdata->uplocks[v]) );
11001 /* add all jobs which has a demand smaller than one half of the capacity but together with the smallest collected
11022 SCIP_CALL( createConsCumulative(scip, SCIPconsGetName(cons), nvars, vars, durations, demands, 1, consdata->hmin, consdata->hmax,
11043 int* naggrvars, /**< pointer to counter which is increased by the number of deduced variable aggregations */
11065 /* in case the cumulative constraint is independent of every else, solve the cumulative problem and apply the
11070 SCIP_CALL( solveIndependentCons(scip, cons, conshdlrdata->maxnodes, nchgbds, nfixedvars, ndelconss, cutoff, unbounded) );
11076 SCIP_CALL( presolveConsEffectiveHorizon(scip, cons, nfixedvars, nchgcoefs, nchgsides, cutoff) );
11142 {
11151 {
11160 {
11166 if( tcliquegraph->precedencematrix[node1][node2] || tcliquegraph->precedencematrix[node2][node1] )
11181 {
11194 /* check if the node is adjacent to the given node (nodes and adjacent nodes are ordered by node index) */
11237 SCIPinfoMessage(scip, NULL, "(%d/%d) ", tcliquegraph->precedencematrix[i][j], tcliquegraph->demandmatrix[i][j]);
11246 /** analyzes if the given variable lower bound condition implies a precedence condition w.r.t. given duration for the
11280 /* if vlbcoef < 1 and ub(vlbvar) <= (duration - vlbconst)/(vlbcoef - 1) -> precedence condition */
11292 /* if vlbcoef > 1 and lb(vlbvar) >= (duration - vlbconst)/(vlbcoef - 1) -> precedence condition */
11301 /** analyzes if the given variable upper bound condition implies a precedence condition w.r.t. given duration for the
11325 /** get the corresponding index of the given variables; this in case of an active variable the problem index and for
11367 SCIP_CALL( SCIPreallocBufferArray(scip, &tcliquegraph->precedencematrix[v], size) ); /*lint !e866*/
11368 SCIP_CALL( SCIPreallocBufferArray(scip, &tcliquegraph->demandmatrix[v], size) ); /*lint !e866*/
11380 SCIP_CALL( SCIPallocBufferArray(scip, &tcliquegraph->precedencematrix[pos], tcliquegraph->size) ); /*lint !e866*/
11381 BMSclearMemoryArray(tcliquegraph->precedencematrix[pos], tcliquegraph->nnodes); /*lint !e866*/
11383 SCIP_CALL( SCIPallocBufferArray(scip, &tcliquegraph->demandmatrix[pos], tcliquegraph->size) ); /*lint !e866*/
11409 /** use the variables bounds of SCIP to projected variables bound graph into a precedence garph
11411 * Let d be the (assumed) duration of variable x and consider a variable bound of the form b * x + c <= y. This
11412 * variable bounds implies a precedence condition x -> y (meaning job y starts after job x is finished) if:
11467 if( impliesVlbPrecedenceCondition(scip, vbdvars[b], vbdcoefs[b], vbdconsts[b], tcliquegraph->durations[idx2]) )
11486 if( impliesVubPrecedenceCondition(scip, var, vbdcoefs[b], vbdconsts[b], tcliquegraph->durations[idx1]) )
11500 /* check if the latest completion time of job1 is smaller than the earliest start time of job2 */
11501 if( SCIPisLE(scip, SCIPvarGetUbLocal(var) + tcliquegraph->durations[idx1], SCIPvarGetLbLocal(vars[b])) )
11504 /* check if the latest completion time of job2 is smaller than the earliest start time of job1 */
11505 if( SCIPisLE(scip, SCIPvarGetUbLocal(vars[b]) + tcliquegraph->durations[idx2], SCIPvarGetLbLocal(var)) )
11545 /** constructs a non-overlapping graph w.r.t. given durations and available cumulative constraints */
11586 if( tcliquegraph->durations[idx1] == 0 || tcliquegraph->durations[idx1] > consdata->durations[i] )
11620 if( tcliquegraph->durations[idx2] == 0 || tcliquegraph->durations[idx2] > consdata->durations[j] )
11623 SCIPdebugMsg(scip, " *** variable <%s> and variable <%s>\n", SCIPvarGetName(vars[i]), SCIPvarGetName(vars[j]));
11638 /** constructs a conflict set graph (undirected) which contains for each job a node and edge if the corresponding pair
11652 /* use the variables bounds of SCIP to project the variables bound graph inot a precedence graph */
11655 /* compute the transitive closure of the precedence graph and the number of in and out arcs */
11656 transitiveClosure(tcliquegraph->precedencematrix, tcliquegraph->ninarcs, tcliquegraph->noutarcs, tcliquegraph->nnodes);
11696 SCIP_CALL( SCIPcreateConsCumulative(scip, &cons, name, ncliquenodes, vars, durations, demands, 1,
11747 /* create a hash table to store all start time variables which are already covered by at least one clique */
11789 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11794 SCIPdebugMsg(scip, "tree nodes %d clique size %d (weight %d, status %d)\n", ntreenodes, ncliquenodes, cliqueweight, tcliquestatus);
11833 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->naddeddisjunctives += nconss );
11845 int distance /**< minimum distance between the start time of the job corresponding to var and the job corresponding to vbdvar */
11851 SCIP_CALL( SCIPcreateConsVarbound(scip, &cons, name, var, vbdvar, -1.0, -SCIPinfinity(scip), -(SCIP_Real)distance,
11863 /** compute a minimum distance between the start times of the two given jobs and post it as variable bound constraint */
11895 /* get latest completion time (lct) of the source and the earliest start time (est) of sink */
11896 lct = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(vars[source])) + tcliquegraph->durations[source];
11915 else if( tcliquegraph->precedencematrix[source][i] && tcliquegraph->precedencematrix[i][sink] )
11933 tcliqueMaxClique(tcliqueGetnnodesClique, tcliqueGetweightsClique, tcliqueIsedgeClique, tcliqueSelectadjnodesClique,
11946 /* the minimum distance between the start times of source job and the sink job is the clique weight plus the
11962 * for each arc of the transitive closure of the precedence graph, we are computing a minimum distance between the
12024 SCIPstatistic( SCIPconshdlrGetData(SCIPfindConshdlr(scip, CONSHDLR_NAME))->naddedvarbounds += nconss );
12064 /**@todo For the test sets, which we are considere, the durations are independent of the cumulative
12065 * constaints. Meaning each job has a fixed duration which is the same for all cumulative constraints. In
12066 * general this is not the case. Therefore, the question would be which duration should be used?
12184 /** construct an incompatibility graph and search for precedence constraints (variables bounds) and unary cumulative
12225 /** compute the constraint signature which is used to detect constraints which contain potentially the same set of variables */
12243 consdata->signature |= ((unsigned int)1 << ((unsigned int)SCIPvarGetIndex(vars[v]) % (sizeof(unsigned int) * 8)));
12249 /** index comparison method of linear constraints: compares two indices of the variable set in the linear constraint */
12468 if( demands[i] + demands[j] > capacity && SCIPconvertRealToInt(scip, vbdconsts[b]) < durations[j] )
12474 SCIPdebugMsg(scip, "<%s>[%d] + %g <= <%s>[%d]\n", SCIPvarGetName(vbdvars[b]), durations[j], vbdconsts[b], SCIPvarGetName(var), durations[i]);
12482 SCIP_CALL( SCIPaddVarVlb(scip, var, vbdvars[b], 1.0, (SCIP_Real) durations[j], &infeasible, &nlocalbdchgs) );
12508 SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
12525 SCIPdebugMsg(scip, "constraint enforcing %d useful cumulative constraints of %d constraints for %s solution\n", nusefulconss, nconss,
12589 SCIP_CALL( enforceSolution(scip, conss, nconss, sol, conshdlrdata->fillbranchcands, result) );
12621 /** destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
12637 SCIPstatisticPrintf("time-table: lb=%" SCIP_LONGINT_FORMAT ", ub=%" SCIP_LONGINT_FORMAT ", cutoff=%" SCIP_LONGINT_FORMAT "\n",
12639 SCIPstatisticPrintf("edge-finder: lb=%" SCIP_LONGINT_FORMAT ", ub=%" SCIP_LONGINT_FORMAT ", cutoff=%" SCIP_LONGINT_FORMAT "\n",
12641 SCIPstatisticPrintf("overload: time-table=%" SCIP_LONGINT_FORMAT " time-time edge-finding=%" SCIP_LONGINT_FORMAT "\n",
12654 /** presolving initialization method of constraint handler (called when presolving is about to begin) */
12668 /* remove jobs which have a duration or demand of zero (zero energy) or lay outside the effective horizon [hmin,
12678 /** presolving deinitialization method of constraint handler (called after presolving has been finished) */
12700 SCIPstatisticPrintf("@11 added variables bounds constraints %d\n", conshdlrdata->naddedvarbounds);
12701 SCIPstatisticPrintf("@22 added disjunctive constraints %d\n", conshdlrdata->naddeddisjunctives);
12716 /** solving process deinitialization method of constraint handler (called before branch and bound process data is freed) */
12748 /* if constraint belongs to transformed problem space, drop bound change events on variables */
12795 SCIP_CALL( SCIPcreateCons(scip, targetcons, SCIPconsGetName(sourcecons), conshdlr, targetdata,
12796 SCIPconsIsInitial(sourcecons), SCIPconsIsSeparated(sourcecons), SCIPconsIsEnforced(sourcecons),
12799 SCIPconsIsDynamic(sourcecons), SCIPconsIsRemovable(sourcecons), SCIPconsIsStickingAtNode(sourcecons)) );
12810 {
12847 {
12896 SCIP_CALL( separateConsOnIntegerVariables(scip, conss[c], NULL, FALSE, &separated, &cutoff) );
12956 SCIP_CALL( separateConsOnIntegerVariables(scip, conss[c], NULL, FALSE, &separated, &cutoff) );
12972 SCIP_CALL( enforceConstraint(scip, conshdlr, conss, nconss, nusefulconss, NULL, solinfeasible, result) );
12981 SCIP_CALL( enforceConstraint(scip, conshdlr, conss, nconss, nusefulconss, sol, solinfeasible, result) );
13010 SCIP_CALL( enforceSolution(scip, conss, nconss, NULL, conshdlrdata->fillbranchcands, result) );
13056 SCIPdebugMsg(scip, "propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss);
13083 &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) );
13095 SCIP_CALL( propagateCons(scip, cons, conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, &nchgbds, &ndelconss, &cutoff) );
13103 SCIP_CALL( propagateCons(scip, conss[c], conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, &nchgbds, &ndelconss, &cutoff) );
13110 SCIP_CALL( propagateAllConss(scip, conshdlrdata, conss, nconss, TRUE, &nchgbds, &cutoff, NULL) );
13121 SCIPdebugMsg(scip, "delete (locally) %d constraints and changed %d variable bounds\n", ndelconss, nchgbds);
13174 /* remove jobs which have a duration or demand of zero (zero energy) or lay outside the effective horizon [hmin,
13183 nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) );
13196 /* in the first round we create a disjunctive constraint containing those jobs which cannot run in parallel */
13209 SCIP_CALL( propagateCons(scip, cons, conshdlrdata, presoltiming, nchgbds, ndelconss, &cutoff) );
13213 if( !cutoff && !unbounded && conshdlrdata->dualpresolve && SCIPallowDualReds(scip) && nconss > 1 && (presoltiming & SCIP_PRESOLTIMING_FAST) != 0 )
13224 /* combine different source and detect disjunctive constraints and variable bound constraints to improve the
13231 if( !cutoff && conshdlrdata->presolpairwise && (presoltiming & SCIP_PRESOLTIMING_MEDIUM) != 0 )
13244 || *nchgcoefs > oldnchgcoefs || *nupgdconss > oldnupgdconss || *ndelconss > oldndelconss || *naddconss > oldnaddconss )
13275 SCIPdebugMsg(scip, "resolve propagation: variable <%s>, cumulative constraint <%s> (capacity %d, propagation %d, H=[%d,%d))\n",
13276 SCIPvarGetName(infervar), SCIPconsGetName(cons), consdata->capacity, inferInfoGetProprule(intToInferInfo(inferinfo)),
13281 infervar, intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, conshdlrdata->usebdwidening, NULL, result) );
13294 SCIPdebugMsg(scip, "lock cumulative constraint <%s> with nlockspos = %d, nlocksneg = %d\n", SCIPconsGetName(cons), nlockspos, nlocksneg);
13311 SCIP_CALL( SCIPaddVarLocksType(scip, vars[v], locktype, nlockspos + nlocksneg, nlockspos + nlocksneg) );
13369 SCIP_CALL( SCIPgetVarCopy(sourcescip, scip, sourcevars[v], &vars[v], varmap, consmap, global, valid) );
13384 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13455 SCIPdebugMsg(scip, "parse job <%s>, duration %d, demand %d\n", SCIPvarGetName(var), duration, demand);
13483 SCIP_CALL( SCIPcreateConsCumulative(scip, cons, name, nvars, vars, durations, demands, capacity,
13484 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
13523 /** constraint method of constraint handler which returns the number of variables (if possible) */
13588 SCIP_CALL( SCIPincludeEventhdlrBasic(scip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecCumulative, NULL) );
13617 SCIP_CALL( SCIPsetConshdlrProp(scip, conshdlr, consPropCumulative, CONSHDLR_PROPFREQ, CONSHDLR_DELAYPROP,
13620 SCIP_CALL( SCIPsetConshdlrSepa(scip, conshdlr, consSepalpCumulative, consSepasolCumulative, CONSHDLR_SEPAFREQ,
13669 "constraints/" CONSHDLR_NAME "/fillbranchcands", "should branching candidates be added to storage?",
13692 "number of branch-and-bound nodes to solve an independent cumulative constraint (-1: no limit)?",
13695 "constraints/" CONSHDLR_NAME "/detectdisjunctive", "search for conflict set via maximal cliques to detect disjunctive constraints",
13698 "constraints/" CONSHDLR_NAME "/detectvarbounds", "search for conflict set via maximal cliques to detect variable bound constraints",
13703 "constraints/" CONSHDLR_NAME "/usebdwidening", "should bound widening be used during the conflict analysis?",
13715 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
13737 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
13739 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
13760 SCIP_CALL( consdataCreate(scip, &consdata, vars, NULL, durations, demands, nvars, capacity, 0, INT_MAX, check) );
13784 * in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
13785 * method SCIPcreateConsCumulative(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
13787 * @see SCIPcreateConsCumulative() for information about the basic constraint flag configuration
13789 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
13796 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
13804 SCIP_CALL( SCIPcreateConsCumulative(scip, cons, name, nvars, vars, durations, demands, capacity,
14003 /** check for the given starting time variables with their demands and durations if the cumulative conditions for the
14010 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
14024 SCIP_CALL( checkCumulativeCondition(scip, sol, nvars, vars, durations, demands, capacity, hmin, hmax,
14048 /** searches for a time point within the cumulative condition were the cumulative condition can be split */
14052 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
14061 SCIP_CALL( computeEffectiveHorizonCumulativeCondition(scip, nvars, vars, durations, demands, capacity,
14067 /** presolve cumulative condition w.r.t. effective horizon by detecting irrelevant variables */
14078 SCIP_Bool* irrelevants, /**< array mark those variables which are irrelevant for the cumulative condition */
14088 SCIP_CALL( presolveConsEst(scip, nvars, vars, durations, hmin, hmax, downlocks, uplocks, cons,
14092 SCIP_CALL( presolveConsLct(scip, nvars, vars, durations, hmin, hmax, downlocks, uplocks, cons,
14103 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
14112 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
14160 SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
14162 SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
14163 SCIP_RESULT* result /**< pointer to store the result of the propagation conflict resolving call */
14166 SCIP_CALL( respropCumulativeCondition(scip, nvars, vars, durations, demands, capacity, hmin, hmax,
14167 infervar, intToInferInfo(inferinfo), boundtype, bdchgidx, relaxedbd, TRUE, explanation, result) );
14227 SCIPgmlWriteNode(file, (unsigned int)(size_t)var, SCIPvarGetName(var), "rectangle", color, NULL);
14246 SCIPgmlWriteArc(file, (unsigned int)(size_t)vbdvars[b], (unsigned int)(size_t)var, NULL, NULL);
14258 SCIPgmlWriteArc(file, (unsigned int)(size_t)var, (unsigned int)(size_t)vbdvars[b], NULL, NULL);
14278 SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)) /**< method to use an individual cumulative condition */
14302 * @note If the problem was solved to the earliest start times (ests) and latest start times (lsts) array contain the
14303 * solution values; If the problem was not solved these two arrays contain the global bounds at the time the sub
14311 SCIP_Real* objvals, /**< array of objective coefficients for each job (linear objective function), or NULL if none */
14319 SCIP_Longint maxnodes, /**< maximum number of branch-and-bound nodes to solve the single cumulative constraint (-1: no limit) */
14349 /* abort if no time is left or not enough memory to create a copy of SCIP, including external memory usage */
14352 SCIP_CALL( conshdlrdata->solveCumulative(njobs, ests, lsts, objvals, durations, demands, capacity,
14359 /** creates the worst case resource profile, that is, all jobs are inserted with the earliest start and latest
14366 SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
14396 /* add each job with its earliest start and latest completion time into the resource profile */
14421 SCIP_CALL( SCIPprofileInsertCore(profile, impliedest, impliedlct, copydemands[v], &pos, &infeasible) );
14440 /** computes w.r.t. the given worst case resource profile the first time point where the given capacity can be violated */
14470 /** computes w.r.t. the given worst case resource profile the first time point where the given capacity is satisfied for sure */
static SCIP_RETCODE consdataCatchEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
Definition: cons_cumulative.c:1792
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:436
Definition: type_paramset.h:63
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
Definition: cons.c:4221
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
Definition: scip_mem.h:86
Definition: type_result.h:33
SCIP_RETCODE SCIPcreateConsBasicSetpart(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
Definition: cons_setppc.c:9101
SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
Definition: misc.c:8385
SCIP_EXPORT SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
Definition: var.c:16880
Definition: type_result.h:37
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)
Definition: cons_cumulative.c:7991
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
Definition: scip_conflict.c:291
Definition: struct_var.h:99
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: scip_cons.c:585
static TCLIQUE_GETNNODES(tcliqueGetnnodesClique)
Definition: cons_cumulative.c:11142
static int computeEnergyContribution(SCIP_BTNODE *node)
Definition: cons_cumulative.c:6377
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2364
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: scip_branch.c:654
static SCIP_DECL_CONSGETVARS(consGetVarsCumulative)
Definition: cons_cumulative.c:13504
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip_cons.c:876
static SCIP_RETCODE consdataDropAllEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
Definition: cons_cumulative.c:1837
static PROPRULE inferInfoGetProprule(INFERINFO inferinfo)
Definition: cons_cumulative.c:299
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip_var.c:1994
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)
Definition: cons_cumulative.c:2264
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)
Definition: cons_cumulative.c:7086
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: scip_cons.c:452
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:488
Definition: struct_scip.h:58
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5121
static SCIP_RETCODE computeMinDistance(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int source, int sink, int *naddconss)
Definition: cons_cumulative.c:11866
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)
Definition: scip_cons.c:933
SCIP_RETCODE SCIPaddVarVlb(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip_var.c:6573
SCIP_EXPORT int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
Definition: var.c:3241
Definition: type_conflict.h:50
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: scip_cons.c:307
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8375
static void consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
Definition: cons_cumulative.c:2101
static SCIP_DECL_CONSENFOPS(consEnfopsCumulative)
Definition: cons_cumulative.c:12989
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)
Definition: cons_cumulative.c:6431
static SCIP_RETCODE createCoverCutsTimepoint(SCIP *scip, SCIP_CONS *cons, int *startvalues, int time)
Definition: cons_cumulative.c:8063
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)
Definition: scip_cons.c:165
SCIP_RETCODE SCIPaddVarLocksType(SCIP *scip, SCIP_VAR *var, SCIP_LOCKTYPE locktype, int nlocksdown, int nlocksup)
Definition: scip_var.c:4200
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2476
static void addEndingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *endtimes, int *endindices, int *freecapacity, int *idx, int nvars)
Definition: cons_cumulative.c:3420
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip_var.c:1483
SCIP_RETCODE SCIPcreateConsBasicCumulative(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity)
Definition: cons_cumulative.c:13792
SCIP_RETCODE SCIPnormalizeCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int *capacity, int *nchgcoefs, int *nchgsides)
Definition: cons_cumulative.c:14032
Definition: type_result.h:49
int SCIPgetHminCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13836
static int computeOverlap(int begin, int end, int est, int lst, int duration)
Definition: cons_cumulative.c:2812
static SCIP_RETCODE constraintNonOverlappingGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
Definition: cons_cumulative.c:11548
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
Definition: scip_cons.c:815
SCIP_EXPORT void SCIPsortDownIntInt(int *intarray1, int *intarray2, int len)
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)
Definition: cons_cumulative.c:2849
static void initializeLocks(SCIP_CONSDATA *consdata, SCIP_Bool locked)
Definition: cons_cumulative.c:1859
SCIP_VAR ** SCIPgetVarsCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13900
Definition: type_result.h:38
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip_sol.c:1352
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_setppc.c:9232
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5237
Definition: type_set.h:37
static SCIP_RETCODE createDisjuctiveCons(SCIP *scip, SCIP_CONS *cons, int *naddconss)
Definition: cons_cumulative.c:10954
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip_lp.c:2031
static SCIP_RETCODE solveIndependentCons(SCIP *scip, SCIP_CONS *cons, SCIP_Longint maxnodes, int *nchgbds, int *nfixedvars, int *ndelconss, SCIP_Bool *cutoff, SCIP_Bool *unbounded)
Definition: cons_cumulative.c:3714
static void updateKeyOnTrace(SCIP_BTNODE *node, SCIP_Real key)
Definition: cons_cumulative.c:5812
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8690
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: scip_cons.c:769
Definition: struct_var.h:198
Definition: type_stat.h:55
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)
Definition: cons_cumulative.c:9869
static SCIP_RETCODE computePeak(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, int *timepoint)
Definition: cons_cumulative.c:3449
static SCIP_Longint computeCoreWithInterval(int begin, int end, int ect, int lst)
Definition: cons_cumulative.c:362
static void transitiveClosure(SCIP_Bool **adjmatrix, int *ninarcs, int *noutarcs, int nnodes)
Definition: cons_cumulative.c:11516
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
Definition: scip_conflict.c:313
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)
Definition: scip_var.c:5530
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
Definition: scip_var.c:184
SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
Definition: misc.c:3009
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:314
static SCIP_Bool isConsIndependently(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:3674
static SCIP_RETCODE applyAlternativeBoundsFixing(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, int *nfixedvars, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:7835
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:10394
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)
Definition: cons_cumulative.c:611
static SCIP_RETCODE fixIntegerVariableLb(SCIP *scip, SCIP_VAR *var, SCIP_Bool downlock, int *nfixedvars)
Definition: cons_cumulative.c:9472
Definition: struct_misc.h:234
static SCIP_RETCODE consdataFreeRows(SCIP *scip, SCIP_CONSDATA **consdata)
Definition: cons_cumulative.c:2001
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)
Definition: cons_knapsack.c:13449
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)
Definition: cons_cumulative.c:6783
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:860
static SCIP_DECL_CONSEXITSOL(consExitsolCumulative)
Definition: cons_cumulative.c:12719
Definition: type_var.h:53
static void subtractStartingJobDemands(SCIP_CONSDATA *consdata, int curtime, int *starttimes, int *startindices, int *freecapacity, int *idx, int nvars)
Definition: cons_cumulative.c:3378
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
Definition: scip_prob.c:3470
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
Definition: scip_var.c:523
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip_conflict.c:342
static SCIP_RETCODE presolveConsEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *nfixedvars, int *nchgcoefs, int *nchgsides, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:10406
static SCIP_RETCODE removeIrrelevantJobs(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:9209
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)
Definition: cons_cumulative.c:7501
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)
Definition: cons_cumulative.c:11037
static SCIP_RETCODE strengthenVarbounds(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *naddconss)
Definition: cons_cumulative.c:12406
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: scip_cons.c:562
static SCIP_RETCODE getNodeIdx(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_VAR *var, int *idx)
Definition: cons_cumulative.c:11330
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3078
static void conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
Definition: cons_cumulative.c:1771
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)
Definition: scip_param.c:47
Definition: type_stat.h:43
static SCIP_RETCODE deleteLambdaLeaf(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
Definition: cons_cumulative.c:5844
Definition: type_result.h:40
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1502
static SCIP_RETCODE separateCoverCutsCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:8833
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip_cons.c:1232
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip_param.c:891
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip_mem.h:119
tclique user interface
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)
Definition: cons_cumulative.c:7257
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip_cons.c:524
static SCIP_RETCODE createNodedata(SCIP *scip, SCIP_NODEDATA **nodedata)
Definition: cons_cumulative.c:5685
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
Definition: scip_conflict.c:376
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip_cons.c:1257
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: scip_cons.c:838
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)
Definition: cons_knapsack.c:1042
static void createSelectedSortedEventpointsSol(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, int *starttimes, int *endtimes, int *startindices, int *endindices, int *nvars, SCIP_Bool lower)
Definition: cons_cumulative.c:774
static SCIP_DECL_CONSINITLP(consInitlpCumulative)
Definition: cons_cumulative.c:12810
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip_cons.c:500
SCIP_RETCODE SCIPsetHmaxCumulative(SCIP *scip, SCIP_CONS *cons, int hmax)
Definition: cons_cumulative.c:13856
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip_lp.c:2005
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
Definition: scip_conflict.c:632
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip_numerics.c:872
void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:6544
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip_var.c:4291
SCIP_EXPORT void SCIPsortInt(int *intarray, int len)
static SCIP_DECL_CONSPRESOL(consPresolCumulative)
Definition: cons_cumulative.c:13133
static SCIP_RETCODE deleteTrivilCons(SCIP *scip, SCIP_CONS *cons, int *ndelconss, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:9167
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip_cons.c:356
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition: scip_cons.c:1460
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)
Definition: cons_cumulative.c:3136
static SCIP_RETCODE removeOversizedJobs(SCIP *scip, SCIP_CONS *cons, int *nchgbds, int *nchgcoefs, int *naddconss, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:9379
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)
Definition: cons_cumulative.c:9711
static SCIP_RETCODE adjustOversizedJobBounds(SCIP *scip, SCIP_CONSDATA *consdata, int pos, int *nchgbds, int *naddconss, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:9273
Definition: type_stat.h:34
Definition: type_stat.h:35
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:627
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)
Definition: misc.c:2113
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
Definition: scip_sol.c:264
static SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipCp)
Definition: cons_cumulative.c:1385
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)
Definition: cons_cumulative.c:4138
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)
Definition: cons_varbound.c:5009
static void freeTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
Definition: cons_cumulative.c:12160
Definition: struct_sol.h:63
static void createSortedEventpointsSol(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices)
Definition: cons_cumulative.c:732
int SCIPgetNVarsCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13921
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
Definition: cons_cumulative.c:1726
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:462
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)
Definition: cons_linking.c:3284
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip_param.c:612
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3098
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)
Definition: scip_copy.c:672
SCIP_RETCODE SCIPsplitCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int *hmin, int *hmax, int *split)
Definition: cons_cumulative.c:14050
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
Definition: scip_conflict.c:608
static SCIP_RETCODE enforceSolution(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool branch, SCIP_RESULT *result)
Definition: cons_cumulative.c:3621
static SCIP_RETCODE updateEnvelop(SCIP *scip, SCIP_BTNODE *node)
Definition: cons_cumulative.c:5722
static SCIP_RETCODE separateConsBinaryRepresentation(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:8757
static SCIP_RETCODE findPrecedenceConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
Definition: cons_cumulative.c:11967
static SCIP_DECL_CONSCHECK(consCheckCumulative)
Definition: cons_cumulative.c:13018
static SCIP_Longint computeTotalEnergy(int *durations, int *demands, int njobs)
Definition: cons_cumulative.c:1194
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3240
static SCIP_RETCODE tightenLbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *var, int duration, int demand, int est, int ect, int lct, int begin, int end, SCIP_Longint energy, int *bestlb, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:4411
static SCIP_RETCODE getHighestCapacityUsage(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, int *bestcapacity)
Definition: cons_cumulative.c:10546
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:92
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip_var.c:8542
Definition: struct_misc.h:127
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)
Definition: cons_cumulative.c:1879
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6576
Constraint handler for knapsack constraints of the form , x binary and .
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1479
int SCIPcomputeHmin(SCIP *scip, SCIP_PROFILE *profile, int capacity)
Definition: cons_cumulative.c:14442
Definition: type_stat.h:36
static SCIP_RETCODE collectBranchingCands(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, int *nbranchcands)
Definition: cons_cumulative.c:3534
static SCIP_RETCODE findCumulativeConss(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, int *naddconss)
Definition: cons_cumulative.c:11713
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)
Definition: cons_cumulative.c:5329
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)
Definition: prop_probing.c:1198
Definition: type_result.h:35
Definition: struct_cons.h:37
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10364
static SCIP_RETCODE projectVbd(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph)
Definition: cons_cumulative.c:11421
static SCIP_RETCODE createTcliqueGraph(SCIP *scip, TCLIQUE_GRAPH **tcliquegraph)
Definition: cons_cumulative.c:12079
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)
Definition: cons_cumulative.c:14307
Definition: struct_cons.h:117
Definition: type_retcode.h:42
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:771
static SCIP_RETCODE collectBinaryVars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR ***vars, int **coefs, int *nvars, int *startindices, int curtime, int nstarted, int nfinished)
Definition: cons_cumulative.c:513
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyCumulative)
Definition: cons_cumulative.c:12606
SCIP_RETCODE SCIPcreateConsBasicKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity)
Definition: cons_knapsack.c:13524
int SCIPgetHmaxCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13880
Definition: type_lp.h:47
Definition: type_stat.h:52
Definition: type_result.h:36
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
Definition: cons_cumulative.c:2052
static void traceLambdaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
Definition: cons_cumulative.c:6311
SCIP_EXPORT void SCIPsortDownPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
static SCIP_RETCODE computeEffectiveHorizon(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss, int *nchgsides)
Definition: cons_cumulative.c:9765
static int computeEstOmegaset(SCIP *scip, int duration, int demand, int capacity, int est, int lct, int energy)
Definition: cons_cumulative.c:6541
SCIP_Bool SCIPexistsConsLinking(SCIP *scip, SCIP_VAR *intvar)
Definition: cons_linking.c:3395
static SCIP_RETCODE branch(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_RESULT *result)
Definition: branch_allfullstrong.c:77
Definition: type_var.h:44
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)
Definition: cons_cumulative.c:7348
static SCIP_DECL_CONSENFORELAX(consEnforelaxCumulative)
Definition: cons_cumulative.c:12980
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)
Definition: cons_cumulative.c:3985
static SCIP_RETCODE createCumulativeCons(SCIP *scip, const char *name, TCLIQUE_GRAPH *tcliquegraph, int *cliquenodes, int ncliquenodes)
Definition: cons_cumulative.c:11667
SCIP_RETCODE SCIPincludeConshdlrCumulative(SCIP *scip)
Definition: cons_cumulative.c:13580
Definition: type_retcode.h:33
static SCIP_RETCODE createCoverCuts(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:8318
Definition: type_stat.h:33
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
Definition: scip_cons.c:476
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss, SCIP_Bool *infeasible)
Definition: cons_cumulative.c:8721
static SCIP_RETCODE solveCumulative(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool local, SCIP_Real *ests, SCIP_Real *lsts, SCIP_Longint maxnodes, SCIP_Bool *solved, SCIP_Bool *infeasible, SCIP_Bool *unbounded, SCIP_Bool *error)
Definition: cons_optcumulative.c:1267
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
Definition: scip_cons.c:631
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)
Definition: cons_cumulative.c:4989
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
Definition: scip_branch.c:1033
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip_param.c:670
static TCLIQUE_SELECTADJNODES(tcliqueSelectadjnodesClique)
Definition: cons_cumulative.c:11181
Definition: type_result.h:42
Definition: grphload.c:88
Definition: cons_cumulative.c:254
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1074
SCIP_EXPORT void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
static SCIP_RETCODE consCapacityConstraintsFinder(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
Definition: cons_cumulative.c:8547
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)
Definition: cons_cumulative.c:4343
static SCIP_RETCODE consCheckRedundancy(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_Bool *redundant)
Definition: cons_cumulative.c:7135
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip_cons.c:1748
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip_param.c:297
constraint handler for linking binary variables to an integer variable
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip_conflict.c:409
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)
Definition: cons_cumulative.c:4638
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Definition: scip_cons.c:219
static void traceThetaEnvelop(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
Definition: cons_cumulative.c:6194
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip_var.c:4376
SCIP_EXPORT void SCIPsortDownIntIntInt(int *intarray1, int *intarray2, int *intarray3, int len)
SCIP_CONS * SCIPgetConsLinking(SCIP *scip, SCIP_VAR *intvar)
Definition: cons_linking.c:3413
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)
Definition: cons_cumulative.c:10154
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
Definition: scipdefplugins.c:27
static SCIP_RETCODE consdataDropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos)
Definition: cons_cumulative.c:1816
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:390
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition: scip_cons.c:1207
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2891
SCIP_EXPORT void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
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)
Definition: cons_cumulative.c:3929
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_PRESOLTIMING presoltiming, int *nchgbds, int *ndelconss, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:7420
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip_cons.c:331
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip_cons.c:2472
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int demand)
Definition: misc.c:6809
static void freeNodedata(SCIP *scip, SCIP_NODEDATA **nodedata)
Definition: cons_cumulative.c:5709
Definition: type_var.h:54
Definition: cons_cumulative.c:252
static SCIP_DECL_EVENTEXEC(eventExecCumulative)
Definition: cons_cumulative.c:13549
SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
Definition: misc.c:6632
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4211
Definition: struct_lp.h:192
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: scip_param.c:869
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)
Definition: scip_var.c:104
static SCIP_RETCODE normalizeDemands(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
Definition: cons_cumulative.c:9594
static SCIP_RETCODE computeCoreEngeryAfter(SCIP *scip, SCIP_PROFILE *profile, int nvars, int *ests, int *lcts, int *coreEnergyAfterEst, int *coreEnergyAfterLct)
Definition: cons_cumulative.c:4272
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)
Definition: scip_lp.c:1268
Definition: type_set.h:40
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)
Definition: cons_cumulative.c:14007
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool cutsasconss)
Definition: cons_cumulative.c:8678
void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
Definition: misc.c:5317
Definition: cons_cumulative.c:253
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
Definition: misc.c:8246
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
Definition: scip_conflict.c:444
Definition: type_var.h:45
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip_var.c:8180
int * SCIPgetDurationsCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13963
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)
Definition: cons_cumulative.c:6575
int * SCIPgetValsLinking(SCIP *scip, SCIP_CONS *cons)
Definition: cons_linking.c:3520
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
Definition: scip_conflict.c:693
static SCIP_RETCODE consdataDeletePos(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons, int pos)
Definition: cons_cumulative.c:2128
static SCIP_RETCODE computeImpliedEst(SCIP *scip, SCIP_VAR *var, SCIP_HASHMAP *addedvars, int *est)
Definition: cons_cumulative.c:381
static SCIP_RETCODE tightenCoefs(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs)
Definition: cons_cumulative.c:10752
static SCIP_DECL_SORTINDCOMP(consdataCompVar)
Definition: cons_cumulative.c:12252
Definition: struct_misc.h:225
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip_event.c:94
static SCIP_Bool checkDemands(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:9126
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip_var.c:2130
Definition: type_retcode.h:39
Definition: struct_misc.h:199
SCIP_EXPORT int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
Definition: var.c:3184
static SCIP_RETCODE tightenUbTTEF(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int hmin, int hmax, SCIP_VAR *var, int duration, int demand, int est, int lst, int lct, int begin, int end, SCIP_Longint energy, int *bestub, int *inferinfos, SCIP_Bool *initialized, SCIP_Bool *explanation, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:4524
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)
Definition: cons_cumulative.c:14149
static SCIP_DECL_CONSENFOLP(consEnfolpCumulative)
Definition: cons_cumulative.c:12971
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
Definition: scip_numerics.c:1279
static SCIP_RETCODE setupAndSolveCumulativeSubscip(SCIP *subscip, SCIP_Real *objvals, int *durations, int *demands, int njobs, int capacity, int hmin, int hmax, SCIP_Longint maxnodes, SCIP_Real timelimit, SCIP_Real memorylimit, SCIP_Real *ests, SCIP_Real *lsts, SCIP_Bool *infeasible, SCIP_Bool *unbounded, SCIP_Bool *solved, SCIP_Bool *error)
Definition: cons_cumulative.c:1220
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)
Definition: cons_cumulative.c:14069
Definition: type_set.h:36
Definition: type_stat.h:39
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip_param.c:554
static void createSortedEventpoints(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *starttimes, int *endtimes, int *startindices, int *endindices, SCIP_Bool local)
Definition: cons_cumulative.c:685
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip_cut.c:220
SCIP_RETCODE SCIPsetHminCumulative(SCIP *scip, SCIP_CONS *cons, int hmin)
Definition: cons_cumulative.c:13812
Definition: struct_misc.h:79
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)
Definition: scip_var.c:5417
static SCIP_RETCODE insertThetanode(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node, SCIP_NODEDATA **nodedatas, int *nnodedatas)
Definition: cons_cumulative.c:5953
int SCIPgetCapacityCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13942
static SCIP_RETCODE removeRedundantConss(SCIP *scip, SCIP_CONS **conss, int nconss, int *ndelconss)
Definition: cons_cumulative.c:12265
static SCIP_RETCODE getActiveVar(SCIP *scip, SCIP_VAR **var, int *scalar, int *constant)
Definition: cons_cumulative.c:1149
Definition: type_stat.h:56
static SCIP_RETCODE computeAlternativeBounds(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool local, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks)
Definition: cons_cumulative.c:7701
Definition: type_stat.h:44
Definition: type_stat.h:45
static void traceLambdaEnergy(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
Definition: cons_cumulative.c:6254
static SCIP_DECL_CONSPRINT(consPrintCumulative)
Definition: cons_cumulative.c:13330
static SCIP_RETCODE consdataCollectLinkingCons(SCIP *scip, SCIP_CONSDATA *consdata)
Definition: cons_cumulative.c:2197
static SCIP_RETCODE initializeDurations(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
Definition: cons_cumulative.c:12035
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnvelop(SCIP_BTNODE *node)
Definition: cons_cumulative.c:6106
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1561
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6586
Definition: type_lp.h:48
void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
Definition: misc.c:8488
static SCIP_RETCODE constructIncompatibilityGraph(SCIP *scip, TCLIQUE_GRAPH *tcliquegraph, SCIP_CONS **conss, int nconss)
Definition: cons_cumulative.c:11643
static SCIP_RETCODE moveNodeToLambda(SCIP *scip, SCIP_BT *tree, SCIP_BTNODE *node)
Definition: cons_cumulative.c:5917
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip_lp.c:1539
static void collectThetaSubtree(SCIP_BTNODE *node, SCIP_BTNODE **omegaset, int *nelements, int *est, int *lct, int *energy)
Definition: cons_cumulative.c:6159
static SCIP_RETCODE separateConsOnIntegerVariables(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool lower, SCIP_Bool *separated, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:9018
void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
Definition: misc.c:8502
SCIP_EXPORT 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)
Definition: tclique_branch.c:1000
SCIP_EXPORT SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
Definition: var.c:17576
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)
Definition: cons_cumulative.c:2458
Definition: type_var.h:84
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
Definition: misc.c:8516
static SCIP_RETCODE normalizeCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int *capacity, int *nchgcoefs, int *nchgsides)
Definition: cons_cumulative.c:9519
SCIP_RETCODE SCIPcreateWorstCaseProfile(SCIP *scip, SCIP_PROFILE *profile, int nvars, SCIP_VAR **vars, int *durations, int *demands)
Definition: cons_cumulative.c:14363
int * SCIPgetDemandsCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:13984
static SCIP_DECL_CONSSEPASOL(consSepasolCumulative)
Definition: cons_cumulative.c:12911
static SCIP_RETCODE applyAlternativeBoundsBranching(SCIP *scip, SCIP_VAR **vars, int nvars, int *alternativelbs, int *alternativeubs, int *downlocks, int *uplocks, SCIP_Bool *branched)
Definition: cons_cumulative.c:3313
static SCIP_DECL_CONSPARSE(consParseCumulative)
Definition: cons_cumulative.c:13409
static SCIP_DECL_CONSTRANS(consTransCumulative)
Definition: cons_cumulative.c:12768
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)
Definition: cons_cumulative.c:5518
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)
Definition: cons_cumulative.c:12502
static SCIP_RETCODE fixIntegerVariableUb(SCIP *scip, SCIP_VAR *var, SCIP_Bool uplock, int *nfixedvars)
Definition: cons_cumulative.c:9420
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:449
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:475
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1848
static SCIP_RETCODE createPrecedenceCons(SCIP *scip, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, int distance)
Definition: cons_cumulative.c:11841
static INFERINFO getInferInfo(PROPRULE proprule, int data1, int data2)
Definition: cons_cumulative.c:327
Definition: type_retcode.h:45
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip_param.c:438
static SCIP_RETCODE detectRedundantConss(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS **conss, int nconss, int *naddconss)
Definition: cons_cumulative.c:12189
Definition: type_set.h:44
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: scip_var.c:1796
static SCIP_RETCODE varMayRoundUp(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
Definition: cons_cumulative.c:7648
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:344
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)
Definition: cons_bounddisjunction.c:3339
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)
Definition: scip_param.c:101
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)
Definition: cons_cumulative.c:13711
static void consdataCalcSignature(SCIP_CONSDATA *consdata)
Definition: cons_cumulative.c:12228
static SCIP_RETCODE createCapacityRestriction(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool cutsasconss)
Definition: cons_cumulative.c:8457
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip_mem.h:98
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)
Definition: cons_cumulative.c:14100
static SCIP_Bool impliesVlbPrecedenceCondition(SCIP *scip, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconst, int duration)
Definition: cons_cumulative.c:11253
int SCIPcomputeHmax(SCIP *scip, SCIP_PROFILE *profile, int capacity)
Definition: cons_cumulative.c:14472
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
Definition: cons_knapsack.c:13543
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:198
static SCIP_RETCODE tightenCapacity(SCIP *scip, SCIP_CONS *cons, int *nchgcoefs, int *nchgsides)
Definition: cons_cumulative.c:10607
static SCIP_RETCODE collectDemands(SCIP *scip, SCIP_CONSDATA *consdata, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Longint **demands, int *ndemands)
Definition: cons_cumulative.c:10487
Definition: type_retcode.h:43
static SCIP_RETCODE computeEffectiveHorizonCumulativeCondition(SCIP *scip, int nvars, SCIP_VAR **vars, int *durations, int *demands, int capacity, int *hmin, int *hmax, int *split)
Definition: cons_cumulative.c:9631
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1109
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)
Definition: scip_var.c:8305
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
Definition: misc.c:485
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: scip_cons.c:792
static SCIP_DECL_CONSINITPRE(consInitpreCumulative)
Definition: cons_cumulative.c:12657
Definition: objbenders.h:33
static SCIP_DECL_CONSGETNVARS(consGetNVarsCumulative)
Definition: cons_cumulative.c:13526
static SCIP_RETCODE computeImpliedLct(SCIP *scip, SCIP_VAR *var, int duration, SCIP_HASHMAP *addedvars, int *lct)
Definition: cons_cumulative.c:449
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition: scip_cons.c:265
Definition: type_var.h:43
static SCIP_DECL_CONSDELETE(consDeleteCumulative)
Definition: cons_cumulative.c:12742
SCIP_RETCODE SCIPvisualizeConsCumulative(SCIP *scip, SCIP_CONS *cons)
Definition: cons_cumulative.c:14174
SCIP_EXPORT SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
Definition: var.c:17618
default SCIP plugins
static SCIP_BTNODE * findResponsibleLambdaLeafTraceEnergy(SCIP_BTNODE *node)
Definition: cons_cumulative.c:6057
SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int demand, int *pos, SCIP_Bool *infeasible)
Definition: misc.c:6779
static SCIP_DECL_CONSSEPALP(consSepalpCumulative)
Definition: cons_cumulative.c:12847
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated, SCIP_Bool printreason)
Definition: cons_cumulative.c:2422
Definition: type_stat.h:53
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3256
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:496
SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
Definition: misc.c:6514
Definition: type_stat.h:48
static SCIP_RETCODE createCapacityRestrictionIntvars(SCIP *scip, SCIP_CONS *cons, int *startindices, int curtime, int nstarted, int nfinished, SCIP_Bool lower, SCIP_Bool *cutoff)
Definition: cons_cumulative.c:8952
Definition: type_result.h:39
Definition: struct_event.h:186
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip_prob.c:166
SCIP_RETCODE SCIPgetBinvarsLinking(SCIP *scip, SCIP_CONS *cons, SCIP_VAR ***binvars, int *nbinvars)
Definition: cons_linking.c:3455
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: scip_cons.c:608
Definition: type_stat.h:42
static TCLIQUE_GETWEIGHTS(tcliqueGetweightsClique)
Definition: cons_cumulative.c:11151
SCIP_RETCODE SCIPsetSolveCumulative(SCIP *scip, SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)))
Definition: cons_cumulative.c:14277
static SCIP_DECL_CONSRESPROP(consRespropCumulative)
Definition: cons_cumulative.c:13255
static SCIP_RETCODE varMayRoundDown(SCIP *scip, SCIP_VAR *var, SCIP_Bool *roundable)
Definition: cons_cumulative.c:7599
Definition: type_stat.h:51
static SCIP_Bool impliesVubPrecedenceCondition(SCIP *scip, SCIP_VAR *var, SCIP_Real vubcoef, SCIP_Real vubconst, int duration)
Definition: cons_cumulative.c:11308
Definition: type_stat.h:54