Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spring 2015 Mathematics in Management Science Critical Path Scheduling Critical Paths & Times Backflow Algorithm Critical Times PL Critical Path Algorithm.

Similar presentations


Presentation on theme: "Spring 2015 Mathematics in Management Science Critical Path Scheduling Critical Paths & Times Backflow Algorithm Critical Times PL Critical Path Algorithm."— Presentation transcript:

1 Spring 2015 Mathematics in Management Science Critical Path Scheduling Critical Paths & Times Backflow Algorithm Critical Times PL Critical Path Algorithm

2 Machine Scheduling Problem Given identical processors project digraph –tasks with task times –order (precedence) relations Schedule Schedule tasks so as to finish project in as short a time as possible.

3 Machine Scheduling Problem MSP MSP To schedule tasks so as to finish project in as short a time as possible. LPA LPA Given project digraph & PL, schedule the next ready task on the next available processor. DTA DTA Get PL by sorting task times in decreasing order; then use LPA.

4 List Processing Algorithm Given project digraph & PL Schedule the next ready task on the next available processor. next task is highest priority one next available proc is first idle one Tasks are in one of 4 states: ineligible, ready, executing, done.

5 List Processing Algorithm Schedule the next ready task on the next available processor.

6 List Processing Algorithm 1. Use digraph: update status of all tasks on PL. 2. Scan PL from L to R: stop at first Ready task. 3. Assign task to lowest-numbered free processor. 4. Mark this task as In Execution. 5. Continue assigning ready tasks until either all ready tasks have been assigned or there are no more free processors. (Time frozen while this cycle of assignments is made.) 6. Let time evolve until a task (or tasks) completes; so now have a free processor (or processors). 7. Mark Completed tasks on PL & digraph. 8. Repeat.

7 List Processing Algorithm Tasks only “executed” while clock is running. Scheduling only happens when clock is stopped. What stops the clock is a task completing. When clock stops scheduler takes “action”. The “action” summarized in three parts: Clean up: Remove completed tasks from PL and digraph. Prep: Find all Ready tasks (use digraph); update PL. Schedule: Schedule next ready task on next available proc.

8 Example Schedule pixd job on 2 processors. Use PL T8, T7, T6, T5, T4, T3, T2, T1

9 Example Schedule pixd job on 2 processors. Use PL T1, T2, T3, T4, T5, T6, T7, T8

10 With T8, T7, T6, T5, T4, T3, T2, T1 With PL T1, T2, T3, T4, T5, T6, T7, T8

11 Different priority lists usually give different schedules with different finish times. Are either of above schedules “optimal”? What does “optimal” mean? Here it means the shortest completion time among all possible (i.e., legal) schedules. Any (legal) schedule can be obtained from the list-processing algorithm by choosing some appropriate priority list.

12 Finding A Schedule

13 Optimal Schedules A schedule is optimal if it has the shortest possible completion time. To find via Brute Force Method Look at all possible schedules; obtain via PLSA using all possible priority lists. The schedules with the shortest completion time are the optimal schedules.

14 Finding Good Priority Lists Want PL that yields optimal (or nearly optimal) schedule. Use Decreasing Time Algorithm, or Critical Times Algorithm. These algorithms first give PL; then use LPA to get schedule.

15 21111 2 1111 22 Example Since ECT = 4 better schedule is optimal. DTA sched  FinT=6better sched  FinT=4

16 Optimal Finishing Time OptFinTime is the smallest possible time it takes to finish overall project; cannot do better than this. ECT is the length of a critical path: ECT=length of critical path A critical path is a path, from Start to End, with the longest processing time. We always have OptFinTime ≥ ECT.

17 Example 0 Start 0 End ECT=14 CritPath S  C  E  F  E OptFinTime ≥ ECT

18 Critical Path Algorithm Ideas To get a schedule with FinT=OptFinT, tasks in any CP must be done asap. Any delay in starting one of these “critical tasks” will increase the FinT of entire project. Thus want to put all “critical tasks” first in PL. How to get such a PL?

19 Critical Paths & Critical Times The processing time of a path is the sum of all task times in the path. A path from task T to End with the longest processing time is called a critical path for T. The critical time for T is processing time of any critical path for T.

20 Backflow Algorithm Simple way to determine all CritTimes. Once have these, can easily find all critical paths, critical times priority list. Once have CTPL, use LPA. How to get CritTimes ?

21 Backflow Algorithm Start at End and work back to Start. To get CritTime for task T, add T’s task time to largest of the CritTimes for the tasks which follow T. 0 Start 0 End

22 Example 0 Start 0 End

23 Example Critical Times CTPL C, B, A, E, D, F [7][7] [9][9] [14] [5][5] [6][6] [1][1] 14 9 7 6 5 1

24 Critical Paths Critical paths are found by going to next task with largest critical time. The critical path from task T (cud be Start) is obtained by moving from T to any adjacent task with largest critical time, and from there to next task with largest critical time, and so on.

25 Critical Path Priority Lists Use critical times rather than task times to prioritize the tasks. We get a critical times priority list by writing the tasks in decreasing order of critical times. The process of creating a schedule using a critical times priority list is called the Critical Path Algorithm.

26 Critical Path Algorithm Use LPA with CTPL. Find all CritTimes; Backflow! Generate CritTimesPL. Use LPA.

27 Example critical times CTPL

28 Example Critical Times CTPL C, B, A, E, D, F [7][7] [9][9] [14] [5][5] [6][6] [1][1] 14 9 7 6 5 1

29 Example 0 Start 0 End


Download ppt "Spring 2015 Mathematics in Management Science Critical Path Scheduling Critical Paths & Times Backflow Algorithm Critical Times PL Critical Path Algorithm."

Similar presentations


Ads by Google