Job Scheduling1
Job Scheduling1
2
Job Sequencing With Deadlines
J = { 1} is a feasible one
J = { 1, 4} is a feasible one with processing
sequence
( 4,1)
J = { 1, 3, 4} is not feasible
J = { 1, 2, 4} is not feasible
J = { 1, 4} is optimal
5
Greedy Algorithm To Obtain An Optimal
Solution
Algorithm Steps:
1.Sort the jobs based on profit in descending order.
2.Initialize an array timeslot to hold jobs (initially empty). OR Draw Gantt chart
with maximum deadline
3.Use a loop to assign jobs to the latest possible timeslot based on deadlines.
Jobs 1 2 3 4 5
Profit 20 15 10 5 1
Deadline 2 2 1 3 3
7
Iteration Process
8
Iteration Process
9
Greedy Algorithm To Obtain An Optimal
Solution
EXAMPLE: let n = 5, (p1,--------p5) = (20,15,10,5,1) and (d1,--d5) =
(2,2,1,3,3). Using the above rule
10
Solve the following
Jobs A B C D E
Profit 100 19 27 25 15
Deadline 2 1 2 1 3
Jobs 1 2 3 4 5
Profit 35 30 25 20 15
Deadline 3 4 4 2 3
11