The following jobs have arrived in order.
Job |
Time |
Due Date |
1 |
4 |
15 |
2 |
7 |
16 |
3 |
2 |
8 |
4 |
6 |
21 |
5 |
3 |
9 |
If we are interested in Job Lateness as a measure, is SPT or FCFS the better sequencing method to use?
If we are interested in Flow Time as a measure, is SPT or FCFS the better sequencing method to use?
Job |
Time |
Due Date |
1 |
4 |
15 |
2 |
7 |
16 |
3 |
2 |
8 |
4 |
6 |
21 |
5 |
3 |
9 |
Using FCFS scheduling:
Flow time for 1st job = time of that job
Flow time for 2nd job onwards = flowtime of the previous job + time of the considered job
Lateness = Flowtime – Due Date
Job |
Time |
Flowtime |
Due Date |
Lateness |
1 |
4 |
4 |
15 |
-11 |
2 |
7 |
11 |
16 |
-5 |
3 |
2 |
13 |
8 |
5 |
4 |
6 |
19 |
21 |
-2 |
5 |
3 |
22 |
9 |
13 |
Total Flowtime = 69
Total lateness = 0
Number of tasks = 5
Average flowtime = total flowtime/number of tasks = 69/5 = 13.8
Average lateness = total lateness/number of tasks = 0/5 = 0
Using Shortest Processing Time (SPT):
Flow time for 1st job = time of that job
Flow time for 2nd job onwards = flowtime of the previous job + time of the considered job
Lateness = Flowtime – Due Date
Job |
Time |
Flowtime |
Due Date |
Lateness |
3 |
2 |
2 |
8 |
-6 |
5 |
3 |
5 |
9 |
-4 |
1 |
4 |
9 |
15 |
-6 |
4 |
6 |
15 |
21 |
-6 |
2 |
7 |
22 |
16 |
6 |
Total Flowtime = 53
Total lateness = -16
Number of tasks = 5
Average flowtime = total flowtime/number of tasks = 53/5 = 10.6
Average lateness = total lateness/number of tasks = -16/5 = -3.2
Answers:
If we are interested in Job Lateness as a measure, is SPT or FCFS the better sequencing method to use?
As, the lateness of STP is less than the lateness of FCFS, SPT is better.
If we are interested in Flow Time as a measure, is SPT or FCFS the better sequencing method to use?
As, the flowtime of STP is less than the flowtime of FCFS, SPT is better.
********
IF YOU HAVE ANY DOUBT, KINDLY COMMENT. I WOULD LOVE TO HELP YOU!!!
IF YOU LIKE THE ANSWER, PLEASE GIVE AN UP-VOTE OR THUMB UP. THIS WILL ENCOURAGE ME TO ANSWER MORE!!
Get Answers For Free
Most questions answered within 1 hours.