28
A FASTER IMPLEMENTATION OF
JS (Contd..)
EXAMPLE: let n = 5, (p
1,--------p
5) = (20,15,10,5,1) and (d
1,--d
5) =
(2,2,1,3,3). Using the above rule
J assigned slot jobs being considered action or
Ø none 1 assigned to [1, 2]
{1} [ 1,2] 2 [0,1]
{1,2} [0,1],[1,2] 3 cannot fit reject as
[0,1] is not free
{1,2} [0,1],[1,2] 4 assign to [2,3]
{1,2,4} [0,1],[1,2],[2,3] 5 reject
The optimal solution is {1,2,4}