using constructive search in resource scheduling by andrei missine

33
Using Constructive Search in Resource Scheduling By Andrei Missine

Upload: nathaniel-moore

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Overview Scheduling Algorithms –Branching by dynamic release dates –Branching by assigning generalized precedence constraints –Branching by assigning or delaying start times of activities Conclusion

TRANSCRIPT

Page 1: Using Constructive Search in Resource Scheduling By Andrei Missine

Using Constructive Search in Resource

Scheduling

By Andrei Missine

Page 2: Using Constructive Search in Resource Scheduling By Andrei Missine

Overview• Brief Introduction to Constructive

Search• Running examples• Basic Terms and Concepts in Resource

Scheduling• Some common propagators

– Disjunctive Constraint– Edge Finding

Page 3: Using Constructive Search in Resource Scheduling By Andrei Missine

Overview• Scheduling Algorithms

– Branching by dynamic release dates– Branching by assigning generalized

precedence constraints– Branching by assigning or delaying start

times of activities• Conclusion

Page 4: Using Constructive Search in Resource Scheduling By Andrei Missine

Brief Intro to Constructive Search

• Complete• Builds and

systematically traverses the search tree

• Root node of the tree contains assumptions only from the problem statement

• At each node a decision is made

• If a child backtracks to the parent the parent considers the next decision

• If there are no more decisions to consider at a node, backtrack

• Terminate when backtracking out of the root node

Page 5: Using Constructive Search in Resource Scheduling By Andrei Missine

Running Examples• There will be two running examples,

one for the unit-capacity resource and one for the capacitated resource.

• A unit capacity resource is a resource with a capacity of exactly 1 unit.

• A capacitated resource is a resource with a capacity that is greater than or equal to 1.

Page 6: Using Constructive Search in Resource Scheduling By Andrei Missine

Running Example - Unit Capacity Resource (1)

• The resource is the classroom• The “activities” are the 3 classes:

– Class A and class B can start at 12:00 and must finish by 14:00

– Class C can start at 12:00 and must finish by 16:00

– Each class runs for an hour• Find a schedule with the smallest “makespan”

such that all classes are scheduled and there are no clashes

Page 7: Using Constructive Search in Resource Scheduling By Andrei Missine

Running Example - Capacitated Resource (2)

• A computer lab with 100 computers is the resource

• Classes are the “activities”:– Class A and B start at 12:00 and must finish by

13:30– Class C starts at 12:00 and must finish by 14:00– Each class requires 50 computers for 1 hour

• Find a schedule with minimal makespan such that all classes can use the lab without going over the 100 computer limit

Page 8: Using Constructive Search in Resource Scheduling By Andrei Missine

Resource Scheduling Terms and Concepts

• Time windows – an activity must execute in a given time window defined by the earliest start time and the latest end time

• Generalized precedence constraints –impose a minimum delay between the start times of A and B

Page 9: Using Constructive Search in Resource Scheduling By Andrei Missine

Resource Scheduling Terms and Concepts

• EST - Earliest start time of an activity

• LST - Latest start time of an activity

• EET - Earliest end time of an activity

• LET - Latest end time of an activity

• Core execution interval - the time interval when the activity must execute, if any

• Makespan - the maximum of the latest end times of all activities

Page 10: Using Constructive Search in Resource Scheduling By Andrei Missine

Resource Scheduling Terms and Concepts

Distance matrix - an n by n matrix where the entry (i, j) is the delay between the start time of activity i and the start time of activity j

• Active / Dominating schedule - a schedule such that all activities are scheduled as early as possible without violating any of the constraints

Page 11: Using Constructive Search in Resource Scheduling By Andrei Missine

Resource Scheduling Terms and Concepts

• Active / Dominating schedule - a schedule such that all activities are scheduled as early as possible without violating any of the constraints

Page 12: Using Constructive Search in Resource Scheduling By Andrei Missine

Common Propagators: Disjunctive Constraint

• When two activities’ combined capacity requirement exceeds the resource capacity the two activities are in disjunction

• If start time of one activity is fixed then propagator can prune the other activity’s start time domain.

Page 13: Using Constructive Search in Resource Scheduling By Andrei Missine

Common Propagators: Edge-Finding (Baptiste et al, 2003)

• Edge-finding can be applied when resource usage of a subset of activities exceeds the resource capacity

• Considers activities one by one, trying to prune their start times.

• Pruning occurs when it is evident that given any feasible assignment of the remainder of the subset, the current domain of activity under consideration must be pruned.

Page 14: Using Constructive Search in Resource Scheduling By Andrei Missine

Common Propagators: Edge-Finding

• This is done by considering core execution intervals and overall resource usage in an interval

• Can be costly - O(n2)

Page 15: Using Constructive Search in Resource Scheduling By Andrei Missine

Disjunctive Propagator versus Edge-Finding

• Edge-finding is overkill in unit-capacity resource problems

• Disjunctive propagator can be too weak on general capacitated resources

• Edge-finding is expensive - O(n2)

• Disjunctive propagator is cheap - O(1)

• Bottom line - use disjunctive whenever you can and edge finding only when necessary (e.g. for pre-processing)

Page 16: Using Constructive Search in Resource Scheduling By Andrei Missine

Propagators applied to the Examples

• For the disjunctive propagator, note that it will not deduce any extra info on the capacitated example

• Edge-finding is more powerful than disjunctive constraint

• For the disjunctive case and example 1, assume that class A is already scheduled to start at 12:00

• The propagator can then deduce that B and C must start at 13:00 or later, and after a second iteration that C must start at 14:00 or later

Page 17: Using Constructive Search in Resource Scheduling By Andrei Missine

Propagators applied to the Examples

• For edge-finding and example 2 it is possible to deduce that class C cannot start earlier than 13:00 even without any extra information

• The reasoning is because both A and B have a core execution interval [12:30 - 13:00)

• Thus C will not have any computers available if it starts any time before 13:00

• Applying edge-finding to example 1 we note that edge finding will be able to deduce that C must start at 14:00 or later, even without knowing any extra info

Page 18: Using Constructive Search in Resource Scheduling By Andrei Missine

The Branch-and-Bound idea• Search for a solution• Once a solution is

found, remember it• Keep searching• If it becomes evident at

a node that nothing below it leads to a solution better than the current, backtrack

• In the algorithms that follow the bound is on the makespan

• Lower-bound avoids exploring overly optimistic branches

• Upper-bound avoids exploring overly pessimistic branches

• Good bounds can greatly improve performance

Page 19: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Dynamic Release Dates

• (Fest et al, 1998) introduce the idea of branching by selecting a set of activities to delay to fix broken resource utilization constraints

• Branches are formed by considering possible subsets to delay

• Overall structure of the algorithm:– Assign earliest start

times to all activities such that precedence constraints are met

– Keep delaying activities until resource constraint is fixed

– Upon backtracking pick the next delaying alternative

Page 20: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Dynamic Release Dates

• The resulting tree is rather bushy because there can be exponentially many different subsets to consider

• Authors present some ideas how to optimize the algorithm

• The overall performance is still rather slow

Page 21: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to the Examples• Consider the unit-

capacity case. At root 3 possible delay subsets: {A, B}, {A, C} and {B, C}

• Taking {A, B} results in backtracking since both are delayed to the 13:00 - 14:00 slot and cannot be scheduled

• Taking {A, C} produces the schedule B (12:00), A (13:00), C (14:00)

• Taking {B, C} produces the schedule A (12:00), B (13:00), C (14:00)

Page 22: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to Examples• Now consider the capacitated case. At root

the possible delay sets are {A}, {B} and {C}• Delaying {A} or {B} leads to immediate

backtracking (the interval 13:00 - 13:30 is too short for a 1 hour class)

• Delaying {C} results in the correct schedule where A and B start at 12:00 and C starts at 13:00

Page 23: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Assigning generalized precedence relationships

• (Brucker et al, 1998) suggest branching by making a decision at every node to assign either a concurrent or a disjunctive relationship between two free activities

• A leaf node in such a tree has all activities associated with some precedence relationship

• (Brucker et al, 1998) show that it is possible to tell whether or not a solution exists at such a leaf node, and if it does to find the active schedule

• Note that the branching factor is only 2

• This scheme was shown to be quite good by (Cesta et al, 2000)

Page 24: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to Examples• The unit-capacity

example is not interesting since all activities must be in disjunction

• For the capacitated example the root node contains no precedence relationships

• By following the algorithm, the following leafs form (+ means concurrent, - means disjunctive):– A + B, A + C, B + C – A + B, A + C, B – C– A + B, A – C, B + C– A + B, A – C, B – C– A – B, A + C, B + C– A – B, A + C, B – C– A – B, A – C, B + C– A – B, A – C, B – C

Page 25: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to Examples• The last 4 have no

solution since A and B cannot possibly be in disjunction (because their core execution intervals overlap)

• The first one has no solution also since A+B+C exceed the resource capacity

• A + B, A + C, B - C is a solution: B starts at 12:00, A starts at 12:15 and C starts at 13:00

• Similarly for A + B, A - C, B + C (A and B are reversed)

• A + B, A - C, B - C is also a solution: A and B both start at 12:00 and C starts at 13:00

Page 26: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Assigning or Delaying Start Times of Activities

• (Dorndorf et al, 2000) present a branching scheme that picks a free activity at each node and either assigns it the earliest start time, or delays the start time by some amount

• Algorithm makes use of 4 consistency tests:

– Precedence consistency test

– Resource consistency test

– Interval-based disjunctive consistency test

– Lag-based disjunctive consistency test

• These tests are applied at each node to further prune the search tree

Page 27: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Assigning or Delaying Start Times of Activities

• Selection of an activity from a subset of free activities is done as follows:– Find all activities such

that either its earliest start time matches its precedence and resource feasible start time or it must precede some other free activity

– Heuristically pick an activity from this subset

• Delaying of the selected activity:– Look at all activities

which share a resource with the current activity such that their end times are after the current activity’s start time

– If there is at least one such activity pick the minimal end time of this activity as the delay

– Otherwise delay by one

Page 28: Using Constructive Search in Resource Scheduling By Andrei Missine

Branching by Assigning or Delaying Start Times of Activities

• Note that again, the branching factor is only 2

• Unlike the two previous schemes, this scheme does not use lower bound on the makespan

• This scheme was shown to be quite good by (Cesta et al, 2000)

Page 29: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to Examples• Consider unit-capacity

case. Assume that the heuristics selects A

• It will first try assigning it to the earliest start time

• This will result in pruning B to [13:00, 14:00) and, consequently C to [14:00, 16:00)

• The algorithm then backtracks and will eventually find the solution B, A, C (after selecting B first) and no solutions starting with C

Page 30: Using Constructive Search in Resource Scheduling By Andrei Missine

Applying to Examples• Now consider the general capacitated

example• The execution is very similar - selecting

C as the first activity leads to backtracking and delaying C since it is impossible to have C start at 12:00

• Selecting A or B will lead to the 3 solutions mentioned above

Page 31: Using Constructive Search in Resource Scheduling By Andrei Missine

Conclusion• Propagators: the tradeoff between

speed versus pruning power• Branch-and-bound and usefulness of

good initial bounds• The three branch-and-bound algorithms• Disadvantages of Constructive Search

on large problem instances

Page 32: Using Constructive Search in Resource Scheduling By Andrei Missine

References• Baptiste Philippe, Claude Le Pape, Nuijten Wim.

2003. Constraint-Based Scheduling: Applying Constraint Programming to Scheduling Problems, Second Printing. Kluwer Academic Publishers.

• Brucker Peter, Knust Sigrid, Schoo Arno, Thiele Olaf. 1998. A branch and bound algorithm for the resource-constrained project scheduling problem. European Journal of Operations Research, 107 (1998) 272-288.

Page 33: Using Constructive Search in Resource Scheduling By Andrei Missine

References• Cesta Amedeo, Oddi Angelo, Smith F. Stephen. 2000. Iterative

Flattening: A Scalable Method for Solving Multi-Capacity Scheduling Problems. American Association for Artificial Intelligence, 2000, pp 742-747.

• Fest Andreas, Möhring Rolf H., Stork Frederik, Uetz Marc. 1998. Resource-Constrained Project Scheduling with Time Windwos: A Branching Scheme Based on Dynamic Release Dates. Technical Report 596, Technische Universit at Berlin.

• Dorndorf Ulrich, Pesch Erwin, Phan-Huy Toàn. 2000. A Time-Oriented Branch-and-Bound Algorithm for Resource-Constrained Project Scheduling with Generalised Precedence Constraints. Management Science, Vol. 46, No. 10, October 2000, pp. 1365-1384.