180 likes | 277 Views
Lateness Models. Contents 1. Lawler’s algorithm which gives an optimal schedule with the minimum cost h max when the jobs are subject to precedence relationship 1 | prec | h max 2. A branch-and-bound algorithm for the scheduling problems with the objective to minimise lateness
E N D
Lateness Models • Contents • 1. Lawler’s algorithm which gives an optimal schedule with the minimum cost hmax • when the jobs are subject to precedence relationship • 1 | prec | hmax • 2. A branch-and-bound algorithm for the scheduling problems with the objective to minimise lateness • 1 | rj | Lmax • Literature: • Scheduling, Theory, Algorithms, and Systems, Michael Pinedo, Prentice Hall, 1995, Chapter 3.2 or new: Second Addition, 2002, Chapter 3.
Lawler’s Algorithm • Backward algorithm which gives an optimal schedule for • 1 | prec | hmaxhmax= max ( h1(C1), ... ,hn(Cn) ) • hjare nondecreasing cost functions • Notation • makespan Cmax = pj completion of the last job • J set of jobs already scheduled • they have to be processed during the time interval • JC complement ofset J, set of jobs still to be scheduled • J' JC set of jobs that can be scheduled immediately before set J (schedulable jobs)
Lawler’s Algorithm for 1 | | hmax Step 1. J = JC = {1,...,n} k = n Step 2. Let j* be such that Place j* in J in the k-th order position Delete j* from JC Step 3. If JC = then Stop else k = k - 1 go to Step 2
... 3 5 10 Example (no precedence relationships between jobs) J = JC={1, 2, 3} jobs still to be scheduled Cmax = 10 h1(10) = 11 h2(10) =12 h3(10) =10 Job 3 is scheduled last and has to be processed in [5, 10].
1 2 3 5 10 2 1 3 5 10 J = {3} JC={1, 2} jobs still to be scheduled Cmax = 5 h1(5) = 6 h2(5) = 6 Either job 1 or job 2 may be processed before job 3. or Two schedules are optimal: 1, 2, 3 and 2, 1, 3
Lawler’sAlgorithm for 1 | prec | hmax Step 1. J = , JC = {1,...,n} J' the set of all jobs with no successors k = n Step 2. Let j* be such that Place j* in J in the k-th order position Delete j* from JC Modify J' to represent the set of jobs which can be scheduledimmediately before set J. Step 3. If JC = then Stop else k = k - 1 go to Step 2
... 3 5 10 2 3 2 5 10 1 2 3 5 10 Example. What will happen in the previous example if theprecedence 1 2 has to be taken into account? J = JC={1, 2, 3} still to be scheduled J'={2, 3} have no successors Cmax = 10 h2(10) = 12 h3(10) = 10 J = {3} JC={1, 2} still to be scheduled J'={2} can be scheduled immediately before J Cmax = 5 h2(5) = 6 J = {3, 2} JC={1} J'={1} h1(2) = 3 Optimal schedule: 1, 2, 3, hmax= 10 2
1 || Lmax is the special case of the 1 | prec | hmax where hj = Cj - dj algorithm results in the schedule that orders jobs in increasing orderof their due dates - earliest due date first rule (EDD) 1 | rj | Lmax is NP hard , branch-and-bound is used 1 | rj , prec | Lmax similar branch-and-bound
S S1 S2 Sn . . . S12 S13 . . . . . . • Branch-and-bound algorithm • Search space can grow very large as the number of variables in the problem increases! • Branch-and-bound is a heuristic that works on the idea of successive partitioning of the search space. S = S1 S2... Sn S1 S2... Sn =
S S1 S2 Sn . . . S12 S13 . . . • We need some means for obtaining a lower bound on the cost for any particular solution (the task is to minimise the cost). fboundf(x), xS1 fbound f(x), xS2 there is no need to exploreS2
Branch-and-bound algorithm Step 1 Initialise P = Si(determine the partitions) Initialise fbound Step 2 Remove best partition Si from P Reduce or subdivide Si into Sij Update fbound P = PSij For all SijP do if lower bound of f(Sij) > fbound then remove Sij from P Step 3 If not termination condition then go to Step 2
*,*,*,* 1,*,*,* 2,*,*,* n,*,*,* . . . 1,2,*,* 1,3,*,* . . . . . . Branch-and-bound algorithm for1 | rj | Lmax • Solution space contains n! schedules (n is number of jobs). • Total enumeration is not viable !
*,*,*,* 1,*,*,* 2,*,*,* n,*,*,* . . . 1,2,*,* 1,3,*,* . . . . . . 1st level 2nd level Branching rule: k-1 level, j1, ... , jk-1 are scheduled, jk need to be considered if no job still to be scheduled can notbe processed before the release time of jk that is: J set of jobs not yet scheduled t is time when jk-1 is completed
Lower bound: • Preemptive earliest due date (EDD) rule is optimal for 1 | rjprmp | Lmax • A preemptive schedule will have a maximum lateness not greater than a non-preemtive schedule. • If a preemptive EDD rule gives a nonpreemptive schedule then all nodes with a larger lower bound can be disregarded.
1 2 12 3 7 2 1 0 5 9 2 1 2 0 3 7 9 Example. • Non-preemptive schedules L1=3 L2=6 Lmax=6 0 L1=5 L2=-1 Lmax=5 • Preemptive schedule obtained using EDD L1=3 L2=3 Lmax=3 • the lowest Lmax !
Example *,*,*,* L.B. = 5 L.B. = 7 1,*,*,* 2,*,*,* 3,*,*,* 4,*,*,* job 1 could be processedbefore job 4 1,2,*,* 1,3,*,* job 2 could be processedbefore job 3 L.B. = 5 L.B. = 6 1,3,4,2
*, *, *, * 1,*,*,* 1 [0, 4] L1=-4 3 [4, 5] 4 [5, 10] L4=0 3 [10, 15] L3=4 2 [15, 17] L2=5 2,*,*,* 2 [1, 3] L2=-9 1 [3, 7] L1=-1 4 [7, 12] L4=2 3 [12, 18] L3=7 4,*,*,* either job 1 or 2can be processedbefore 4 ! 3,*,*,* job 2can be processedbefore 3 ! 1,2,*,* 1 [0, 4] L1=-4 2 [4, 6] L2=-6 4 [6, 11] L4=1 3 [11, 17] L3=6 1,3,*,* 1 [0, 4] L1=-4 3 [4, 10] L3=-1 4 [10, 15] L4=5 2 [15, 17] L3=5 Schedule: 1, 3, 4, 2,
Summary • 1 | prec | hmax , hmax=max( h1(C1), ... ,hn(Cn) ), Lawler’s algorithm • 1 || Lmax EDD rule • 1 | rj | Lmax is NP hard , branch-and-bound is used • 1 | rj , prec | Lmax similar branch-and-bound • 1 | rj, prmp | Lmax preemptive EDD rule