1 By: Prof. Y. Peter Chiu Scheduling ~ HOMEWORK SOLUTION ~

Post on 21-Dec-2015

236 views 5 download

transcript

1

By: Prof. Y. Peter Chiu

Scheduling

~ HOMEWORK SOLUTION ~

2

HW # 4 Four trucks, 1, 2, 3, and 4, are waiting on a loading dock at XYZ

Company that has only a single service bay. The trucks are labeled in the order that they arrived at the dock.

Assume the current time is 1:00 p.m. The times required to unload each truck and the times that the goods they contain are due in the plant are given in the table below:

Determine the schedules that result for each of the rules: (1) FCFS ; (2) SPT ; (3) EDD ; and (4) CR. In each case compute the mean flow time, average tardiness, and number of tardy jobs.

Truck# Unloading time

Time Material Is Due

1 20 mins 1:25 p.m.

2 14 mins 1:45 p.m.

3 35 mins 1:50 p.m.

4 10 mins 1:30 p.m.

3

HW # 4

FCFS

Mean flow time = 202/4 = 50.5Avg. Tardiness = 68/4 = 17Number of Tardy trucks = 2

Truck#

ti Fi di Ti

1 20 20 25 0

2 14 34 45 0

3 35 69 50 19

4 10 79 30 49

Total 202 68

4

HW # 4

SPT

F’=157/4=39.25Avg. Ti=48/4=12# of Tardy Trucks = 2

Truck# ti Fi di Ti

4 10 10 30 0

2 14 24 45 0

1 20 44 25 19

3 35 79 50 29

Total 157 48

5

HW # 4

EDD

F’=43.25T’=7.25# of Tardy job = 1

Truck# ti Fi di Ti

1 20 20 25 0

4 10 30 30 0

2 14 44 45 0

3 35 79 50 29

Total 173 29

6

HW # 4

CR : Current Time = 1:00pm

Truck# ti di CR

1 20 25 25/20 =1.25*

2 14 45 45/14 =3.21

3 35 50 50/35 =1.43

4 10 30 30/10 =3

Pick!

7

HW # 4

CR : Current Time = 1:00pm+20min = 1:20pm

Truck# ti di di-CurTime

CR

2 14 45 25 25/14 =1.79

3 35 50 30 30/35 =0.86*

4 10 30 10 10/10 =1

Pick!

8

HW # 4

Current Time = 1:20pm+35min = 1:55pm

Late Jobs use “SPT” order, pick #4, then #2

Truck# ti di di-CurTime CR

2 14 45 -10

4 10 30 -25 Pick!

Truck# ti Fi di Ti

1 20 20 25 0 F’=54.75

3 35 55 50 5 T’=18.50

4 10 65 30 35 #of Tardy Jobs=3

2 14 79 45 34

9

HW # 5 p.414 Five jobs must be scheduled for batch processing on a

mainframe computer system. The processing times and the promised times for each of the jobs are listed here.

job 1 2 3 4 5

processing time 40 min 2.5 hr 20 min 4 hr 1.5 hr

promised time 11:00 A.M. 2:00 P.M. 2:00 P.M. 1:00 P.M. 4:00 P.M.

Assume that the current time is 10:00 A.M.

(a) If the jobs are scheduled according to SPT, find the tardiness of each job and the mean tardiness of all jobs.

(b) Repeat the calculation in part (a) for EDD scheduling.

10

HW # 5

SPT : Current Time 10:00 AM

3 – 1 – 5 – 2 – 4

Job ti Fi di Ti

3 20 10:20 240 0

1 40 11:00 60 0

5 1:30 12:00 360 0

2 2:30 15:00 240 60

4 4:00 19:00 180 360 T’=84 mins

420

11

HW # 5 EDD : 1 – 4 – 3 – 2 – 5

(Tie uses ‘SPT’ ), otherwise : 1 – 4 – 2 – 3 – 5 ; T’=136

Job ti Fi di Ti

1 40 10:40 60 0

4 4:00 14:40 180 100

3 20 15:00 240 60

2 2:30 17:30 240 210

5 1:30 19:00 360 180 T’=110550

12

HW # 6Consider the information given in Problem 4. Determine the

sequence that the truck should be unload in order to minimize (a) Mean flow time. (b) Maximum lateness. (c) Number of tardy jobs.

Four trucks, 1, 2, 3, and 4, are waiting on a loading dock at XYZ Company that has only a single service bay. The trucks are labeled in the order that they arrived at the dock.

Assume the current time is 1:00 p.m. The times required to unload each truck and the times that the goods they contain are due in the plant are given in the table below:

Truck# Unloading time

Time Material Is Due

1 20 mins 1:25 p.m.

2 14 mins 1:45 p.m.

3 35 mins 1:50 p.m.

4 10 mins 1:30 p.m.

13

HW # 6 From #4

(a) SPT minimizes F’ : 4 – 2 – 1 – 3

(b) EDD minimizes maximum lateness

: 1 – 4 – 2 – 3

(c) By Moore’s Algorithm

: 1 – 4 – 2 – 3

14

HW # 7 On May 1, a lazy MBA student suddenly realizes that he

has done nothing on seven different homework assignments and projects that are due in various courses. He estimates the time required to complete each project (in days) and also notes their due dates:

Project 1 2 3 4 5 6 7

Time (days) 4 8 10 4 3 7 14 Due date 4/20 5/17 5/28 5/28 5/12 5/7 5/15

Because projects 1, 3, and 5 are from the same class, he decides to do those in the sequence that they are due. Furthermore, project 7 requires results from projects 2 and 3, so project 7 must be done after 2 and 3 are completed. Determine the sequence in which he should do the projects in order to minimize the maximum lateness.

15

HW # 7 1 53

2 7

4 6

last. #4 JOBS },,min{

}{min)}({min{4,6,7} VJOBS

FJ

LATENESS MAXIMUM MINIMIZE To

Vj

7

1ii

2314506502750

dFFg

50

iiVjii

16

PROJ# 1 2 3 4 5 6 7

Time 4 8 10 4 3 7 14

Due Date -11 16 27 27 11 6 14

4}-7-3-2-{....5 far, so last JOB#5 3 6}-11,14-min{14

{5,6} V 148-22J4}-7-3-2-{.... far, so

last JOB#2 6 6}-11,22-16,22-min{22 {2,5,6} V 2210-32J4}-7-3-{... far, so

Last #3 JOB 5 6}-32 27,-32 16,-min{32 {2,3,6} V 3214-46J

Last. #7 JOB 3214}-6,46-min{46 {6,7} V 464-50J

HW # 7

17

4-7-3-2-5-6-1

Last JOB#6 5 6}-11 (-11),-min{11{1,6} V 113-14J

PROJ# ti Fi di Fi-di

1 4 4 -11 15

6 7 11 6 5

5 3 14 11 3

2 8 22 16 6

3 10 32 27 5

7 14 46 14 32

4 4 50 27 23

HW # 7

18

8-7-3-5-6-4-1-2 1select {1,2}V8-7-3-5-6-4 4select {2,4}V8-7-3-5-6 6select {4,6}V8-7-3-5 5select {4,5,6}V8-7-3 3select {3,4,5}V8-7 7select {3,5,7}V8 8select {3,5,8}V

41362

m/c 1 JOBS 8

7

6

5

4

3

2

1

587

HW # 8

19

HW # 9

(a) To minimize mean flow time SPT: 6-4-2-1-3-5

(b) To minimize “Number of Tardy Jobs”

Moore’s Algorithm

20

Job ti Delivery ti di

1 1:12 15 1:27 3:30

2 :40 15 55 2:00

3 2:12 15 2:27 3:00

4 :30 15 45 5:00

5 3:06 15 3:21 4:00

6 :25 15 40 6:00

HW # 9

21

HW # 9 (b) Moore’s Algorithm starting from EDD

Job ti’ Fi’ di Li

2 55 55 2:00 -1:05

3 2:27 3:22 3:00 22

1 1:27 4:49 3:30 1:19

5 3:21 8:10 4:00 4:10*

4 45 8:55 5:00 3:55

6 40 9:35 6:00 3:35

Delete Job # 3

22

Job ti’ Fi’ di

2 55 55 2:00

1 1:27 2:22 3:30

5 3:21 5:43 4:00

4 45 5:00

6 40 6:00

Job ti’ Fi’ di

2 55 55 2:00

1 1:27 2:22 3:30

4 45 3:07 5:00

6 40 3:47 6:00

HW # 9

(b) Moore’s Algorithm

Delete Job # 5

23

2-1-4-6-3*-5* (by SPT for tardy jobs)

or 2-1-4-6-5*-3*

# of Tardy Jobs = 2

(c) To minimize maximum lateness

EDD: 2-3-1-5-4-6

Max Li=4:10

HW # 9

(b) Moore’s Algorithm

24

HW # 10

Seven jobs are to be processed through a single machine. The processing times and due dates are given here.

Project 1 2 3 4 5 6 7

Processing time 3 6 8 4 2 1 7

Due date 4 8 12 15 11 25 21

Determine the sequence of the jobs in order to minimize:

(a) Mean flow time.

(b) Number of tardy jobs.

(c) Maximum lateness & compute the maximum lateness.

(d) What is the makespan for any sequence?

25

HW # 10

(a) SPT minimize F’

6 – 5 – 1 – 4 – 2 – 7 – 3

(b) To minimize Number of Tardy Jobs

Use Moore’s Algorithm

first EDD: 1 – 2 – 5 – 3 – 4 – 7 – 6

26

Job ti Fi di Li

1 3 3 4 -1

2 6 9 8 1

5 2 11 11 0

3 8 19 12 7

4 4 23 15 8

7 7 30 21 9*

6 1 31 25 6

Delete Job # 2

HW # 10 (b) By Moore’s Algorithm

27

Job ti Fi di

1 3 3 4

5 2 5 11

3 8 13 12

4 4 15

7 7 21

6 1 25

Delete Job # 3

HW # 10 (b) By Moore’s Algorithm

28

∴ 1 – 5 – 4 – 7 – 6 – 2* - 3* ( tardy jobs by SPT)

or 1 – 5 – 4 – 7 – 6 – 3* - 2* Number Of Tardy Jobs = 2

Job ti Fi di

1 3 3 4

5 2 5 11

4 4 9 15

7 7 16 21

6 1 17 25

HW # 10 (b) By Moore’s Algorithm

29

(C) EDD minimize Maximum lateness

1 – 2 – 5 – 3 – 4 – 7 – 6

maximum lateness = 9

(d)

31 same the is sequence any for

tmakespann

1ii

HW # 10

30

#37• To minimize maximum lateness subject to the

precedence constraints. Lawler’s Algorithm

Job# ti Di

1 4 5

2 10 10

3 2 7

4 1 9

5 8 22

6 3 25

7 2 18

8 6 20

1→ 2→ 5→ 6

4→ 7→ 8

3

31

By Chiu’s algorithm

V1={3,6,8} max Di → 6

V2={3,5,8} max Di → 5

V3={2,3,8} → 8

V4={2,3,7} → 7

V5={2,3,4} → 2

V6={1,3,4} → 4

V7={1,3} → 3

Last → 1

The Optimal sequence is 1-3-4-2-7-8-5-6

#37

32

The EndThe End