The multifit algorithm is an algorithm for multiway number partitioning, originally developed for the problem of identical-machines scheduling. It was developed by Coffman, Garey and Johnson. Its novelty comes from the fact that it uses an algorithm for another famous problem - the bin packing problem - as a subroutine.
The algorithm The input to the algorithm is a set S of numbers, and a parameter n. The required output is a partition of S into n subsets, such that the largest subset sum (also called the makespan) is as small as possible. The algorithm uses as a subroutine, an algorithm called first-fit-decreasing bin packing (FFD). The FFD algorithm takes as input the same set S of numbers, and a bin-capacity c. It heuristically packs numbers into bins such that the sum of numbers in each bin is at most C, aiming to use as few bins as possible. Multifit runs FFD multiple times, each time with a different capacity C, until it finds some C such that FFD with capacity C packs S into at most n bins. To find it, it uses binary search as follows.
Let L := max ( sum(S) / n, max(S) ). Note, with bin-capacity smaller than L, every packing must use more than n bins. Let U := max ( 2 sum(S) / n, max(S) ). Note, with bin-capacity at least U, FFD uses at most n bins. Proof: suppose by contradiction that some input si did not fit into any of the first n bins. Clearly this is possible only if i ≥ n+1. If si > C/2, then, since the inputs are ordered in descending order, the same inequality holds for all the first n+1 inputs in S. This means that sum(S) > (n+1)C/2 > n U/2, a contradiction to the definition of U. Otherwise, si ≤ C/2. So the sum of each of the first n bins is more than C/2. This again implies sum(S) > n C/2 > n U/2, contradiction. Iterate k times (where k is a precision parameter): Let C := (L+U)/2. Run FFD on S with capacity C. If FFD needs at most n bins, then decrease U by letting U := C. If FFD needs more than n bins, then increase L by letting L := C. Finally, run FFD with capacity U. It is guaranteed to use at most n bins. Return the resulting scheduling.
Performance Multifit is a constant-factor approximation algorithm. It always finds a partition in which the makespan is at most a constant factor larger than the optimal makespan. To find this constant, we must first analyze FFD. While the standard analysis of FFD considers approximation w.r.t. number of bins when the capacity is constant, here we need to analyze approximation w.r.t. capacity when the number of bins is constant. Formally, for every input size S and integer n, let OPT(S,n) be the smallest capacity such that S can be packed into n bins of this capacity. Note that OPT(S,n) is the value of the optimal solution to the original scheduling instance. Let rn be the smallest real number such that, for every input S, FFD with capacity rn⋅OPT(S,n) uses at most n bins.
Upper bounds Coffman, Garey and Johnson prove the following upper bounds on rn:
rn≤8/7≈1.14 for n = 2; rn≤15/13≈1.15 for n = 3; rn≤20/17≈1.176 for n = 4,5,6,7; rn≤122/100=1.22 for all n ≥ 8. During the MultiFit algorithm, the lower bound L is always a capacity for which it is impossible to pack S into n bins. Therefore, L<rn⋅OPT(S,n). Initially, the difference U−L is at most sum(S) / n, which is at most OPT(S,n). After the MultiFit algorithm runs for k iterations, the difference shrinks k times by half, so U−L≤(1/2)k⋅OPT(S,n). Therefore, U≤(rn+(1/2)k)⋅OPT(S,n). Therefore, the scheduling returned by MultiFit has makespan at most rn+(1/2)k times the optimal makespan. When k is sufficiently large, the approximation factor of MultiFit can be made arbitrarily close to rn, which is at most 1.22. Later papers performed a more detailed analysis of MultiFit, and proved that its approximation ratio is at most 6/5=1.2, and later, at most 13/11≈1.182. The original proof of this missed some cases; presented a complete and simpler proof. The 13/11 cannot be improved: see lower bound below.
Lower bounds For n=4: the following shows that rn≥20/17, which is tight. The inputs are 9,7,6,5,5, 4,4,4,4,4,4,4,4,4. They can be packed into 4 bins of capacity 17 as follows:
9, 4, 4 7, 6, 4 5, 4, 4, 4 5, 4, 4, 4 But if we run FFD with bin capacity smaller than 20, then the filled bins are:
9,7 [4 does not fit] 6,5,5 [4 does not fit] 4,4,4,4 [4 does not fit] 4,4,4,4 4 Note that the sum in each of the first 4 bins is 16, so we cannot put another 4 inside it. Therefore, 4 bins are not sufficient. For n=13: the following shows that rn≥13/11, which is tight. The inputs can be packed into 13 bins of capacity 66 as follows:
40,13,13 {8 times} 25,25,16 {3 times} 25,24,17 {2 times} But if we run FFD with bin capacity smaller than 66*13/11 = 78, then the filled bins are:
40,25 {8 times} 24, 24, 17 17, 16, 16, 16 13, 13, 13, 13, 13 {3 times} 13 Note that the sum in each of the first 13 bins is 65, so we cannot put another 13 inside it. Therefore, 13 bins are not sufficient.
Performance with uniform machines MultiFit can also be used in the more general setting called uniform-machines scheduling, where machines may have different processing speeds. When there are two uniform machines, the approximation factor is 6/2. When MultiFit is combined with the LPT algorithm, the ratio improves to 2+1/2.
Performance for maximizing the smallest sum A dual goal to minimizing the largest sum (makespan) is maximizing the smallest sum. Deuermeyer, Friesen and Langston claim that MultiFit does not have a good approximation factor for this problem:"In the solution of the makespan problem using MULTIFIT, it is easy to construct examples where one processor is never used. Such a solution is tolerable for the makespan problem, but is totally unacceptable for our problem [since the smallest sum is 0]. Modifications of MULTIFIT can be devised which would be more suitable for our problem, but we could find none which produces a better worst-case bound than that of LPT."
Proof idea
Minimal counterexamples The upper bounds on rn are proved by contradiction. For any integers p ≥ q, if rn>p/q, then there exists a (p/q)-counterexample, defined as an instance S and a number n of bins such that
… excerpt ends here. Continue reading the full article.