Presentation is loading. Please wait.

Presentation is loading. Please wait.

8 The Mathematics of Scheduling

Similar presentations


Presentation on theme: "8 The Mathematics of Scheduling"— Presentation transcript:

1

2 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

3 Independent Tasks We will briefly discuss what happens to scheduling problems in the special case when there are no precedence relations to worry about. This situation arises whenever we are scheduling tasks that are all independent. There are no efficient optimal algorithms known for scheduling, even when the tasks are all independent.

4 Scheduling with Independent Tasks
The nuts-and-bolts details of creating a schedule using a priority 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 they become free in exactly the order given by the priority list.

5 Scheduling with Independent Tasks
Without precedence 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 same list, and, therefore, the decreasing-time algorithm and the critical-path algorithm become one and the same.

6 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 all tasks start out as ready tasks. As soon as a processor is free, it picks up the next available task in the priority list. From the bookkeeping point of view, this is a piece of cake. It is obvious from the figure on the next slide that this is not a very good schedule.

7 Example 8.13 Preparing for Lunch

8 Example 8.13 Preparing for Lunch
If we use the decreasing-time priority list (which in this case is also the critical-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)

9 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 = 180 minutes.

10 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 all independent tasks, and their processing times (in minutes) are A(50), B(30), C(40), D(30), E(50), F(30), and G(40).

11 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 finishing time Fin = 110 minutes.

12 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.

13 Example 8.14 Preparing for Lunch: Part 2
Knowing the optimal finishing time 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 use the relative error. In this case, the relative error is (110 – 90)/90 = 20/90 ≈ = 22.22%.

14 RELATIVE ERROR OF A SCHEDULE
For a schedule with finishing time Fin, the relative error (denoted by ) is given by

15 Graham Bound In 1969 American mathematician Ron Graham showed that when scheduling independent tasks using the critical-path algorithm with N processors, the relative error is at most (N – 1)/3N. We will call this upper bound for the relative error the Graham bound.

16 GRAHAM BOUND The Graham bound for the relative error  when scheduling a set of independent tasks with N processors is

17 Graham’s Bound The table shows the Graham bound for the relative error  for a few small values of N.

18 Graham’s Bound The table gives us a good sense of what is happening:
As N grows, so does the Graham bound, but the Graham bound tapers off very quickly and will never go past 33 1/3%.

19 Graham’s Bound Graham’s bound essentially implies that with independent tasks we can use the critical-path algorithm with the assurance that the relative error is bounded–no matter how many tasks need to be scheduled or how many processors are available to carry them out the finishing time of the project will never be more than 33 1/3% more than the optimal finishing time.


Download ppt "8 The Mathematics of Scheduling"

Similar presentations


Ads by Google