arXiv:2611.09267cs.DSNov 2026

Manuscript Offprint

arXiv:2611.09267

Load Balancing with Item Fragmentation and More Bins than Items: Linear-Time and Exact

Ben Bals, Tomáš Flouri, Kassian Kobert, Solon P. Pissis, Leen Stougie

Abstract

We study a fundamental load-balancing problem in which NN items of strictly positive integer sizes with total size WW must be assigned to BB bins, with items allowed to be divided into integer-size fragments across bins. Each bin must receive a load of either ⌊W/B⌋\lfloor W/B \rfloor or ⌈W/B⌉\lceil W/B \rceil, ensuring that the loads of any two bins differ by at most one unit. Under this constraint, the objective is to minimize the maximum number of distinct item fragments placed into any single bin. This problem is NP-hard and there exists an (OPT+1)(OPT + 1)-approximation algorithm that runs in O(Nlog⁡N+B)O(N \log N + B) time [Kobert et al., 2014]. The existing algorithm is employed by several widely used production codes for phylogenetic reconstruction.

Here, we focus on the case B≥NB \geq N, that is, bins are at least as numerous as items. This setting arises pervasively in modern parallel and distributed systems, as well as in iterative algorithms that rebalance their workload at every step. In this context, bins are machines or machine cores, and items represent computational tasks (jobs). Our central contribution is a remarkably simple O(N)O(N)-time algorithm that computes an optimal assignment in this setting; this assignment is encoded using O(N)O(N) space. In particular, we prove that an optimum always exists in which every bin receives at most two fragments and provide a characterization of when one fragment per bin suffices. Our result strictly improves the (OPT+1)(OPT + 1)-approximation of Kobert et al. in the many-bins setting and, together with it, yields a strongly polynomial-time (OPT+1)(OPT + 1)-approximation algorithm for the general setting, as it removes the dependency on the number BB of bins.

1 Introduction

Balancing work across processing units is a fundamental problem in parallel and distributed computing, from early multiprocessors [Gra69, Cyb89] to modern many-core systems [ST19, LSS22]. As processor core counts grow, efficient utilization becomes increasingly important: a system draws substantial power whether its cores are busy or idle [BH07], so unused cores waste capacity, whereas shorter runtimes reduce total energy use [WL08]. The problem is becoming more acute as datasets grow across disciplines, increasing the work to be balanced: from large-scale simulations in high-performance and scientific computing [KK98, BD97, VGR03], through web-scale queries and MapReduce jobs in data systems [DG08, GARK11, KTR12] and rising traffic in communication networks [KSV03, CMSM+15], to billion-parameter models shared across accelerators in machine learning [LAP+14, MHH+22]. In such settings, the workload is often divisible and should be distributed evenly, while each processing unit may incur an overhead for every distinct (potentially fragmented) work unit it handles, motivating us to minimize the number of distinct units.

This led us to study the following problem, which has been introduced and studied in [KFAS14]. Given NN items (jobs) of strictly positive integer sizes and total size WW, assign them to BB bins (processors), with items allowed to be divided into integer-size fragments across bins. The load between bins must be as balanced as possible, that is, a load of either ⌊W/B⌋\lfloor W/B \rfloor or ⌈W/B⌉\lceil W/B \rceil. Under this constraint, the objective is to minimize the maximum number of distinct item fragments placed into any single bin.

A concrete application of balancing divisible load while limiting per-processor fragmentation arises in statistical phylogenomics [KYT20]. The input is a multiple sequence alignment, which can be viewed as a matrix: its rows correspond to taxa and its columns to homologous positions in their molecular sequences. Each column is called an alignment site. The alignment sites are typically grouped into partitions, with the sites in each partition analyzed under the same evolutionary model. For a fixed candidate phylogenetic tree, likelihood calculations at different sites are mutually independent, and their repeated evaluation dominates the cost of maximum-likelihood and Bayesian inference [Fel81]. Alignment sites can therefore be distributed across processors. Under the standard uniform-site cost model, assigning approximately the same number of sites to every processor balances the arithmetic workload. However, a processor also incurs partition-specific overhead for every partition from which it receives at least one site. The goal is thus to balance the number of sites while minimizing the maximum number of distinct partitions handled by any processor. Kobert et al. [KFAS14] formalized this task as the divisible load balance problem, which we will call here Load Balancing with Item Fragmentation (LBIF). In this formulation, the items are the partitions, the size of an item is its number of sites, and the bins are the processors. A partition may be divided among several processors, and each processor receives either ⌊W/B⌋\lfloor W/B \rfloor or ⌈W/B⌉\lceil W/B \rceil sites, where WW is the total number of sites and BB is the number of processors. The objective is to minimize the maximum number of partitions assigned to any one processor. Kobert et al. proved the problem to be NP-hard and gave an (OPT+1)(OPT + 1)-approximation running in O(Nlog⁡N+B)O(N \log N + B) time for NN partitions (items). Their algorithm is implemented in widely used phylogenetic software, including RAxML-NG [KDF+19] and ExaBayes [AKS14]. A related, data-dependent variant arises from the site-repeats optimization [KSF17]. For a node of the phylogenetic tree, a site's subcolumn is its alignment column restricted to the taxa in the subtree rooted at that node. If two sites in the same partition have identical subcolumns, the intermediate likelihood at the root of that subtree is the same for both and needs to be computed only once. Consequently, workload is not determined by site count alone, and gives another variation of the load-balancing problem [SKFS16, MFS17].

In this paper, we study the case in which there are at least as many bins as items. In practice, bins may far outnumber items: a modern server may provide hundreds of cores, and a cluster many more, while potentially only a handful of large, divisible jobs are active at a time. The algorithm of Kobert et al. applies in this regime, but remains an approximation: it returns an assignment of value at most OPT+1OPT + 1 and does not necessarily attain OPT. Moreover, its O(Nlog⁡N+B)O(N \log N + B) running time depends on the number BB of bins. Since BB may be arbitrarily large relative to NN, this bound may not be polynomial in NN. In response, we show that, for every B≥NB \geq N, an optimal assignment in which every bin receives at most two fragments always exists. Furthermore, we construct such an assignment in O(N)O(N) time using O(N)O(N) space, and give an O(N)O(N)-time arithmetic test that determines whether the optimum is one or two. Combined with the algorithm of Kobert et al. for B<NB < N, our result yields an (OPT+1)(OPT + 1)-approximation for every BB that runs in O(Nlog⁡N)O(N \log N) time and is therefore strongly polynomial. Additionally, our algorithm is so simple that it is easy to implement, making it amenable to practical adoption (e.g., in the existing software [AKS14, KDF+19]). The O(N)O(N) running time is also beneficial when assignments must be recomputed frequently. This occurs, for example, in fault-tolerant likelihood evaluation, where data are redistributed whenever processors fail or become available [HKH⁺21]. Another application arises in Metropolis-coupled MCMC for Bayesian phylogenetic inference, which runs several interacting chains at different temperatures in parallel [ADHR04]. When the available cores outnumber the chains, the likelihood computation within each chain can be divided across independent alignment sites. Treating chains as divisible items and cores as bins yields a many-bins instance in which per-step work is balanced while the maximum number of chains handled by any core is minimized.

Related work. Apart from the above-mentioned work motivating our study, we mention here literature on multiprocessor scheduling and bin packing. Load balancing is the most common target in classical multiprocessor scheduling, often under the name of makespan minimization. Indeed, the first theoretical results date back to the sixties [Gra66, Gra69]. The general problem on identical machines is NP-hard [Kar72]. However, preemptive jobs make the problem easy [McN59], and splittable (divisible) jobs, dividing jobs across identical machines without further constraints makes the problem trivial. Our problem is complicated by the objective of minimizing the maximum number of job fragments.

Other works on splittable (divisible) scheduling [KSV03, Ev06, CMSM⁺15, DJ19] divide jobs into fragments across identical or unrelated machines to minimize the makespan, but with the number of fragments bounded [KSV03, Ev06] or penalized, for instance, through (batch) setup times [CMSM⁺15, DJ19]. As its name suggests, there is also a relation to bin packing with item fragmentation. In early work on this problem [MR01, STY08, SY07], as well as in later publications [BGW19, CC14, Eki21], fragmentation comes at a price: increasing cost or size.

None of these related results are applicable in our setting, which fixes an exact load for every bin and minimizes the maximum number of fragments per bin, rather than the number of bins or the makespan.

References (34)