Grahams Schedules and the Number Partition Problem
We show the equivalence of the Number Partition Problem and the two processor scheduling problem. We establish a priori bounds on the completion times for the scheduling problem which are tighter than Graham's but almost on par with a posteriori boun…
Authors: Seenu S. Reddi
Graham’s Schedules and the Nu mber Partition Problem (NPP) Seenu S. Reddi ReddiSS at aol dot com July 19, 2008 Abstract: We show the equivalence of the Number Partition Problem and the two processor scheduling problem. We establis h a priori bounds on the com pletion times for the scheduling problem which are tighter than Graham’s but alm ost on par with a posteriori bounds of Coffman and Sethi. We conclude the paper w ith a characterization of the asymptotic behavior of the scheduling problem which relates to the spread of the processing times and the number of jobs. There is recent interest in the Num ber Partit ion Problem (NPP) (for instance see [1], [2]) and solutions are presented based on the Karp/Karmarkar technique for optimal partitions. We do not concern ourselves with this approach but rather so lve the problem by pointing out the equivalence between the NPP and 2-Processor Scheduling (2PS), and using Graham’s schedules. Graham’s schedu les are usually called Longest Processing Time (LPT) schedules in the literatu re but in view of his pioneering work in discovering these almost optim al schedules for the multi-proc essing problem and the fact that th is discovery ranks next to the Selmer Johns on’s beautiful result about the two-machine flow-shop scheduling, we feel justified in our nomenclature. In the course of our solution, we present a priori bounds tight er than Graham’s and a posteriori bounds comparable to Coffman and Sethi [3]. W e also derive asymptotic bounds when the numbers get large for specific cond itions. We will state the two problem s NPP and 2PS and establish the equivalence by a sim ple argument. Though this equivalence seems to be known and suspected by workers in the field, there was no simple and explicit proof offered (to the knowledge of the author). Assume a set of n numbers K = {t 1 , t 2 , …, t n }which are positive and greater than zero. Define S(K) = t 1 + t 2 + …, + t n as the sum of the m embers of the set K. NPP: Partition the set K into two sets K 1 and K 2 so that the absolute difference between S(K 1 ) and S(K 2 ) is mini mal. 2PS: Schedule the independent ta sks with processing times t 1 , t 2 , …, t n on two identical processors with identical speeds so that the completion time is m inimized. Note that 2PS minim izes the completion time (also referred to as make span) whereas the NPP minimizes the idle time on the processors. Assertion: NPP ⇔ 2PS. Proof: Assume the exclusive subsets A 1 and A 2 of K is an optimal solution to the NPP and B 1 and B 2 is an optimal solution to the 2PS. Assum e for simplicity S(A 1 ) ≥ S(A 2 ) and S(B 1 ) ≥ S(B 2 ). Then it follows since {B 1, B 2 } minimizes the com pletion time and {A 1, A 2 } min imize s the idle ti me: S(A 1 ) ≥ S(B 1 ) ( 1 ) S(B 1 ) - S(B 2 ) ≥ S(A 1 ) - S(A 2 ) ( 2 ) From these two relations we have: S(B 1 ) + (S(A 2 ) - S(B 2 )) ≥ S(A 1 ) ≥ S(B 1 ) (3) Since S(A 1 ) + S(A 2 ) = S(B 1 ) + S(B 2 ), we have from (1) : S(A 2 ) - S(B 2 ) = S(B 1 ) - S(A 1 ) ≤ 0 ( 4 ) From (3) we have (S(A 2 ) - S(B 2 )) ≥ 0 and combining with (4), it follows: S(A 2 ) - S(B 2 ) = S(B 1 ) - S(A 1 ) = 0 (5) This proves the assertion that the two solution s are equivalent. Since the NPP is equivalent to the 2PS, hereaf ter we will exclusively concern ours elves with the two processor scheduling problems and its solutions. There is extensive literature on this problem and Chen has a very comprehensive summary in his article [4]. Also we consider only two processors in the sequel and the numb er of processors is fixed at two. Most of the results can be extended to m ultiple processors but we do not do so here. We assume the set of jobs K = { t 1 , t 2 , …, t n }with t 1 ≥ t 2 ≥ … ≥ t n . Graham’s schedule (or LPT schedule) is to schedule the task w ith the longest processing time on one of the two processors when it becomes available. Thus a set of jobs with processing times {9, 7, 4, 3, 2} will be completed with a time of 13 units – processor 1 will be assigned tas ks with processing times 9 and 3, whereas proce ssor 2 with tasks with processing times 7, 4 and 2. Let C O be the optimal completion tim e and C G the completion time for Graham’s schedule. Then Graham proved [5]: Theorem 1: C G / C O ≤ 7 / 6 for two processors. Proof: See [5] for the proof. Graham’s bound is a priori in the sense that the bound is given without consideration of the jobs involved. Coffman and Sethi [3] pr ovide a better, a posteriori bound based on the number of jobs scheduled on the processo r that finishes the last. In the above example, processor 2 finishes last with three jobs and a processing time of 13. Let k be the number of jobs assigned to the p rocessor that finishes the last. Theorem 2: C G / C O ≤ 1 + 1 / k – 1 / 2k for two processors. Proof: Proof is involved and th e interested reader may refer to [3]. Bo Chen [6] has a correction but is not applicab le to the two processor case. We will now derive an improved bound better than Graham ’s in a relatively simple fashion based on the last job scheduled on the two processors . We assume the number of jobs n >> 2 and name the jobs with processing times t 1 , t 2 , …, t n as J 1 , J 2 , …, J n respectively. Let J L be the last job to be finished in the Graham’s schedule. In the above example J L will be J 5 since the last job to be finished has a processing time of two units and there are five jobs J 1 , J 2 , .., J 5 with processing times 9, 7, .., 2 respectively. Let L be the index (or subscript) of the last job to be finished and M = ⎡ L / 2 ⎤ , i.e., M is the least integer ≥ L / 2. Theorem 3: C G / C O ≤ (P + 1) / P – 1 / 2P where P = 24M 3 / (7 + 12M + 24M 2 ). Proof: We will find a P such that C G / C O ≤ (P + 1) / P – 1 / 2P. To find such a P, first find a P that violates the bound C G / C O > (P + 1) / P – 1 / 2P. Following Graham’s proof, we get: t L > C 0 / P ( 6 ) Since C G / C O ≤ 7 / 6 from Theorem 1, we have: C O ≥ 6C G / 7 ( 7 ) Combining (6) and (7) we get: t L > 6C G / ( 7 P ) ( 8 ) Thus we should choose P such that (8) is violated to get the required P: t L ≤ 6C G / ( 7 P ) ( 9 ) Since Mt L ≤ C G , it follows: 1 ≤ 6 M / ( 7 P ) ( 1 0 ) We can select P to be: P = 6 M / 7 ( 1 1 ) We can iterate this approach once more but starting with a better bound: C G / C O ≤ (P + 1) / P – 1 / 2P where P = (12M + 7) / 12M (12) obtained from (11). Iterating this procedure a couple of times, we get Theorem 3. The reader may object to the proof in the sens e it is not direct, i. e., assuming violation and then establishing the right value for the bounds. The problem is that if we do not do it, we get t L ≤ C0 / P and C O ≥ 6C G / 7 from which position we are no t able to extricate easily. If there are better proofs, the aut hor would be more than glad to hear them . The bounds derived by Theorem 3 is still a pos teriori since we have to compute the Graham’s schedule and find the last job sche duled. To derive bounds a priori (which makes theoretical predictions about the complexity eas ier), we introduce the concept of Possible Last Job (PLJ) and illustrate with an exam ple. We can compute PLJ and derive a priori bounds for the Graham’s schedule when com pared to the optimal one. Let K = { t 1 , t 2 , …, t n } be a given set of jobs whose times are arranged in the descending order (note to minimize notation, we implicitly associa te job J i with time t i and often use t i to denote job J i as well). Thus we have t 1 ≥ t 2 ≥ … ≥ t n and the Possible Last Job characterizes the job that can finish the last in Graham’s schedule. If there is a job t i for i < n such that we have: t i ≥ (t i+1 + t i+2 …+ t n ) , i < n ( 1 3 ) we call such a job as dom inant. PLJ is the i ndex of the largest of the dominant job. As an example if we have {12, 5, 3, 2, 1}, we see J 3 with processing time 3 is dominant since 3 ≥ (2 + 1), J 2 is not dominant but J 1 is since 12 ≥ (5 + 3 + 2 + 1) = 11. Note job J n-1 is always dominant since t n-1 ≥ t n . In this case the PLJ is 1 since J 1 is the largest dominant job. The concept behind PLJ is that in a Graham ’s schedule PLJ can be the job that finishes the last but it is cert ainly possible other jobs whose in dices are greater can finish last. In this example J 1 does finish last but if we have ta sks {7, 5, 3, 3, 1}, then the only dominant job is the trivial J 4 and hence the PLJ is 4. In this case J 4 does not finish the last but if we consider tasks {7, 6, 3, 3, 2}, J 5 finishes the last. Thus we conclude: Lemma 1: The index of the last job processed in a Graham’s schedule is always greater than or equal to the PLJ f or the given set of jobs. Also the PLJ can be computed with a complexity of o(n 2 ) operations. Let P = ⎡ PLJ / 2 ⎤ , i.e., P is the least integer ≥ PLJ / 2. Since we have L ≥ PLJ, we can follow a similar argument as in Theo rem 3 to establish: Theorem 4: C G / C O ≤ (Q + 1) / Q – 1 / 2Q where Q = 24P 3 / (7 + 12P + 24P 2 ) Note the bounds derived in Theorem 4 can be computed without explicitly computing the underlying Graham’s schedule. A numerical simulation is conducted to see how the various bounds compare and the results are summarized in Table 1. We considered 15, 20 and 25 jobs whose processing times are randomly chosen from [1, 32000] using a uniform distribution. For each set the sim ulation was run around 100 times and we computed the average completion tim e ratio (AC), the maximum completion time ratio (MC), the bound computed using Theorem 3 (BM), the bound computed using Theorem 4 (BP), and the bound BL computed using Coffman and Sethi (Theorem 2). TABLE 1 Jobs AC MC BM BP BL 15 1.007 1.045 1.080 1.086 1.068 20 1.004 1.020 1.055 1.061 1.051 25 1.002 1.016 1.044 1.046 1.040 Thus we see the bounds derived using Theore ms 3 and 4 are comparable to the bounds derived by Coffman and Sethi and they get be tter with th e increasing number of jobs. We conclude the paper by presenting asym ptotic bounds to the 2PS which are equally applicable to NPP. For a given set of N tasks, we divide the m into two mutually exclusively subsets consisting of jobs { t 1 , t 2 , …, t n } and { t n+1 , t n+2 , …, t n+m } where n is the PLJ for the given set and n + m = N. Let G n and G n+m be the Graham’s completion times for the sets { t 1 , t 2 , …, t n } and { t 1 , t 2 , …, t n, t n+1 , t n+2 , …, t n+m } and O n and O n+m be their optimal completion times. We note sin ce PLJ = n, we have t n ≥ t n+1 + t n+2 + …+t n+m . We have O n ≤ O n+m and nt 1 ≥ O n . Also G n+m ≤ G n + t n . Hence: G n+m / O n+m ≤ G n+m / O n ≤ G n / O n + t n / O n ≤ G n / O n + t n / nt 1 (14) Assuming δ = t n / t 1 and using Theorem 4 we have: Theorem 5: For a set of N jobs with PLJ = n and δ = t n / t 1 is the ratio of the processing times of the dominant jo b to the largest job, as N becomes large we have: C G / C O ~ 1 + 1 / n + δ / n ( 1 5 ) Note that a similar type of result appears in Ib arra and Chen [7] (but their attribution of a similar result to Coffm an and Sethi because of the referee’s comments seem s questionable to me). References: [1] Hayes, Brian, Group Theory in the Bedr oom and Other Mathematical Diversions, Hill and Wang, NY, 2008. [2] Mertens, Stephan, “A Physicist’s Appr oach to Number Partition ing,” Theoretical Computer Science, Vol. 265, pp. 79 – 108. Mo st of Mertens’ publications are available from his website (Yahoo or Google his name for his website). [3] Coffman, E. G. and Sethi, R., “A Gene ralized Bound on LPT Sequencing,” Proc. Int. Symp. Comp. Perf. Modeling, March 1976, pp. 306 – 317. (Available as PDF at www.rspq.org/pubs ). [4] Chen, Bo, Parallel Sche duling for Early Completion. Handbook of Scheduling: Algorithms, Models, and Performance Analysis (Chapter 9) (Joseph Y.-T. Leung, Ed.), Chapman & Hall/CRC, 2004. ISBN 1-58488-397-9. Available as a PDF at http://www.warwick.ac.uk/staff/B.Chen/Copy_of_publications/Leung_CH09.pdf [5] Graham, Ronald, “Bounds on Multiprocessin g Timing Anomalies,” S IAM J. Appl. Math., Vol 17, No. 2, March 1969. All Graham ’s publications are av ailable online – see wikipedia.org entry for Ronald Graham. [6] Chen, Bo, “A Note on LPT Scheduling,” Oper. Res. Lett., Vol. 14, pp. 139-142, 1993. [7] Ibarra, Oscar and Kim, Chul, “Heuris tic Algorithms for Scheduling Independent Tasks on Nonidentical Processors,” JACM, Vol 24, pp. 280-289, 1977. (Available as PDF at www.rspq.org/pubs ).
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment