sented in [12] by proposing an incremental flow computation for finding minimal conflict sets and a set of filtering rules for cumulative constraint propagation.
Constraint Based Scheduling to deal with Uncertain Durations and Self-Timed Execution Michele Lombardi and Michela Milano DEIS, Universit` a di Bologna V.le Risorgimento 2, 40136, Bologna, Italy
Abstract. In this paper we propose off-line and on-line extensions to the Resource Constrained Project Scheduling Problem. The off-line extension is a variant of RCPSP with time lags and uncertain, bounded activity durations. In this context we improve over our previous work presented in [12] by proposing an incremental flow computation for finding minimal conflict sets and a set of filtering rules for cumulative constraint propagation. The on-line extension is based instead on considering an on-line semantics such as the Self-Timed Execution and take it into account in the scheduling process. Adding the on-line aspect to the problem makes the CSP framework no longer suitable. We have extended the CSP framework to take into account general search decisions and auxiliary unbound variables. An extensive set of experimental results show an improvement of up to two orders of magnitude over our previous approach.
1
Introduction1
In this paper we consider two notable extensions to the traditional Resource Constrained Project Scheduling Problem (RCPSP) that are widely used in practice. The classical RCPSP is defined on a set of activities that are linked via precedence relations and use a given amount of limited available cumulative resources. A solution of a RCPSP is an assignment of starting time to activities such that all temporal and resource constraints are satisfied and the completion time minimized. Practically useful extensions to the RCPSP mainly concern two aspects: the off-line model and the on-line execution. Off-line extensions of the classical RCPSP include: – time windows on the activity starting time, – minimum and maximum time lags between the execution of two activities – uncertain (bounded) durations: activity durations cannot be decided but range at run time between minimum and maximum known values. 1
The work described in this publication was supported by the PREDATOR Project funded by the European Community’s 7th Framework Programme, Contract FP7ICT-216008 and by the ARTEMIS project SMECY, ARTEMIS-2009-1-100230.
2
In particular, uncertain durations make the extended problem no longer suitable for scheduling by assignment of starting times. Similarly to the Precedence Constraint Posting approach we hence assume the RCPSP solution to be an extended project graph with additional precedence constraints; this must be resource conflict free for all combination of activity durations. In the off-line setting the main contribution of this work are two improvements over our previous paper [12] and namely, the incremental flow computation for finding minimal conflict sets and a set of filtering rules for cumulative constraint propagation. The on-line execution schema is also taken into account in this paper as a major contribution. The extended graph derived by the addition of new precedence constraints has some flexibility that can be exploited at run time. However, we can suppose that a run-time semantics makes some on-line executions infeasible. One widely used execution semantics in the field of system design is the SelfTimed Execution (STE); this policy requires that, if all predecessors of a task i have completed their execution, task i cannot be delayed. Additional precedence constraints (added to ensure the network is dynamically controllable and conflict-free) should obey STE restrictions as well. Adding the on-line aspect to the problem complicates the overall picture and makes the CSP framework no longer suitable; the last important contribution of this paper is a extension of the CSP definition to take into account (1) search decisions not in the form of variable assignments and (2) auxiliary variables not necessarily bound in the final solution. We present an extensive set of experimental results, showing the algorithm achieves up to two orders of magnitude speed ups w.r.t. the approach proposed in [12]. In addition, having considered the on-line execution schema has substantially reduced the number of precedence constraints added, therefore improving flexibility.
2
Problem Description
Constraint based scheduling stems out of the classical Resource Constrained Project Scheduling Problem (RCPSP), consisting in scheduling a set A of precedence connected activities ai over a set R of limited capacity resources rk . The structure of the precedence relations is usually captured in the RCPSP via a directed graph G = hA, Ei (project graph), where E is the set of arcs (ai , aj ). Each activity requires an amount rqik of each resource rk ∈ R (where rqik = 0 to denote no requirement) and ck is the capacity of rk . Resources are renewable (i.e. the consumed capacity is released when an activity is over) and activities are assumed to have fixed durations (e.g. di ); a schedule is defined as an assignment of start times to activities and a common RCPSP objective is to minimize the project makespan; resource capacity cannot be exceeded at any point of time. Figure 1A shows a project graph, with all activities requiring different amounts (reported next to the nodes) of a single resource with capacity 3. In CP based scheduling activities are usually modeled by pairs of finite, integer variables Si , Ei , respectively representing the start/end of activity ai .
3
Start/end variables must satisfy Ei = Si + di . Precedence relations (denoted as ai ≺ aj ) can be modeled as simple inequalities Ei ≤ Sj ; unlike in the basic RCPSP, time windows on the activity execution, specified via release times rsi and deadlines dli are naturally taken into account in CP by posting Si ≥ rsi and Ei ≤ dli . Resource over-usages are prevented by means of the cumulative constraint, enforcing: X rqik ≤ ck ∀k, ∀t = 0, . . . eoh (1) Si ≤t ck 2. ∀ai , aj ∈ CS, ai 6= aj : ai aj is consistent with the temporal constraints. The decision version of the resulting scheduling problem consist in finding such a set E ′ of additional precedence constraints. A related optimality problem is that of determining the tightest global deadline eoh for which such a set E ′ can be provided. The number of added precedence relations |E ′ | can be considered a second cost metrics, as it impacts the flexibility of the provided solution, i.e. the amount of computation time which can be saved if activity durations are not maximum at run time. 2.2
Run-Time Semantics
The depicted setting, with an on-line dispatcher assigning the actual start time, is often the exact description of how the schedule is executed in practice. Moreover, in some cases such a dispatcher may be subject to further restrictions, collectively referred to as run-time semantics. One of the main contribution of this paper is an extension of the outlined scheduling model to incorporate run-time semantics; as those are basically online enforced constraint, the integration of such an element is not straightforward. In particular, we focus here on dispatchers restricted to follow the so-called Self Timed Execution (STE dispatchers); STE forbids to delay an activity at run-time once all its predecessors are over. In the following, we also refer to the dispatcher assumed by usual PCP approaches as NULL dispatcher (as it is subject to no additional restriction); this satisfies two important theorems: Theorem 1. The Conflict Sets of the input graph G in a PCP approach relying on the NULL dispatcher are the same as in a conventional scheduling approach where start times are fixed. Theorem 2. By adding a new precedence constraint, we can only remove some of the Conflict Sets of the input graph G with the NULL dispatcher. Proofs are omitted due to lack of space. Note Theorem 1 does not hold in the general case. I particular, with STE:
5
1. the CS in G are a subset of those with the NULL Dispatcher (hence Theorem 1 does not hold); 2. by adding a new precedence constraint, we can both add and remove CS from G (hence Theorem 2 does not hold). Basically, the restrictions enforced by STE avoid all CS which could result from delaying an activity; however, the addition of a precedence relation may “push” an activity along the timeline until new overlaps (and thus new conflicts) arise. This is in principle a major difference with conventional CP problems, where possible infeasibilities can only be removed as search deepens.
3
Related Work
The Resource Constrained Project Scheduling Problem has been extensively studied both in the CP and in Operations Research communities. In particular, most of the RCPSP related work comes from an OR background; the full literature body is too large to fit the available space, hence only some key references are given. Work [4] represents and excellent (although a little dated) survey and proposes a widely popular notation. For more recent surveys, the reader may refer to [6], or to [9] for heuristic solution approaches. Minimum and maximum time lags have been considered in the context of RCRPSP problem with fixed activity durations only; for a list of recent approaches one may refer to [6]. Uncertain durations are traditionally taken into account by Stochastic RCPSP (see [7] for a survey and [15] for a seminal work). Here the focus on expected makespan minimization; to the best of the author knowledge, deadlines and maximum time lag constraints have never be taken into account in the context of Stochastic RCPSP. For a broader discussion of scheduling techniques in the presence of uncertainty, see [2]. On the CP side, the book [1] stands as a main reference, while [10, 3] (among the others) propose more advanced filtering techniques for the cumulative constraint. The Precedence Constraint Posting approach is best formalized in [14], but has been extensively used in the past (see [11] and [15] as examples). The idea of branching over Conflict Sets was in fact introduced in [8] (in 1983). Dynamic Controllability was introduced in [17] over Simple Temporal Networks with Uncertainty, for which controllability is achievable in polynomial time (see [13]). Finally, observe that the simple on-line dispatcher taken into account by our approach has nothing to do with the advanced on-line techniques used in [16]: in our approach, all computationally expensive optimization is performed prior to execution.
4
A Brief Revisitation of CSPs
The outlined scheduling setting present unique features hardly fitting the usual CSP definition; on one side, solving a problem does not require all variables to
6
be assigned (rather, all possible resource conflicts must be wiped out); on the other, the lack of validity of Theorem 2 seems to compromise the underlying principles of CP dept first search. We observe that similar issues are often encountered in practice, and equally often solved by seamlessy diverging from the usual CSP framework. We argue that such oddities rather point out the lack in the CSP definition of some important elements we all are familiar with. As a solution, we introduce, in the context of the tackled scheduling problem, a so-called Extended CSP (ECSP). Definition 2. An ECSP is a 4-tuple hX, D, C, T i where X = {Xi } is the set of variables, D = {Di } is the set of corresponding domains and C = {Cj } is a set of constraints; T = {τk } is second set of constraints representing the possible decisions. In a nutshell, the following main differences with a conventional CSP exist and will be exemplified on the problem at hand: #1: We assume problem constraints to embed a required consistency level; in detail, a constraint Cj does not list the allowed tuples, but rather allowed domain states. For example, suppose we have X0 , X1 ∈ [1..3] and a constraint X0 < X1 wit required GAC. Then the constraint is satisfied when domains (D1 , D2 ) are ([1], [2]), ([1], [3]), ([2], [3]) as well as ([1], [2..3]), ([1..2], [3]), ([1..2], [2..3]). #2: A solution of a ECSP is a subset of decisions T ′ ⊆ T such that hX, D, C ∪ T ′ , ∅i is consistent. This accommodates many practical situations where there are auxiliary variables which may not need to be instantiated to get a solution. Search proceeds by moving decisions from the initial set T to C. #3: Filtering is decision-aware. Formally, filtering can remove any value v in a domain which is not consistent with any subset T ′ of possible decisions (T ′ ∈ 2T ). This has an important consequence: checking whether a search node is a solution amounts to temporary assume no more decisions can be taken (i.e. T = ∅) and testing consistency; now, as filtering is decision-aware, assuming T = ∅ may allow additional propagation and make consistent a previously inconsistent state.
5
The Proposed Scheduling Framework
Specifying a scheduling framework amounts to show how each of the elements presented in Section 2 can be modeled and tackled in the hX, D, C, T i tuple. Precedence Constraint Posting and MCS based search serve as a basis for our model and our solution method. 5.1
Variables, Domains and Temporal Constraints
To represent activities and their relations over time, we rely on the temporal model we presented in [12], closely related to Simple Temporal Networks with Uncertainty (STNU, [17]). The model provides the following building blocks:
7
– Time event variables (Ti ), for which a time window is specified; for each Ti , the domain Di is the time window itself. [dij ,Dij ]
– Free constraints (Ti −−−−−→ Tj ), meaning that at least a value d′ in the interval [dij , Dij ] must exist such that Tj = Ti + d′ ; 0 ≤ dij ≤ Dij must hold. [dij :Dij ]
– Contingent constraints (Ti −−−−−→ Tj ), meaning that Ti and Tj must have enough flexibility to allow Tj = Ti + d′ for each value d′ ∈ [dij , Dij ]; 0 ≤ dij ≤ Dij must hold. The required consistency level is Generalized Arc Consistency, which is equivalent in this case to dynamic controllability. GAC can be enforced efficiently on the temporal network by means of linear cost propagations (see [12]). Figure 2 shows a very simple temporal network featuring four event variables, two contingent constraints and a free constraint.
T
0
[10:20]
[0,0,30,30]
T
1
T
2
[10,20]
[10,20,50,50]
s
[10:20]
[20,30,60,60]
p
s
o
e
o
T
3
[30,50,80,80]
e
p
Fig. 2. The 4 value time window of time event variables
The time window of each event variable Ti is specified by means of 4 time values, namely sp (Ti ), so (Ti ), eo (Ti ), ep (Ti ). Values sp (Ti ) and ep (Ti ) delimit the so-called possible span and specify the time span where the event may take place at run time; formally, let Σ be the set of possible execution scenarios σ (i.e. combination of task durations): ∀t ∈ [sp (Ti ), ep (Ti )], ∃σ ∈ Σ such that event “i” occurs at time t Values so (Ti ) and eo (Ti ) bound the so-called obligatory span; if an event is forced to occur out of its obligatory span (i.e. if sp > eo or ep < so ) dynamic controllability is compromised. Formally: ∀σ ∈ Σ, event “i” occurs in ]0, so (Ti )[ ∪ ]eo (Ti ), eoh] ⇒ no dyn. controllability The 4 points time window allows one to test constant time whether a contingent or free constraint can be consistently added with the current CSP state. Each activity ai is modeled by introducing two event variables (referred to as Si and Ei from now on) to represent its start/end time. Pairs of start/end variables related to the same activity are linked by a contingent constraint, while
8
free constraint are used to model precedence relations; overall we have: Si ∈ [rsi ..eoh], Ei ∈ [0..dli ] [di :Di ]
Si −−−−→ Ei [δij ,∆ij ]
Ei −−−−−→ Sj
∀ai ∈ A
(2)
∀ai ∈ A
(3)
∀(ai , aj ) ∈ E
(4)
where we recall that di ,Di respectively are the minimum and maximum duration of activity ai , while δij , ∆ij are the minimum and maximum time lag associated to arc (ai , aj ); rsi is the release time of ai and dli the corresponding deadline. Figure 3 shows an outline of the temporal model corresponding to the project graph in Figure 1A/3A; contingent constraints are represented as solid arcs, while dashed arcs represent free constraints. 5.2
Resource Constraints
Renewable resources, such as those described in Section 2 are modeled by means of the cumulative global constraint, extended in order to deal with time event variables and uncertain durations. The required consistency level is achieved if and only if the time network is resource conflict free. Both the extended cumulative filtering and the consistency check procedure are described in the followings. A
B a0
2 1
a3
S1 a2 2
a1
a4
1
C
S0
4 (1)
1
E0 E1
a5 2
S3
2
E3
2
S2
S4
0
1
0
1 (1)
S7
E6
2 (2) 2
1
S6
2 a7
S/T cut
1
E5
E4
2 (2) 2
1
S5 1 (1)
a6
2
2 (2)
E2
0
0
2
4 (2)
2 (2)
E7
Fig. 3. A) The reference project Graph B) An outline of the corresponding temporal model C) Solving a minimum flow problem over the temporal network (minimum flow requirements are between round brackets)
Consistency Check: Checking consistency for cumulative constraint basically consists in detecting possible resource conflicts. We recall (see Definition 1) that a Conflict Set CS is a set of activities ai such that: 1. ∀ai , aj ∈ CS, ai 6= aj : ai aj and aj ai are consistent with the current state of the CSP.
9
2. ∃rk ∈ R :
P
ai ∈CS
rqik > ck [0,eoh]
In the context of the current time model, ai aj translates to Ei −−−−→ Sj ; the consistency of the constraint ai aj can be checked in constant time (thanks to the four-point time window). Note that, due to property (1), a Conflict Set is always a stable set on the project graph G = hA, Ei; as G is transitive and acyclic, its maximum weight stable set can be found in polynomial time by solving a minimum flow problem (see [5]). By weighting activities with their resource requirement, if we found that the maximum weight stable set does not exceed the capacity, then the current CSP contains no conflict. In practice (see [12]) the process is performed by i) selecting a target resource rk , ii) annotating arcs in the temporal network corresponding to activities with their rqik values as minimum flow requirements; then by iii) augmenting with so-called discovered precedence constraints (i.e. pairs Ti , Tj such that ep (Ti ) ≤p (Tj )). Finally, the minimum flow is computed via the (inverse) Edmond-Karp algorithm (an embodiment of the Ford-Fulkerson method); the S/T cut identifies the maximum weight stable set. Note that, during the consistency check, the set of search decision taken so far is considered final (T = ∅ in Section 4); this may enable additional propagation due to STE constraints (see forthcoming Section 5.3) and lead to the discovery of more precedence constraints. For example, Figure 3C shows the minimum flow for the graph in Figure 3A; since STE does not allow activities do be delayed, assuming no more ordering decision can be taken lead to the discovery of E3 → S6 , E4 → S6 , E1 → S6 , E1 → S5 . The chosen algorithm requires to start from a feasible flow; this should be as tight as possible, as its value directly impacts the complexity of Edmond-Karp (this is O(|A| · F ), where F is the value of the feasible flow). In this work, we improved the method by using the minimum flow computed at a search node n′ as feasible flow for each child node n′′ . fake source
B
A 4 (1) 2
2
2 (2) 0
1
0
1 (1)
2 (2)
2 (2)
1
0
0
2
0
1 (1)
2 2 (2) 2
1
1 (1)
2 (2)
1
2
1 0
2
2 (2) 1
2
1
1 (1)
4 (1) 2
2
1 0
0
4 (2)
2 (2)
2
4 (2)
2 (2) 1
1
fake sink
Fig. 4. A) Minimum flow at a search node, disrupted by the addition of a precedence relation B) Repaired flow
10
Note however that, since (with STE semantic) scheduling decisions may invalidate some previously discovered arcs, a flow-fixing phase must precede each minimization. In detail, this is done by introducing a fake source and fake sink event in the network, requiring 0 unit of each resource and having free constraint respectively to/from every event in the network. Then, for each arc (ti , tj ) (with flow value f > 0) at node n, no longer present at node n′ , we: – route f flow units from the source to tj and – route f flow units from ti to the sink. The fixing procedure is completed in O(n2 ) and provides a feasible flow for n′ , usually having pretty good quality. Figure 4A shows the minimum flow, disrupted by the addition of a precedence constraint a2 a1 ; Figure 4B depicts the corresponding repaired flow. Extended Cumulative Filtering: Classical Propagation techniques for the cumulative constraint (such as edge finder [1], or balance [10]) can be used with uncertain, bounded durations by associating contingent constraints (introduced to model the activities in the project graph) to a pair of standard CP activities. More in detail, the possible span of Si is used as the domain for the start variable of a so-called minimal CP activity, having variable (as opposed to uncertain) duration in the interval [di , Di ]. The start of a maximal CP activity, with fixed duration equal to Di is instead attached to the obligatory span. Note this technique in principle enables weaker results compared to a the use of adhoc filtering with uncertain durations, but allows one to easily leverage all the propagation techniques provided by state of the art CP solvers. 5.3
Handling STE and Global Consistency Check
Taking into account Self Timed Execution Semantic is the main contribution of this paper. In detail, that can be done by requiring each activity to start when the last of its explicit predecessors ends. Formally, let A+ (ai ) be the set [δij ,∆ij ]
of activities such that Ej −−−−−→ Sj ; then the following constraint must be satisfied by the on-line start time assignment and included in the C set: 0 if |A+ (ai )| = 0 (5) Si = Ej + δij otherwise max + ai ∈A (ai )
Note that the maximum time lag ∆ij does not appear in the STE fundamental constraint. The required consistency level for the STE constraints is GAC. Unfortunately, (5) is a conjunctive constraint when propagating from time 0 to eoh, but a disjunctive constraint during propagation from time eoh to 0. Due to the disjunctive part, the constraint polytope is not convex and GAC cannot be enforced in polynomial time in general. As an exception, polynomial time GAC enforcement becomes feasible when, during the consistency check, T is set to ∅ (i.e., the current decision set is marked
11
as final). This allows STE constraint to perform a much stronger propagation during the consistency check. In such a situation STE propagation enforces: 0 if |A+ (ai )| = 0 (6) sp (Si ) = s (E ) + δ otherwise p j ij max ai ∈A+ (ai ) 0 if |A+ (ai )| = 0 (7) so (Si ) = so (Ej ) + δij otherwise max + ai ∈A (ai )
eo (Si ) = ep (Si ) = so (Si )
(8)
In other words, every activity is moved as close as possible to the schedule origin. Filtering rule 8, in particular, strongly reduces the ep value of Si variables (and consequently that of Ei ). This may produce a large number of discoverable precedence relations (i.e. when ep (Ei ) ≤ sp (Ei )) which must be taken into account when checking the consistency of cumulative constraints (see Section 5.2). Note the effect of the additional propagation must be undone when moving to the next search node. 5.4
Possible Decisions
The purpose of decision constraints is to solve inconsistencies in hX, D, C, ∅i. Essentially: – some resource conflict may still exist (resource infeasibility) – resource propagation and time window constraint may require and activity to be delayed and thus violate STE (STE infeasibility) Therefore, decision constraints must be defined to fix both the situations; in detail, we introduce Conflict and STE Resolvers. Conflict Resolvers: A resolver for conflict set CS is a free precedence relation [0,eoh]
Ei −−−−→ Sj with ai , aj ∈ CS, posted in order to reduce the overall resource consumption of CS. If the conflict set is minimal (i.e. such that by removing any ai from CS no resource over-usage occurs), then posting a single resolver wipes out the whole conflict. STE Resolvers: An STE resolver for an infeasibility on ai consists in choosing an arbitrary activity aj as its last explicit predecessor. Once the activity is chosen, [δij ,δij ]
the resolver consists in the constraint Ej −−−−−→ Si , where δij is assumed to be 0 if aj is not an explicit predecessor of ai (aj ∈ / A+ (ai )). 5.5
The Search Process
Once variables, domains, constraints (with the required consistency levels) and decisions are given, specifying the search process becomes a much simpler task.
12
In particular, we adopt for the provided scheduling framework a Depth First Search method. As in any CP approach, the computation at each node of the search tree starts by performing propagation, then proceeds with the consistency check: this involves (temporary) propagating STE constraints and running min-flow based conflict detection. If neither resource nor STE infeasibilities are reported, a solution has been hit, otherwise a choice point is opened. The actual behavior depends on the type of the detected infeasibility; priority is given to resource infeasibilities if both types are detected. Solving Resource Infeasibilities: if a Conflict Set CS is identified on a resource rk , the search proceeds by extracting an MCS from CS by applying greedy minimization; this consists in iteratively removing from CS the activity yielding the best reduced conflict set. Note that the additional propagation in the consistency check rules out Conflict Sets wit no chance to occur, given the current set of ordering decisions, thus avoiding the insertion of useless constraints. The quality of a CS is assessed as in [11] as an estimate of the preserved search space. In detail, preserved possible span and obligatory span must be distinguished; MCS with lower preserved obligatory span are preferred, while the preserved possible span is used to break ties. The choice point in this case has a branch for each resolver compatible with the current CSP state; resolvers are then ranked by highest preserved obligatory span (the preserved possible span is used to break ties); in particular, let ρ0 , ρ1 . . . be the ranked resolvers. Along each branch k, resolvers rho0 , . . . ρk−1 are forbidden (as the corresponding branches have already been explored) and [0,eoh]
resolver ρk is posted. Forbidding a resolver Ei −−−−→ Sj amounts to posting [1,eoh]
Sj −−−−→ Ei . Solving STE Infeasibilities: If STE infeasibilities are detected on multiples activities ai , the one with the lowest sp (Si ) is chosen; moreover. Then all resolvers compatible with the current CSP state are identified and ranked according to the gap between ai and the candidate predecessor aj . Preference is accorded to resolvers between aj and ai having the smallest absolute difference |so (Ej ) − so (Si )| (while |sp (Ej ) − sp (Si )| is used to break ties). Finally, a choice point is opened with a branch for every resolver ρk ; unlike CS resolvers, in the current implementation STE resolvers are not forbidden on the right most branches.
6
Experimental Results
The proposed framework was implemented on top of IBM/ILOG Solver and Scheduler 6.7. The approach was tested on a RCPSP problem with uncertain durations and Self Time Execution semantic, arising in the design flow of real-time
13
embedded systems. In detail, we considered four benchmarks sets of instances 1 (the same used in [12]), corresponding to two original groups of software application, mapped to two different platform. Both original application groups were synthetically obtained through a specific instance generator, designed to mimic structure and features of real-world programs. Applications in group one have constant branching factor (number of successors of the activity starting a parallel session), ranging from 3 to 5, and scale in the number of software tasks; each software task can correspond to one or more activities, depending on the platform mapping. Applications in group 2 have fixed number of tasks (40) and scale along the branching factor, ranging from 2/4 to 6/8, exposing increasing parallelism. We solved the scheduling problem in its optimality version, where the objective is to find the tightest deadline for which guarantees can be given (and the corresponding schedule). This was solved as a sequence of feasibility problem by applying binary search; the main advantage of the approach is to provide a lower bound on the tightest deadline as well as a feasible solution. All experiments were performed on a Core2 T7200, 2GHz with a time limit of 900 seconds. The solver described in this paper is compared with the one presented in [12].
> TL
222 29373 394 18533 27302 105 175 153 11522 11711
0.94 0.95 0.98 0.98 0.98 0.86 0.86 0.88 0.95 0.97
0 1 0 2 6 0 0 0 1 1
lb/ub
tmcs/time
14 0.21(0.04) 256 0.08 0 19 0.46(0.18) 20 0.37(0.06) 523 0.25 0 28 91.2(284.72) 24 1.33(2.68) 2060 0.19 0 37 3.5(1.46) 38 0.96(0.62) 1345 0.38 0 57 189.49(375.91) 47 7.09(14.9) 5779 0.78 0 74 554.32(461.47) 7 0.15(0.02) 109 0.03 0 13 0.13(0.06) 9 0.26(0.05) 127 0.11 0 15 0.45(0.45) 10 0.37(0.05) 137 0.11 0 17 0.58(0.3) 17 0.57(0.08) 226 0.12 0 27 91.9(284.28) 25 0.75(0.12) 446 0.11 0 37 93.31(283.63) Table 1. Results for application group 1
#MCS
time
> TL lb/ub nprec
Previous MinFlow solver tmcs/time
50/62 67/85 93/105 115/133 138/155 38/49 52/71 72/82 89/108 106/122
#MCS
arcs
41/49 56/66 75/82 93/103 110/119 29/36 41/52 54/60 65/78 78/86
time
nodes
20 30 40 50 60 20 30 40 50 60
nprec
size Platform B Platform A
STE solver
0.83 0.84 0.95
0.99 0.98
Table 1 and 2 respectively show results for the first and the second set of original applications, mapped to the two considered hardware platforms. In detail, platform A features 16 unary resource (representing processors) and 32 cumulative resources (representing point to point communication channels). Platform B has 4 cumulative resource representing multi-core clusters and 8 to model communication channels. Each row summarizes results for a group of 10 instances; column tells the number of tasks before mapping, while bf actor in Table 2 specifies the branching factor for the row. Columns nodes an arcs tell the minimum/maximum number of arcs after the mapping (i.e. the actual input for the scheduling process). For both solvers, nprec reports the number of additional 1
Available at www.lia.deis.unibo.it/Staff/MicheleLombardi/
14
precedence constraint, while time is the average solution time (with standard deviation between round brackets). Column #M CS reports the average number of considered Minimal Conflict Set , tmcs/time is the ration between the total solution time and the time spend in MCS detection; finally > T L tells the number of timed out instances and lb/ub the ratio between the lower bound an upper bound on the tightest achievable global deadline, computed by binary search.
tmcs/time 0.96 0.97 0.95 0.98 0.96 0.87 0.91 0.95 0.96
lb/ub
16173 26066 78117 18452 89446 169 17969 20649 5954 35361
> TL
22 0.6(0.11) 437 0.13 0 34 121.21(288.9) 30 0.68(0.1) 701 0.22 0 45 192.79(374.98) 38 0.81(0.17) 1107 0.61 0 55 534.6(455.86) 38 90.32(282.55) 1189 0.55 1 0.97 54 184.61(377.86) 47 2.86(5.8) 5198 0.9 0 69 633.74(430.84) 9 0.4(0.05) 124 0.05 0 16 0.67(0.66) 14 0.43(0.04) 270 0.21 0 27 91.16(284.59) 19 0.44(0.06) 289 0.19 0 34 94.11(283.65) 21 0.45(0.11) 403 0.35 0 32 91.92(284.13) 25 0.47(0.07) 521 0.26 0 39 181.96(378.89) Table 2. Results for application group 2
#MCS
time
nprec
lb/ub
> TL
Previous MinFlow solver tmcs/time
90/108 98/109 99/115 100/119 107/126 73/86 75/88 78/95 73/101 84/98
#MCS
arcs
74/84 78/84 78/88 79/90 83/95 55/62 55/66 57/69 52/72 58/67
time
nodes
2/4 3/5 4/6 5/7 6/8 2/4 2/4 2/4 2/4 2/4
nprec
bfactor Platform B Platform A
STE solver
1 2 5 2 7 0 1 1 1 2
0.97 0.9 0.83 0.5 0.88 0.94 0.98 0.83 0.8
One can see how the new solver obtains up to two order of magnitude speedups compared to the previously presented one; this is mainly due to the introduced support for standard CP propagation (namely, timetable + balance) algorithms and of the use of STE semantic to focus on MCS with an actual chance to occur with the currently posted precedence constraints. A second relevant difference is the relative amount of time spent in MCS detection, which takes the largest portion of the search time for the previous solver, but is considerably lower for the new solver. Once again, this is a combined effect, due to the much larger time required by advanced propagation and the faster MCS detection enabled by incremental flow correction. Finally, taking into account Self Timed Execution enabled the solver to obtain feasible schedules by posting consistently fewer precedence constraint; this is a significant result in the context of scheduling for Embedded System Design, since all additional precedence constraints have to be implemented by means of actual changes to the original application and their number should be ideally minimized.
7
Conclusion
An efficient complete solver for facing a significant variant of Resource Constraint Project Scheduling with minimum and maximum time lags and variable durations is proposed. The concept of durations here is particularly challenging as we have to consider constraint feasibility for each possible activity duration combination. In addition, we propose a notable extension of the traditional off-
15
line RCPSP that takes into account the Self-Timed Execution semantics and ensures dynamic controllability and resource-conflict free solutions.
References 1. P. Baptiste, C. Le Pape, and W. Nuijten. Constraint-based scheduling. Kluwer Academic Publishers, 2001. 2. J. C. Beck and A. J. Davenport. A survey of techniques for scheduling with uncertainty. Available from http://www.eil.utoronto.ca/profiles/chris/gz/uncertaintysurvey.ps, 2002. 3. Nicolas Beldiceanu and Emmanuel Poder. A Continuous Multi-resources umulative Constraint with Positive-Negative Resource Consumption-Production. In Proc. of CPAIOR, pages 214–228, 2007. 4. Peter Brucker, Andreas Drexl, Rolf M¨ ohring, Klaus Neumann, and Erwin Pesch. Resource-constrained project scheduling: Notation, classification, models, and methods. European Journal of Operational Research, 112(1):3–41, 1999. 5. Martin Golumbic. Algorithmic Graph Theory And Perfect Graphs. Elsevier, Second edition edition, 2004. 6. S. Hartmann and D. Briskorn. A survey of variants and extensions of the resourceconstrained project scheduling problem. European Journal of Operational Research, 2009. 7. W. Herroelen and R. Leus. Project scheduling under uncertainty: Survey and research potentials. European journal of operational research, 165(2):289–306, 2005. 8. G. Igelmund and F. J. Radermacher. Preselective strategies for the optimization of stochastic project networks under resource constraints. Networks, 13(1):1–28, 1983. 9. R. Kolisch and S. Hartmann. Experimental investigation of heuristics for resourceconstrained project scheduling: An update. European Journal of Operational Research, 174(1):23–37, 2006. 10. Philippe Laborie. Algorithms for propagating resource constraints in AI planning and scheduling: Existing approaches and new results. Artif. Intell., 143(2):151–188, 2003. 11. Philippe Laborie. Complete MCS-Based Search: Application to Resource Constrained Project Scheduling. In Proc. of IJCAI, pages 181–186. Professional Book Center, 2005. 12. Michele Lombardi and Michela Milano. A Precedence Constraint Posting Approach for the RCPSP with Time Lags and Variable Durations. In Proc. of CP, pages 569–583, 2009. 13. Paul H. Morris, Nicola Muscettola, and Thierry Vidal. Dynamic control of plans with temporal uncertainty. In Proc. of IJCAI, pages 494–502, 2001. 14. Nicola Policella, Amedeo Cesta, Angelo Oddi, and Stephen F. Smith. From precedence constraint posting to partial order schedules: A CSP approach to Robust Scheduling. AI Commun., 20(3):163–180, 2007. 15. F. Stork. Stochastic resource-constrained project scheduling. PhD thesis, Technische Universitat Berlin, 2001. 16. P. Van Hentenryck, R. Bent, L. Mercier, and Y. Vergados. Online stochastic reservation systems. Annals of Operations Research, 171(1):101–126, 2009. 17. Thierry Vidal and H´el`ene Fargier. Handling contingency in temporal constraint networks: from consistency to controllabilities. J. Exp. Theor. Artif. Intell., 11(1):23–45, 1999.