190 likes | 209 Views
8 The Mathematics of Scheduling. 8.1 The Basic Elements of Scheduling 8.2 Directed Graphs (Digraphs) 8.3 Scheduling with Priority Lists 8.4 The Decreasing-Time Algorithm 8.5 Critical Paths 8.6 The Critical-Path Algorithm 8.7 Scheduling with Independent Tasks. Independent Tasks.
E N D
8 The Mathematics of Scheduling 8.1 The Basic Elements of Scheduling 8.2 Directed Graphs (Digraphs) 8.3 Scheduling with Priority Lists 8.4 The Decreasing-Time Algorithm 8.5 Critical Paths 8.6 The Critical-Path Algorithm 8.7 Scheduling with Independent Tasks
Independent Tasks We will briefly discuss what happens to scheduling problems in thespecial case when there are no precedence relations to worry about. This situation arises whenever we are scheduling tasks that are all independent. Thereare no efficient optimal algorithms known for scheduling, even when the tasksare all independent.
Scheduling with Independent Tasks The nuts-and-bolts details of creating a schedule using apriority list become tremendously simplified when there are no precedence relations to mess with. In this case, we just assign the tasks to the processors as theybecome free in exactly the order given by the priority list.
Scheduling with Independent Tasks Withoutprecedence relations, the critical-path time of a task equals its processing time.This means that the critical-time list and decreasing-time list are exactly the samelist, and, therefore, the decreasing-time algorithm and the critical-path algorithmbecome one and the same.
Example 8.13 Preparing for Lunch Priority list:A(70), B(90), C(100), D(70), E(80), F(20), G(20), H(80), I(10) Since there are no precedence relations, there are no ineligible tasks, and alltasks start out as ready tasks. As soon as a processor is free, it picks up the nextavailable task in the priority list. From the bookkeeping point of view, this is apiece of cake. It is obvious from thefigure on the next slide that this is not a very good schedule.
Example 8.13 Preparing for Lunch If we use the decreasing-time priority list (which in this case is also thecritical-time priority list), we are bound to get a much better schedule. Priority list:C(100), B(90), E(80), H(80), A(70), D(70), F(20), G(20), I(10)
Example 8.13 Preparing for Lunch This is clearly an optimal schedule, since there is no idle time for any of the processors throughout the project.The optimal finishing time for the project is Opt= 180minutes.
Example 8.14 Preparing for Lunch: Part 2 After the success of your last banquet, you and your two friends are asked to prepare another banquet. This time it will be a seven-course meal. The courses are allindependent tasks, and their processing times (in minutes) are A(50), B(30), C(40), D(30), E(50), F(30), and G(40).
Example 8.14 Preparing for Lunch: Part 2 The decreasing-time priority list is A(50), E(50), C(40), G(40), B(30), D(30), and F(30). The resulting schedule, has project finishingtime Fin = 110 minutes.
Example 8.14 Preparing for Lunch: Part 2 An optimal schedule (found using old-fashioned trial and error) with finishing time Opt = 90 minutes is shown.
Example 8.14 Preparing for Lunch: Part 2 Knowing the optimal finishingtime Opt = 90 minutes allows us to measure how much we were off when we used the decreasing-time priority list. As we did with earlier approximate solutions, we usethe relative error. In this case, the relative error is (110 – 90)/90 = 20/90 ≈ 0.2222 = 22.22%.
RELATIVE ERROR OF A SCHEDULE For a schedule with finishing time Fin, the relative error (denoted by ) is given by
Graham Bound In 1969 American mathematician Ron Graham showed that when schedulingindependent tasks using the critical-path algorithm with N processors, the relativeerror is at most(N – 1)/3N. We will call this upper bound for the relative errorthe Graham bound.
GRAHAM BOUND The Graham bound for the relative error when scheduling a set of independent tasks with N processors is
Graham’s Bound The table shows the Graham bound for the relative error for a few small valuesof N.
Graham’s Bound The table gives us a good sense of what is happening: As N grows, so doesthe Graham bound, but the Graham bound tapers off very quickly and willnever go past 33 1/3%.
Graham’s Bound Graham’s bound essentially implies that with independent tasks we can use the critical-path algorithm with the assurance that therelative error is bounded–no matter how many tasks need to be scheduled orhow many processors are available to carry them out the finishing time of theproject will never be more than 33 1/3% more than the optimal finishing time.