the critical-path algorithm - hampden-sydney...

40
The Critical-Path Algorithm Lecture 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

Upload: others

Post on 12-May-2020

11 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 2: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 3: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 4: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 5: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 6: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 7: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 8: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 9: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 10: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 11: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 12: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 13: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 14: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 15: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 16: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 17: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 18: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 19: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 20: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 21: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 22: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 23: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 24: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 25: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 26: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 27: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 28: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 29: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 30: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 31: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 32: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 33: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 34: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 35: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 36: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 37: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 38: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 39: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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

Page 40: The Critical-Path Algorithm - Hampden-Sydney Collegepeople.hsc.edu/faculty-staff/robbk/Math111/Lectures... · The Critical-Path Algorithm Definition (The Critical-Path Algorithm)

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