The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)
Post on 12-May-2020
12 Views
Preview:
Transcript
The Critical-Path AlgorithmLecture 37
Sections 8.5
Robb T. Koether
Hampden-Sydney College
Mon, Nov 27, 2017
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 1 / 15
1 The Critical-Path Algorithm
2 Example
3 Assignment
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 2 / 15
Outline
1 The Critical-Path Algorithm
2 Example
3 Assignment
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 3 / 15
The Critical-Path Algorithm
Definition (The Critical-Path Algorithm)The critical-path algorithm creates a schedule by the following method.
1 Use the backflow algorithm to find the critical time of every task inthe project.
2 Create a priority list with the tasks listed in order of decreasingcritical time.
3 Use that priority list to create a schedule.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 4 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)B(5)
D(2)
A(6)
C(7)
End(0)
E(5) H(4)
G(3)
F(3)
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)B(5)
D(2)
A(6)
C(7)
End(0)
E(5) H(4)[4]
G(3)[3]
F(3)[3]
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)B(5)
D(2)[5]
A(6)
C(7)
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)B(5)
D(2)[5]
A(6)
C(7)
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
The Backflow Algorithm
Example (The Backflow Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 5 / 15
Example
Example (The Critical-Path Algorithm)
Start(16)B(14)
D(5)
A(11)
C(16)
End(0)
E(9) H(4)
G(3)
F(3)
The priority list is C,B,A,E ,D,H,F ,G.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 6 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
0 5 10 15 20
Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5)Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)Processor 1
Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)
D(2)Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)
D(2)H(4)Processor 1
Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)
D(2)H(4)
F(3)Processor 1Processor 2
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)
D(2)H(4)
F(3)Processor 1Processor 2
G(3)
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Example
Example (The Critical-Path Algorithm)
Start(0)[16]B(5)[14]
D(2)[5]
A(6)[11]
C(7)[16]
End(0)
E(5)[9] H(4)[4]
G(3)[3]
F(3)[3]
Priority list: C,B,A,E ,D,H,F ,G
C(7)
0 5 10 15 20
B(5) A(6)E(5)
D(2)H(4)
F(3)Processor 1Processor 2
G(3)
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 7 / 15
Outline
1 The Critical-Path Algorithm
2 Example
3 Assignment
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 8 / 15
Example (Exercise 55)
Precedent ProcessingTask Tasks Time
A 10B 5C B 4D C,G 1E D 8F 3G H 7H F 1J H 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 9 / 15
Example (Exercise 55)
Start(0)B(5) D(1)
A(10)
C(4)End(0)
E(8)
H(1)
G(7)
F(3) J(6)
Schedule the tasks using 2 processors.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 10 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10
10
B 5
18
C B 4
13
D C,G 1
9
E D 8
8
F 3
20
G H 7
16
H F 1
17
J H 6
6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4
13
D C,G 1
9
E D 8
8
F 3
20
G H 7
16
H F 1
17
J H 6
6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4
13
D C,G 1
9
E D 8 8F 3
20
G H 7
16
H F 1
17
J H 6
6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4
13
D C,G 1
9
E D 8 8F 3
20
G H 7
16
H F 1
17
J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4
13
D C,G 1 9E D 8 8F 3
20
G H 7
16
H F 1
17
J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4 13D C,G 1 9E D 8 8F 3
20
G H 7
16
H F 1
17
J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4 13D C,G 1 9E D 8 8F 3
20
G H 7 16H F 1
17
J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5
18
C B 4 13D C,G 1 9E D 8 8F 3
20
G H 7 16H F 1 17J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5 18C B 4 13D C,G 1 9E D 8 8F 3
20
G H 7 16H F 1 17J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Precedent Processing CriticalTask Tasks Time Time
A 10 10B 5 18C B 4 13D C,G 1 9E D 8 8F 3 20G H 7 16H F 1 17J H 6 6
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 11 / 15
Example (Exercise 55)
Start(0)[20]B(5)[18] D(1)[9]
A(10)[10]
C(4)[13]End(0)
E(8)[8]
H(1)[17]
G(7)[16]
F(3)[20] J(6)[6]
Schedule the tasks using 2 processors.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 12 / 15
Example (Exercise 55)
Start(0)[20]B(5)[18] D(1)[9]
A(10)[10]
C(4)[13]End(0)
E(8)[8]
H(1)[17]
G(7)[16]
F(3)[20] J(6)[6]
Schedule the tasks using 3 processors.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 13 / 15
Example
A(5)
B(8)
E(9)
D(2)
F(7)
G(4)
C(5)
I(3)
H(8)
END(0)START(0)
J(6)
Schedule the tasks using 2 processors.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 14 / 15
Example
A(5)
B(8)
E(9)
D(2)
F(7)
G(4)
C(5)
I(3)
H(8)
END(0)START(0)
J(6)
Compare to the Decreasing-Time Method.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 15 / 15
Outline
1 The Critical-Path Algorithm
2 Example
3 Assignment
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 16 / 15
Assignment
AssignmentChapter 8: Exercises 49, 50, 51, 52, 56.
Robb T. Koether (Hampden-Sydney College) The Critical-Path Algorithm Mon, Nov 27, 2017 17 / 15
top related