Lecture 5: Job Scheduling
END 201E Industrial Engineering Mehmet Ali Ergün, Ph.D.
Applications in Python
Scheduling
❖ Scheduling is the process of arranging, controlling
and optimizing work and workloads in a
production process or manufacturing process.
❖ Scheduling is used to allocate plant and machinery
resources, plan human resources, plan production
processes and purchase materials.
❖ Examples: Planning of processing orders in a
machine shop
❖ Planning the working hours of crew members in
an airline
❖ CPU allocation for computer programs
Job Scheduling
❖ In this setting, our resource(s) will be the machine(s) in the job shop.
❖ We need to decide the order in which the jobs are processed
❖ Each job will have a (expected) processing time and a due date
Machine(s)
Our problem is to
determine which
Job arrive to the shop in Jobs wait in the queue until job to be
a random manner they are fetched for executed next
processing given processing
time and the due
date
Sequencing Rules
❖ There are several commonly used rules for selecting the sequence of jobs:
❖ First come, first served (FCFS): Jobs are processed in the order in which they arrive
at a machine or work center.
❖ Shortest processing time (SPT): Jobs are processed according to processing time at a
machine or work center, shortest job first.
❖ Earliest due date (EDD): Jobs are processed according to due date, earliest due date
first.
❖ Critical ratio (CR): Jobs are processed according to smallest ratio of time remaining
until due date to processing time remaining.
Performance Metrics
❖ In order to decide which selection rule is best-suited for our job shop, we
need to measure(s) for its performance:
❖ Job flow time is the amount of time it takes from when a job arrives
until it is complete. It includes not only actual processing time but
also any time waiting to be processed, transportation time between
operations, and any waiting time related to equipment breakdowns,
unavailable parts, quality problems, and so on. The average flow
time for a group of jobs is equal to the total flow time for the jobs
divided by the number of jobs.
Performance Metrics
❖ In order to decide which selection rule is best-suited for our job shop, we
need to measure(s) for its performance:
❖ Job lateness is the amount of time the job completion date is
expected to exceed the date the job was due or promised to a
customer. It is the difference between the actual completion time and
the due date. If only differences for jobs with completion times that
exceed due dates are recorded, and zeros are assigned to jobs that are
early, the term used is job tardiness.
Performance Metrics
❖ In order to decide which selection rule is best-suited for our job shop, we need to
measure(s) for its performance:
❖ Makespan is the total time needed to complete a group of jobs. It is the length of
time between the start of the first job in the group and the completion of the last
job in the group. If processing involves only one work center, makespan will be
the same regardless of the priority rule being used.
❖ Average number of jobs. Jobs that are in a shop are considered to be work-in-
process inventory. The average work-in-process for a group of jobs can be
computed using the following formula:
❖ Average number of jobs = Total flow time / Makespan
Example
❖ Assume that our job shop
received 6 jobs at the same day.
Job Processing Due Date (days from
Time (days) arrival)
❖ The order the jobs arrived as
A 2 7
follows: A-B-C-D-E-F B 8 16
C 4 4
❖ The processing times and due D 10 17
dates of the jobs are given in the E 5 15
table on the right F 12 18
Example: FCFS Selection Rule
Job Processing Due Date (days from Flow Time Tardiness
Time (days) arrival) Max(0 , flow time – due
date)
A 2 7 2 0
B 8 16 10 0
C 4 4 14 10
D 10 17 24 7
E 5 15 29 14
F 12 18 41 23
Total 41 120 54
❖ Average job flow time = (2+10+14+24+29+41) / 6 = 20 days
❖ Average tardiness = (0+0+10+7+14+23)/6 = 9 days
❖ Makespan = 41
❖ Average number of jobs = 120 / 41 = 2.93
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 0 , Sequence: ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 (7-0)/2 = 3.5
B 8 16 (16-0)/8 = 2
C 4 4 (4 – 0)/4 = 1
D 10 17 (17 – 0) / 10 = 1.7
E 5 15 (15- 0)/ 5 = 3
F 12 18 (18 – 0)/12 = 1.5
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 4, Sequence: C - ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 (7 - 4)/2 = 1.5
B 8 16 (16 - 4)/8 = 1.5
C 4 4 -
D 10 17 (17 – 4) / 10 = 1.3
E 5 15 (15- 4)/ 5 = 2.2
F 12 18 (18 – 4)/12 = 1.17
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 16, Sequence: C – F - ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 (7 - 16)/2 = - 4.5
B 8 16 (16 - 16)/8 = 0
C 4 4 -
D 10 17 (17 – 16) / 10 = 0.1
E 5 15 (15- 16)/ 5 = -0.2
F 12 18 -
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 18, Sequence: C – F – A - ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 -
B 8 16 (16 - 18)/8 = - 0.25
C 4 4 -
D 10 17 (17 – 18) / 10 = - 0.1
E 5 15 (15- 18)/ 5 = - 0.6
F 12 18 -
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 23, Sequence: C – F – A – E - ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 -
B 8 16 (16 - 23)/8 = - 0.875
C 4 4 -
D 10 17 (17 – 23) / 10 = - 0.6
E 5 15 -
F 12 18 -
Example: Critical Ratio
❖ Critical Ratio= [time to due date]/ [required processing time] (Select job with lowest CR)
❖ Red: Processed Job , Green: Selected Job
❖ T = 31, Sequence: C – F – A – E – B - ?
Job Processing Time (days) Due Date (days from arrival) Critical Ratio
A 2 7 -
B 8 16 -
C 4 4 -
D 10 17 (17 – 31) / 10 = - 1.4
E 5 15 -
F 12 18 -
Example: Critical Ratio
Job Processing Time Due Date (days from Flow Time Tardiness
(days) arrival) Max(0 , flow time – due date)
C 4 4 4 0
F 12 18 16 0
A 2 7 18 11
E 5 15 23 8
B 8 16 31 15
D 10 17 41 24
Total 41 133 58
❖ Final Sequence: C – F – A – E – B - D
❖ Average job flow time = 133/ 6 = 22.16 days
❖ Average tardiness = 58/6 = 9.6 days
❖ Makespan = 41
❖ Average number of jobs = 133 / 41 = 3.24