If the input set is S = {4, 5, 6, 7, 8} and m = 2, then the resulting partition is {8, 5, 4}, {7, 6}. If m = 3, then the resulting 3-way partition is {8}, {7, 4}, {6, 5}.
LPT might not find the optimal partition. For example, in the above instance the optimal partition {8,7}, {6,5,4}, where both sums are equal to 15. However, its suboptimality is bounded both in the worst case and in the average case; see Performance guarantees below.
The running time of LPT is dominated by the sorting, which takes O(n log n) time, where n is the number of inputs.
LPT is monotone in the sense that, if one of the input numbers increases, the objective function (the largest sum or the smallest sum of a subset in the output) weakly increases.2 This is in contrast to Multifit algorithm.
When used for identical-machines scheduling, LPT attains the following approximation ratios.
In the worst case, the largest sum in the greedy partition is at most 4 3 {\displaystyle {\frac {4}{3}}} times the optimal (minimum) largest sum.34
A more detailed analysis yields a factor of 4 m − 1 3 m = 4 3 − 1 3 m {\displaystyle {\frac {4m-1}{3m}}={\frac {4}{3}}-{\frac {1}{3m}}} times the optimal (minimum) largest sum.56 (for example, when m =2 this ratio is 7 / 6 ≈ 1.167 {\displaystyle 7/6\approx 1.167} ).7
The factor 4 m − 1 3 m {\displaystyle {\frac {4m-1}{3m}}} is tight. Suppose there are 2 m + 1 {\displaystyle 2m+1} inputs (where m is even): 2 m − 1 , 2 m − 1 , 2 m − 2 , 2 m − 2 , … , m + 1 , m + 1 , m , m , m {\displaystyle 2m-1,2m-1,2m-2,2m-2,\ldots ,m+1,m+1,m,m,m} . Then the greedy algorithm returns:
with a maximum of 4 m − 1 {\displaystyle 4m-1} , but the optimal partition is:
with a maximum of 3 m {\displaystyle 3m} .
An even more detailed analysis takes into account the number of inputs in the max-sum part.
In the worst case, the smallest sum in the returned partition is at least 3 4 {\displaystyle {\frac {3}{4}}} times the optimal (maximum) smallest sum.11
The proof is by contradiction. We consider a minimal counterexample, that is, a counterexample with a smallest m and fewest input numbers. Denote the greedy partition by P1,...,Pm, and the optimal partition by Q1,...,Qm. Some properties of a minimal counterexample are:
The proof that a minimal counterexample does not exist uses a weighting scheme. Each input x is assigned a weight w(x) according to its size and greedy bundle Pi:
This weighting scheme has the following properties:
A more sophisticated analysis shows that the ratio is at most 3 m − 1 4 m − 2 {\displaystyle {\frac {3m-1}{4m-2}}} (for example, when m=2 the ratio is 5/6).1213
The above ratio is tight.14
Suppose there are 3m-1 inputs (where m is even). The first 2m inputs are: 2m-1, 2m-1, 2m-2, 2m-2, ..., m, m. The last m-1 inputs are all m. Then the greedy algorithm returns:
with a minimum of 3m-1. But the optimal partition is:
with a minimum of 4m-2.
There is a variant of LPT, called Restricted-LPT or RLPT,15 in which the inputs are partitioned into subsets of size m called ranks (rank 1 contains the largest m inputs, rank 2 the next-largest m inputs, etc.). The inputs in each rank must be assigned to m different bins: rank 1 first, then rank 2, etc. The minimum sum in RLPT is at most the minimum sum at LPT. The approximation ratio of RLPT for maximizing the minimum sum is at most m.
In the average case, if the input numbers are distributed uniformly in [0,1], then the largest sum in an LPT schedule satisfies the following properties:
Let Ci (for i between 1 and m) be the sum of subset i in a given partition. Instead of minimizing the objective function max(Ci), one can minimize the objective function max(f(Ci)), where f is any fixed function. Similarly, one can minimize the objective function sum(f(Ci)). Alon, Azar, Woeginger and Yadid19 prove that, if f satisfies the following two conditions:
Then the LPT rule has a finite approximation ratio for minimizing sum(f(Ci)).
An important special case is that the item sizes form a divisible sequence (also called factored). A special case of divisible item sizes occurs in memory allocation in computer systems, where the item sizes are all powers of 2. If the item sizes are divisible, and in addition, the largest item sizes divides the bin size, then LPT always finds a scheduling that minimizes the maximum size,20: Thm.4 and maximizes the minimum size.21: Thm.5
Besides the simple case of identical-machines scheduling, LPT has been adapted to more general settings.
In uniform-machines scheduling, different machines may have different speeds. The LPT rule assigns each job to the machine on which its completion time will be earliest (that is, LPT may assign a job to a machine with a larger current load, if this machine is so fast that it would finish that job earlier than all other machines).22
In the balanced partition problem, there are constraints on the number of jobs that can be assigned to each machine. A simple constraint is that each machine can process at most c jobs. The LPT rule assigns each job to the machine with the smallest load from among those with fewer than c jobs. This rule is called modified LPT or MLPT.
Another constraint is that the number of jobs on all machines should be n / m {\displaystyle n/m} rounded either up or down. In an adaptation of LPT called restricted LPT or RLPT, inputs are assigned in pairs - one to each machine (for m=2 machines).30 The resulting partition is balanced by design.
In the kernel partitioning problem, there are some m pre-specified jobs called kernels, and each kernel must be scheduled to a unique machine. An equivalent problem is scheduling when machines are available in different times: each machine i becomes available at some time ti ≥ 0 (the time ti can be thought of as the length of the kernel job).
A simple heuristic algorithm, called SLPT,33 assigns each kernel to a different subset, and then runs the LPT algorithm.
Often, the inputs come online, and their sizes becomes known only when they arrive. In this case, it is not possible to sort them in advance. List scheduling is a similar algorithm that takes a list in any order, not necessarily sorted. Its approximation ratio is 2 m − 1 m = 2 − 1 m {\displaystyle {\frac {2m-1}{m}}=2-{\frac {1}{m}}} .
A more sophisticated adaptation of LPT to an online setting attains an approximation ratio of 3/2.37
Graham, R. L. (March 1969). "Bounds on Multiprocessing Timing Anomalies". SIAM Journal on Applied Mathematics. 17 (2): 416–429. CiteSeerX 10.1.1.90.8131. doi:10.1137/0117039. JSTOR 2099572. NAID 30006801878 ProQuest 917998761. /wiki/CiteSeerX_(identifier) ↩
Segal-Halevi, Erel (2021-10-17), On Monotonicity of Number-Partitioning Algorithms, arXiv:2110.08886, retrieved 2024-02-22 http://arxiv.org/abs/2110.08886 ↩
Xiao, Xin (2017-04-01). "A Direct Proof of the 4/3 Bound of LPT Scheduling Rule". Proceedings of the 2017 5th International Conference on Frontiers of Manufacturing Science and Measuring Technology (FMSMT 2017). Atlantis Press. pp. 486–489. doi:10.2991/fmsmt-17.2017.102. ISBN 978-94-6252-331-9. 978-94-6252-331-9 ↩
Proof. Normalize the input items such that OPT=1. This implies that the sum of all items is at most m. Partition the items into large (more than 2/3), medium (between 1/3 and 2/3), and small (less than 1/3). Let their numbers be nL, nM and nS. In each optimal partition, each part contains at most one large item, so nL ≤ m. Moreover, each optimal part cannot contain both a large and a medium item, or three medium items; so nM ≤ 2(m-nL). The operation of the greedy algorithm can be partitioned into three phases: 1. Allocating the large items - each of which is put in a different bin. Since nL ≤ m, when this phase completes, each bin contains at most one item, so the max-sum is at most 1. 2. Allocating the medium items. The first m-nL ones are put in empty bins, and the next m-nL ones (if any) are added into the same bins. Since nM ≤ 2(m-nL), when this phase completes, each bin contains either one large item - with sum at most 1, or at most two medium items - with sum at most 4/3. 3. Allocating the small items. Each item is added into the bin with the smallest sum. The smallest sum is at most the average sum, which is at most 1. Hence, once a small item is added, the new sum becomes at most 4/3. ↩
Coffman, E. G.; Sethi, Ravi (1976-03-29). "A generalized bound on LPT sequencing". Proceedings of the 1976 ACM SIGMETRICS conference on Computer performance modeling measurement and evaluation - SIGMETRICS '76. New York, NY, USA: Association for Computing Machinery. pp. 306–310. doi:10.1145/800200.806205. ISBN 978-1-4503-7497-2. S2CID 16980306. 978-1-4503-7497-2 ↩
Proof. The previous proof can be refined in two ways. First, one can prove that, once all large and medium items are allocated, the sum in each bin is at most 1. If there are at most m-nL medium items, then each large and medium item is placed in a separate bin, so the sum is clearly at most 1. Otherwise, denote the first m-nL medium items by top-medium items, and the others (at most m-nL) by bottom-medium items. Assume first that item #m is larger than 1/2. This means that the items #1,...,#m are all larger than 1/2, so each must be in a different optimal part. Each of the bottom-medium items (items #m+1,...#nM) must fit into an optimal part with exactly one of the items #1,...,#m . Let us call two items matchable if their sum is at most 1, so that they can fit into the same optimal part. By Hall's theorem, each subset of k bottom-medium items must be matchable to at least k of the items #1,...,#m. In particular, the item #m+1 must be matchable to item #m; items #m+1 and #m+2 must be matchable to item #m-1; and in general, item #m+k must be matchable to item #'m-k+1. LPT indeed puts item #m+k in the same bin as #'m-k+1, so the sum of each bin is at most 1. Second, one can prove that, when allocating the small inputs, the sum of every new bin is at most 4/3-1/(3m). There are two cases: 1. If the current smallest sum is at most 1-1/(3m), then the new sum - after adding one small input - is at most 1-1/(3m)+1/3 = 4/3-1/(3m). 2. Otherwise, all sums are larger than 1-1/(3m), so the sum of the m-1 largest bins is larger than m-1-1/3+1/(3m) = m-(4/3-1/(3m)). Since the total sum of all inputs is at most m, the new sum must be less than 4/3-1/(3m). ↩
Chen, Bo (1993-10-01). "A note on LPT scheduling". Operations Research Letters. 14 (3): 139–142. doi:10.1016/0167-6377(93)90024-B. ISSN 0167-6377. https://dx.doi.org/10.1016/0167-6377%2893%2990024-B ↩
Deuermeyer, Bryan L.; Friesen, Donald K.; Langston, Michael A. (June 1982). "Scheduling to Maximize the Minimum Processor Finish Time in a Multiprocessor System". SIAM Journal on Algebraic and Discrete Methods. 3 (2): 190–196. doi:10.1137/0603019. /wiki/Doi_(identifier) ↩
Csirik, János; Kellerer, Hans; Woeginger, Gerhard (June 1992). "The exact LPT-bound for maximizing the minimum completion time". Operations Research Letters. 11 (5): 281–287. doi:10.1016/0167-6377(92)90004-M. /wiki/Doi_(identifier) ↩
Wu, Bang Ye (December 2005). "An analysis of the LPT algorithm for the max–min and the min–ratio partition problems". Theoretical Computer Science. 349 (3): 407–419. doi:10.1016/j.tcs.2005.08.032. https://doi.org/10.1016%2Fj.tcs.2005.08.032 ↩
Walter, Rico (2013-01-01). "Comparing the minimum completion times of two longest-first scheduling-heuristics". Central European Journal of Operations Research. 21 (1): 125–139. doi:10.1007/s10100-011-0217-4. ISSN 1613-9178. S2CID 254144745. https://doi.org/10.1007/s10100-011-0217-4 ↩
Coffman, E. G.; Frederickson, G. N.; Lueker, G. S. (1984-05-01). "A Note on Expected Makespans for Largest-First Sequences of Independent Tasks on Two Processors". Mathematics of Operations Research. 9 (2): 260–266. doi:10.1287/moor.9.2.260. ISSN 0364-765X. https://pubsonline.informs.org/doi/abs/10.1287/moor.9.2.260 ↩
Frenk, J.B.G.; Kan, A.H.G.Rinnooy (June 1986). "The rate of convergence to optimality of the LPT rule". Discrete Applied Mathematics. 14 (2): 187–197. doi:10.1016/0166-218X(86)90060-0. hdl:1765/11698. /wiki/Doi_(identifier) ↩
Frenk, J. B. G.; Rinnooy Kan, A. H. G. (1987-05-01). "The Asymptotic Optimality of the LPT Rule". Mathematics of Operations Research. 12 (2): 241–254. doi:10.1287/moor.12.2.241. ISSN 0364-765X. S2CID 31770203. https://pubsonline.informs.org/doi/abs/10.1287/moor.12.2.241 ↩
Alon, Noga; Azar, Yossi; Woeginger, Gerhard J.; Yadid, Tal (1998). "Approximation schemes for scheduling on parallel machines". Journal of Scheduling. 1 (1): 55–66. doi:10.1002/(SICI)1099-1425(199806)1:1<55::AID-JOS2>3.0.CO;2-J. ISSN 1099-1425. https://onlinelibrary.wiley.com/doi/abs/10.1002/%28SICI%291099-1425%28199806%291%3A1%3C55%3A%3AAID-JOS2%3E3.0.CO%3B2-J ↩
Coffman, E. G; Garey, M. R; Johnson, D. S (1987-12-01). "Bin packing with divisible item sizes". Journal of Complexity. 3 (4): 406–428. doi:10.1016/0885-064X(87)90009-4. ISSN 0885-064X. https://dx.doi.org/10.1016/0885-064X%2887%2990009-4 ↩
Gonzalez, Teofilo; Ibarra, Oscar H.; Sahni, Sartaj (1977-03-01). "Bounds for LPT Schedules on Uniform Processors". SIAM Journal on Computing. 6 (1): 155–166. doi:10.1137/0206013. ISSN 0097-5397. https://epubs.siam.org/doi/abs/10.1137/0206013 ↩
Mireault, Paul; Orlin, James B.; Vohra, Rakesh V. (1997-02-01). "A Parametric Worst Case Analysis of the LPT Heuristic for Two Uniform Machines". Operations Research. 45 (1): 116–125. doi:10.1287/opre.45.1.116. ISSN 0030-364X. https://pubsonline.informs.org/doi/abs/10.1287/opre.45.1.116 ↩
Koulamas, Christos; Kyparisis, George J. (2009-07-01). "A modified LPT algorithm for the two uniform parallel machine makespan minimization problem". European Journal of Operational Research. 196 (1): 61–68. doi:10.1016/j.ejor.2008.02.008. ISSN 0377-2217. https://www.sciencedirect.com/science/article/pii/S0377221708001938 ↩
Kellerer, Hans; Woeginger, Gerhard (1993-09-07). "A tight bound for 3-partitioning". Discrete Applied Mathematics. 45 (3): 249–259. doi:10.1016/0166-218X(93)90013-E. ISSN 0166-218X. https://doi.org/10.1016%2F0166-218X%2893%2990013-E ↩
Babel, Luitpold; Kellerer, Hans; Kotov, Vladimir (1998-02-01). "The m-partitioning problem". Mathematical Methods of Operations Research. 47 (1): 59–82. doi:10.1007/BF01193837. ISSN 1432-5217. S2CID 5594197. https://doi.org/10.1007/BF01193837 ↩
Dell'Amico, Mauro; Martello, Silvano (2001). "Bounds for the cardinality constrained P∥Cmax problem". Journal of Scheduling. 4 (3): 123–138. doi:10.1002/jos.68. ISSN 1099-1425. https://onlinelibrary.wiley.com/doi/abs/10.1002/jos.68 ↩
Chen, Shi Ping; He, Yong; Lin, Guohui (2002-03-01). "3-Partitioning Problems for Maximizing the Minimum Load". Journal of Combinatorial Optimization. 6 (1): 67–80. doi:10.1023/A:1013370208101. ISSN 1573-2886. S2CID 9053629. https://doi.org/10.1023/A:1013370208101 ↩
Tsai, Li-Hui (1992-02-01). "Asymptotic Analysis of an Algorithm for Balanced Parallel Processor Scheduling". SIAM Journal on Computing. 21 (1): 59–64. doi:10.1137/0221007. ISSN 0097-5397. https://epubs.siam.org/doi/abs/10.1137/0221007 ↩
Chen, S. -P.; He, Y.; Yao, E. -Y. (1996-09-01). "Three-partitioning containing kernels: Complexity and heuristic". Computing. 57 (3): 255–271. doi:10.1007/BF02247409. ISSN 1436-5057. S2CID 21935917. https://doi.org/10.1007/BF02247409 ↩
Lee, Chung-Yee (1991-01-07). "Parallel machines scheduling with nonsimultaneous machine available time". Discrete Applied Mathematics. 30 (1): 53–61. doi:10.1016/0166-218X(91)90013-M. ISSN 0166-218X. https://doi.org/10.1016%2F0166-218X%2891%2990013-M ↩
Lin, Guo-Hui; Yao, En-Yu; He, Yong (1998-03-01). "Parallel machine scheduling to maximize the minimum load with nonsimultaneous machine available times". Operations Research Letters. 22 (2): 75–81. doi:10.1016/S0167-6377(97)00053-9. ISSN 0167-6377. https://www.sciencedirect.com/science/article/pii/S0167637797000539 ↩
Shen, Lixin; Wang, Dan; Wang, Xiao-Yuan (2013-04-01). "Parallel-machine scheduling with non-simultaneous machine available time". Applied Mathematical Modelling. 37 (7): 5227–5232. doi:10.1016/j.apm.2012.09.053. ISSN 0307-904X. https://www.sciencedirect.com/science/article/pii/S0307904X12005847 ↩
Chen, Bo; Vestjens, Arjen P. A. (1 November 1997). "Scheduling on identical machines: How good is LPT in an on-line setting?" (PDF). Operations Research Letters. 21 (4): 165–169. doi:10.1016/S0167-6377(97)00040-0. https://pure.tue.nl/ws/files/1556464/459560.pdf ↩