List Scheduling and LPT Oliver Braun (09/05/207) We investigate the classical scheduling proble P ax where a set of n independent jobs has to be processed on 2 parallel and identical processors (achines) such that the akespan ax is iniized. If n then any schedule that just assigns each job to a different achine would be optial. Therefore we assue that n. We denote the iniu akespan across any schedule by ax. Lower Bounds Let A be any algorith that solves P ax with akespan A ax. Let J k, with processing tie p k and copletion tie k, be the job that deterines the akespan. Lea (Lower Bound): A ax ax ax { k, j= p } j Proof. j= p j is the total aount of processing that ust be done across all achines. Then for achines, j= p j would be the average processing that needs to be done. By properties of the average, at least one achine ust then process at least this average. Hence, there will be always at least one job J k with copletion tie k j= p j. Lea 2 (Lower Bound): A ax ax p ax p j (for any j =,..., n). Proof. A processor can process only one job at a tie. This eans, a job can be copleted no faster than it s given processing tie. If p ax = ax{p j }, then at least one achine ust have p ax processing load. As a result, j= p j/ and p ax for lower bounds for the akespan of any algorith solving P ax and clearly ax A ax ax {( j= p j)/, p ax }.
2 List Scheduling Let LS be the List Scheduling algorith: Always take the next job of the list and process it on that processor that has done the least aount of work so far (if there is ore than one processor with the sallest load use that with the sallest index). Lea 3 (Upper Bound): LS ax j= p j. Proof. This bound is obviously true as List Scheduling would never use just one processor (actually at least processors as we assue that n ). Lea (Upper Bound): LS ax ( 2 ) ax. Proof. Let J k denote the job that copletes last across all achines, say on achine P i. This job was assigned according to the List Scheduling procedure when achine P i had the least load, so that ax LS = k = s k +p k, where s k is the starting tie of job J k. This starting tie s k is equal to the aount of load on achine P i when J k was assigned to it. We now use relations: s k, the starting tie of the job J k, cannot be larger than the su of the processing ties of all of the other jobs divided by the nuber of achines,. So we coe to s k = = j= p j, j k ( n j= p j ) p k n j= p j p k. LS ax = k = s k + p k j= p j p k + p k j= p ( j + p k ) Using the Lower Bounds (Lea and Lea 2), it follows that ) ax LS ax + ax ( 2 ) ax ( 2
Lea 5 (Tightness of the Upper Bound): There are proble instances for arbitrary values of where the upper bound ( 2 ) ax derived in the previous Lea is tight. Proof. To achieve a tight worst-case for the akespan by List Scheduling with processors, we choose n = ( ) + jobs as follows: One job ( Type A ) has processing tie, ( ) jobs ( Type B ) have processing ties. List Schedule: Type B -jobs followed by Type A -job. Optiu Schedule: Type A -job followed by Type B -jobs. Exaple: The tight worst-case exaple for = 3 processors is dispayed in Figure. Figure : Tight worst-case exaple for = 3 processors 3 LPT Let LP T be the Longest Processing Tie first algorith: Start sorting the jobs in nonincreasing order. Apply then List Scheduling on this sorted set of jobs. Lea 6 (Upper Bound): LP T ax j= p j. Proof. This bound is obviously true as LPT would never use just one processor (actually at least processors as we assue that n ). In order to prove the tight upper bound ax LP T (/3 /(3))ax, we start to prove four orollaries. Let J k (with processing tie p k ) be again that job that deterines the akespan (in this case of the LPT-schedule), i.e. k = ax LP T. Let T be the original job set and T 2 be the truncated job set where all jobs that coe after job J k in the LPT-order are deleted fro the original job set. Doing this, we assure that J k is actually not only the last job that is scheduled (in the LPT-order) but also that it is the sallest job. orollary ax LP T (T ) ax(t ) LP T ax (T 2 ) ax(t 2 ) 3
Proof. The akespans of the original LPT list and the truncated list are the sae (note that we just take out those jobs that coe after J k and have no influence on the akespan). The optiu akespan can definitely not get larger when we have to schedule less jobs. As the nuerators reain the sae and the denoinator of the T 2 -schedule is not larger than the denoinator of the T -schedule, the result follows iediately. orollary 2 ( ax LP T ax + p k ) Proof. In a siilar way as in the List Scheduling prove above, we coe to: LP T ax = k = s k + p k j= p j p k + p k j= p ( j + p k ) ( ax + p k ) orollary 3 If ax < 3 p k, then each processor has at ost two jobs. Proof. We show: If there is a processor that has at least three jobs, then ax 3 p k. This is obviously true as all other jobs have processing ties that are greater than or equal to p k. orollary If each processor has at ost two jobs, then LPT is always optial. Proof. It is obvious that for n + LPT ust be optial (if n = +, then the two sallest jobs are scheduled on P, and in all other cases there is only one job scheduled on each processor). Let s look at the case n = 2. In that case, each processor ust have exactly two jobs (as the current finishing ties of the processors are non-increasing, we would never let one of the processors that have less load than P just schedule one job). We assue w.l.o.g. that on processor P there is the largest job J with length p scheduled. Then it is clear that in an optial schedule J has to be cobined with J k (reeber: J k is the sallest job that is scheduled and it deterines the akespan, i.e. k = ax LP T ). If we would interchange J k with another job, then the akespan would only get larger and will not reain optial. The sae is true if we have n < 2 jobs. In this case, we cobine J k always with J 2 n+. And again, interchanging would only increase the akespan.
Exaple: The Exaple in Figure 2 shows = 3 processors with n = 2 = 6 and n = 2 = 5 jobs. Figure 2: Exaple for = 3 processors with n = 2 = 6 and n = 2 = 5 jobs Lea 7 (Upper Bound): LP T ax ( 3 3) ax. Proof (by contradiction). Assue that there exists a job set T = {J,..., J n } that contradicts Lea 7, i.e. ax LP T (T ) > ( 3 3) ax (T ). Let T 2 be the truncated job set where all jobs that coe after job J k in the LPT-order are deleted fro the original job set. onclusion : It follows fro ( ax LP T (T ) > 3 ) 3 ax(t ) that (because of 3 < 3 ) LP T ax (T ) > ax(t ). As the optiu akespan of the truncated job set cannot be larger than the optial akespan of the original job set, i.e. we coe to onclusion 2: It follows fro that ax(t 2 ) ax(t ), LP T ax (T ) > ax(t 2 ). LP T ax (T ) > ( 3 ) 3 ax(t ) 3 3 < LP T ax (T ) ax(t ) 5
and so (by orollary (a)) 3 3 < LP T ax (T 2 ) ax(t 2 ) and (by orollary (b)) or This yields to or 3 3 < ax(t 2 ) + p k ax(t 2 ) ( ) 3 3 < + p ( ) k ax(t 2 ). 3 3 < p ( ) k ax(t 2 ) 3 < p k ax(t 2 ) and so to ax(t 2 ) < 3 p k. It follows fro orollary (c) that in this case each processor ust have at ost two jobs, and fro olorollary (d) it follows that if each processor has at ost two jobs, then LPT is always optial, i.e. LP T ax (T ) = ax(t 2 ). But this is a contradiction to onclusion and therefore the assuption that there exists a job set T = {J,..., J n } that contradicts Lea 7, i.e. ax LP T (T ) > ( 3 3) ax (T ), cannot be true. Lea 8 (Tightness of the Upper Bound): There are proble instances for arbitrary values of where the upper bound ( 3 3) ax derived in the previous Lea is tight. Proof. To achieve a tight worst-case for the akespan by LPT Scheduling with processors, we choose n = 2 + jobs as follows: 2 jobs of size 2, 2 jobs of size 2 2,..., 2 jobs of size +, 3 jobs of size. Exaple: The Exaple in Figure 3 shows a tight worst-case exaple for = 3 processors. 6
Figure 3: Tight worst-case exaple for = 3 processors oplexity Lea (oplexity): P 2 ax is NP-hard. Proof. (Fro this result it follows that also P ax for an arbitrary 2 ust be NPhard.) We prove this by reducing PARTITION to the decision version of the SHEDULING proble P 2 ax. j= PARTITION: Given a list of n positive integers s, s 2,..., s n and a value b = s j, does 2 there exist a subset J I = {,..., n} such that s j = b = j J Reark: Partition is NP-hard in the ordinary sense, i.e. the proble cannot be optially solved by an ( algorith with polynoial tie coplexity but with an algorith of tie coplexity O (n ax s j ) k). SHEDULING: Given n jobs with processing ties p j where j {, 2,..., n} and a nuber k, the decision version of the scheduling proble P 2 ax is to check if there is a schedule with akespan not ore than k. Step : P 2 ax is in NP j k p j s k If the schedule of the jobs for each of the 2 achines is given, it can be verified in polynoial tie that the copletion ties,..., n of all jobs J,..., J n are less than or equal to T. Thus, P 2 ax belongs to NP. Reark : learly, any k has a binary encoding which is bounded by a polynoial in the input length of the proble. Reark 2: Every decision proble solvable in polynoial tie belongs to NP. If we have such a proble P and an algorith which calculates for each input x the answer h(x) {yes, no} in a polynoial nuber of steps, then this answer h(x) ay be used as a certificate. This certificate can be verified by the algorith. Thus P is also in NP which iplies P NP. Step 2: PARTITION reduces to SHEDULING: PARTITION SHEDULING Reark 3: For two decision probles P and Q, we say that P reduces to Q (denoted P Q) if there exists a polynoial-tie coputable function g that transfors inputs for P into inputs for Q such that x is a yes-input for P if and only if g(x) is a yes-input for Q. A yes-answer for a decision proble can be verified in polynoial tie (this is not the case for the no-answer. 7 j I/J s j
We are going to show that the PARTITION is reducible to SHEDULING:. The input of the SHEDULING proble can be coputed in polynoial tie given the input of the PARTITION proble: We ust transfor in polynoial tie the input for PARTITION into an instance of SHEDULING such that there is a solution for PARTITION if and only if there is a schedule with ax k for a suitable value k. This is easy: We just set k = b and define the SHEDULING proble as follows: onsider the jobs J j with p j = s j for j =,..., n. We choose k = b as the threshold for the corresponding decision proble. 2. a. If PARTITION has a solution, then the decision version of SHEDULING has a solution: If PARTITION has a solution, then there exists an index set J {,..., n} such that i J s i = b. In this case the schedule p i J on P and p i/ J on P 2 solves the decision version of proble P 2 ax. 2. b. If the decision version of SHEDULING has a solution, then PARTITION has a solution: If the decision version of SHEDULING has a solution, then the jobs with processing ties p,..., p n are scheduled on P (all p i J and P 2 (all p i/ J ) such that the akespan is less than or equal to k. In this case the PARTITION j J s j = b = k = j I/ J s j solves the PARTITION proble. Since SHEDULING is in NP, and since we can reduce the NP-coplete proble PARTI- TION to SHEDULING in polynoial tie, SHEDULING ust also be NP-coplete. 8