5.79. cumulative

DESCRIPTIONLINKSGRAPHAUTOMATON
Origin

[AggounBeldiceanu93]

Constraint

cumulative(TASKS,LIMIT)

Synonym(s)

cumulative_max.

Argument(s)
TASKScollection(origindvar,durationdvar,enddvar,heightdvar)
LIMITint
Restriction(s)
require_at_least(2,TASKS,​​[origin,duration,end])
required(TASKS,height)
TASKS.duration0
TASKS.originTASKS.end
TASKS.height0
LIMIT0
Purpose

Cumulative scheduling constraint or scheduling under resource constraints. Consider a set T of tasks described by the TASKS collection. The cumulative constraint enforces that at each point in time, the cumulated height of the set of tasks that overlap that point, does not exceed a given limit. It also imposes for each task of T the constraint origin+duration=end.

Example
(
origin1duration3end4height1,
origin2duration9end11height2,
origin3duration10end13height1,
origin6duration6end12height1,
origin7duration2end9height3
,8
)

Figure 5.79.1 shows the cumulated profile associated with the example. To each task of the cumulative constraint corresponds a set of rectangles coloured with the same colour: the sum of the lengths of the rectangles corresponds to the duration of the task, while the height of the rectangles (i.e., all the rectangles associated with a task have the same height) corresponds to the resource consumption of the task. The cumulative constraint holds since at each point in time we don't have a cumulated resource consumption strictly greater than the upper limit 8 enforced by the last argument of the cumulative constraint.

Figure 5.79.1. Resource consumption profile
ctrs/cumulative1
Remark

In the original cumulative constraint of CHIP the LIMIT parameter was a domain variable corresponding to the maximum peak of the resource consumption profile. Given a fixed time frame, this variable could be used as a cost in order to directly minimise the maximum resource consumption peak.

Algorithm

The first filtering algorithms were related to the notion of compulsory part of a task [Lahrichi82]. They compute a cumulated resource profile of all the compulsory parts of the tasks and prune the origins of the tasks with respect to this profile in order to not exceed the resource capacity. These methods are sometimes called time tabling. Even if these methods are quite local, i.e., a task has a non -empty compulsory part only when the difference between its latest start and its earliest start is strictly less than its duration, it scales well and is therefore widely used. Later on, more global algorithmsEven if these more global algorithms usually can prune more early in the search tree, these algorithms don't catch all deductions derived from the cumulated resource profile of compulsory parts. based on the resource consumption of the tasks on specific intervals were introduced [ErschlerLopez90], [CaseauLaburthe96b], [Lock96]. A popular variant, called edge finding, considers only specific intervals [MercierVanHentenryck08]. An efficient implementation of edge finding in O(knlogn), where k is the number of distinct task heights and n is the number of tasks, based on a specific data structure, so called a cumulative Φ -tree [Vilim09a], is provided in [Vilim09b].

Within the context of linear programming, the reference [HookerYan02] provides a relaxation of the cumulative constraint.

A necessary condition for the cumulative constraint is obtained by stating a disjunctive constraint on a subset of tasks T such that, for each pair of tasks of T, the sum of the two corresponding minimum heights is strictly greater than LIMIT. This can be done by applying the following procedure:

  • Let h be the smallest minimum height strictly greater than

    LIMIT
    2
    of the tasks of the cumulative constraint. If no such task exists then the procedure is stopped without stating any disjunctive constraint.

  • Let Th denotes the set of tasks of the cumulative constraint for which the minimum height is greater than or equal to h. By construction, the tasks of Th cannot overlap. But we can eventually add one more task as shown by the next step.

  • When it exists, we can add one task that does not belong to Th and such that its minimum height is strictly greater than LIMITh. Again, by construction, this task cannot overlap all the tasks of Th.

When the tasks are involved in several cumulative constraints more sophisticated methods are available for extracting disjunctive constraints [BaptisteLePape00], [BaptisteDemassey04].

In the context where, both the duration and height of all the tasks are fixed, [BeldiceanuCarlssonPoder08] provides two kinds of additional filtering algorithms that are specially useful when the slack σ (i.e., the difference between the available space and the sum of the surfaces of the tasks) is very small:

  • The first one introduces bounds for the so called cumulative longest hole problem. Given an integer ϵ that does not exceed the resource limit, and a subset of tasks T' for which the resource consumption is a most ϵ, the cumulative longest hole problem is to find the largest integer lmaxσϵ(T') such that there is a cumulative placement of maximum height ϵ involving a subset of tasks of T' where, on one interval [i,i+lmaxσϵ(T')1] of the cumulative profile, the area of the empty space does not exceed σ.

  • The second one used dynamic programming for filtering so called balancing knapsack constraints. When the slack is 0, such constraints express the fact that the total height of tasks ending at instant i must equal the total height of tasks starting at instant i. Such constraints can be generalized to non -zero slack.

Systems

cumulativeMax in Choco, cumulative in Jacop, cumulative in SICStus.

See also

disjunctive, soft_cumulative, diffn, bin_packing, cumulative_product, coloured_cumulative, cumulative_two_d, coloured_cumulatives, cumulatives, cumulative_with_level_of_priority, cumulative_convex, calendar, ordered_global_cardinality.

Key words

characteristic of a constraint: core, automaton, automaton with array of counters.

complexity: sequencing with release times and deadlines.

constraint type: scheduling constraint, resource constraint, temporal constraint.

filtering: linear programming, dynamic programming, compulsory part, cumulative longest hole problems, Phi-tree.

problems: producer-consumer.

puzzles: squared squares.


Arc input(s)

TASKS

Arc generator
SELFcollection(tasks)

Arc arity
1
Arc constraint(s)
tasks.origin+tasks.duration=tasks.end
Graph property(ies)
NARC=|TASKS|



Arc input(s)

TASKS TASKS

Arc generator
PRODUCTcollection(tasks1,tasks2)

Arc arity
2
Arc constraint(s)
tasks1.duration>0
tasks2.origintasks1.origin
tasks1.origin<tasks2.end
Graph class
ACYCLIC
BIPARTITE
NO_LOOP

Sets
SUCC
[
source,
variablescol(
VARIABLEScollection(vardvar),
item(varTASKS.height)]
)
]

Constraint(s) on sets
sum_ctr(variables,,LIMIT)


Graph model

The first graph constraint enforces for each task the link between its origin, its duration and its end. The second graph constraint makes sure, for each time point t corresponding to the start of a task, that the cumulated heights of the tasks that overlap t does not exceed the limit of the resource.

Parts (A) and (B) of Figure 5.79.2 respectively show the initial and final graph associated with the second graph constraint of the Example slot. On the one hand, each source vertex of the final graph can be interpreted as a time point. On the other hand the successors of a source vertex correspond to those tasks that overlap that time point. The cumulative constraint holds since for each successor set S of the final graph the sum of the heights of the tasks in S does not exceed the limit LIMIT=8.

Figure 5.79.2. Initial and final graph of the cumulative constraint

ctrs/cumulativeA
(a)

ctrs/cumulativeB
(b)

Signature

Since TASKS is the maximum number of vertices of the final graph of the first graph constraint we can rewrite NARC=|TASKS| to NARC|TASKS|. This leads to simplify NARC to NARC.


Automaton

Figure 5.79.3 depicts the automaton associated with the cumulative constraint. To each item of the collection TASKS corresponds a signature variable Si that is equal to 1.

Figure 5.79.3. Automaton of the cumulative constraint
ctrs/cumulative2