Dynamic Bin Packing (DBP)
- Dynamic Bin Packing (DBP) is a scheduling problem that allocates items with specific arrival and departure times to fixed-capacity bins in online or semi-online settings.
- It applies to various settings including 1D, vector, and geometric models, proving essential for cloud resource allocation, memory management, and storage optimization.
- Recent advances feature competitive online algorithms, effective data reduction techniques, and migration strategies that balance repacking costs with system performance.
Dynamic Bin Packing (DBP) defines a class of problems in which items arrive and depart over time and must be assigned to bins of fixed capacity in a manner that maintains feasibility throughout the process, typically with objectives such as minimizing bin usage, active bin time, or fragmentation. Unlike static bin packing, DBP inherently operates under online or semi-online constraints, requiring the maintenance of a valid packing as the set of items changes due to arrivals and departures. The domain encompasses classical 1D, vector, and geometric (2D/3D) settings, and is central to resource allocation in cloud systems, memory management, and storage. Recent research in DBP has advanced data reduction techniques, characterized tight competitive ratios for online algorithms, and revealed tradeoffs involving migration and repacking costs.
1. Formal Models and Core Definitions
The canonical DBP instance is parameterized by a sequence of items, each characterized by size and temporal information—arrival and departure . In the 1-dimensional case, packing is into unit-capacity bins such that, for all times , the sum of the sizes of active items in each bin does not exceed 1. The multi-dimensional generalization, Dynamic Vector Bin Packing (DVBP), assigns each request a size vector and each bin a capacity vector ; the packing must satisfy componentwise for every bin and every time (Bevern et al., 2022, Murhekar et al., 2023).
Objectives vary:
- Minimize number of bins used, subject to feasible assignments at all times.
- Minimize active bin time: sum over time of the number of occupied bins ("MinUsageTime" objective) (Murhekar et al., 2023, Mellou et al., 23 Aug 2024).
- Minimize fragmentation or memory makespan in geometric instantiations (e.g., 2D/3D for storage/memory allocation) (Lamprakos et al., 2023, Zhao et al., 2020).
DBP is parameterized by three critical quantities in the vector setting:
- : dimension of the resource.
- : number of distinct request types (unique combinations of size and time interval).
- : instance height, the maximum number of overlapping requests at any time.
2. Online and Fully-Dynamic Algorithmic Paradigms
The online nature of DBP has spurred the development of competitive algorithms with intricate tradeoffs. The “Any Fit” family—First Fit (FF), Next Fit (NF), Move-To-Front (MTF)—serves as the fundamental class in both 1D and vector forms:
- FF packs each new item into the first bin with sufficient available capacity; opens a new bin only if none exists.
- NF always tries to add to a single current bin; otherwise, closes and opens anew.
- MTF packs into the most recently used fitting bin, moving it to the front.
Competitive ratio (CR) analyses for the MinUsageTime-DVBP model yield tight upper and lower bounds as functions of duration variability and resource dimension :
- ; ; .
- No Any-Fit algorithm can achieve (Murhekar et al., 2023).
Table: Summary of Competitive Ratios for MinUsageTime-DVBP | Algorithm | Upper Bound | Lower Bound | |-----------|------------------------------|-----------------------| | MTF | | | | FF | | | | NF | | |
Experimental findings indicate MTF provides both strong worst-case guarantees and the best empirical performance under synthetic multi-resource job traces.
In 2D and 3D, DBP commonly appears in dynamic storage allocation and online packing under spatial and temporal constraints. Constrained DRL methods—CMDP formalisms with feasibility-mask prediction—now achieve user-level or super-human packing rates for online 3D-BPP, outperforming both prior heuristics and non-learning counterparts in space utilization and policy efficiency (Zhao et al., 2020).
3. Data Reduction, Kernelization, and Approximation
Due to parameterized and worst-case complexities, data reduction is critical. DVBP is NP-hard; even 2D static VBP resists constant-factor approximation. Notably:
- No polynomial kernel (parameterized by ) exists for the gap version of DVBP unless coNP NP/poly. This is proved via AND-composition reductions from static vector bin-packing with scaled weights (Bevern et al., 2022).
- Exact instance reduction: Grouping jobs by type and applying relabeling ("time compression") can reduce effective problem size from to as few as . The induced integer program (ILP) for types and bins is solvable in time using Lenstra–Kannan methods.
- (1+)-approximate data reduction: Deleting up to bins—where is the natural volume lower bound over all time and dimensions—and solving the reduced instance yields an overall -approximate solution. Greedy algorithms using priority functions (favoring small flavors and large spans) are effective heuristics for determining deletion candidates, leading to empirical instance shrinkage by factors of 10–50 with only a few percent overhead in bin count (Bevern et al., 2022).
4. Migration, Repacking, and Tradeoffs
Migration, or repacking, is a fundamental mechanism to adapt the packing as items depart or when improved solutions become possible. However, migration incurs costs (e.g., I/O, delays, or energy).
Three key results define the regimes:
- No migration ( items): CR is ; sublinear migration budgets do not improve over the migration-free online bounds. Any zero-migration algorithm has a lower bound of (Mellou et al., 23 Aug 2024).
- Linear migration ( items for constant ): CR improves smoothly to , achievable via the “Good/Bad” bin scheme, with matching lower bounds. Above migrations, constant CR (approximately $1.387$) is attainable by algorithms that mimic offline approximations (Mellou et al., 23 Aug 2024, Gupta et al., 2017).
- Migration with delays: In delay models where each migration causes a -unit delay in item service, the optimal competitive ratio is , with tight lower bounds (Mellou et al., 23 Aug 2024).
For the fully-dynamic model with bounded repacking:
- Optimal tradeoff: Asymptotic CR (Lambert function root) is achievable with amortized repacking ; general movement costs yield CR . Migration lower bounds are per update (Gupta et al., 2017, Berndt et al., 2014).
Fully-dynamic packing without bundled moves has been shown to match lower bounds with item moves per update, giving optimal tightness (Feldkord et al., 2017):
5. Dynamic Bin Packing in Systems and Cloud Applications
Dynamic bin packing underlies cloud scheduling, dynamic storage allocation, and memory management. In cloud infrastructure, the MinUsageTime-DVBP model abstracts online VM/job allocation under pay-as-you-go pricing. Here, Any-Fit algorithms (notably, MTF) have been shown to be both theoretically optimal (up to constant factors) and practically superior in average-case scenarios, motivating their adoption in real online resource allocators (Murhekar et al., 2023).
In memory allocation, dynamic 2D bin packing corresponds to minimizing makespan (maximum memory usage over time) and fragmentation in general-purpose allocators. Empirical results using real workload traces show that standard online allocators (e.g., glibc malloc) often compete within a few percent of the best known offline 2DBP algorithms in makespan, although 2DBP solvers can substantially improve page-local fragmentation in some cases—achieving up to lower real gaps (Lamprakos et al., 2023).
Practical algorithmic schemes for online/dynamic 3D-BPP (e.g., in industrial packing or logistics) now employ deep RL and sophisticated feasibility predictors to achieve robust performance under strict physical and timing constraints (Zhao et al., 2020).
6. Open Problems and Future Directions
Several open questions remain at the frontier:
- Polynomial-size kernelization for approximate DVBP with small remains elusive; all-known data reductions for small are super-polynomial in worst-case size (Bevern et al., 2022).
- Improved heuristics for greedy approximations in data reduction, particularly for streaming and online arrival models; current methods are effective empirically, but theoretical guarantees are limited.
- Integration of pattern-learning and duality-based pricing schemes under changing stochastic conditions, as suggested by recent intersections of data mining and OR duality frameworks in online bin packing (Zhang et al., 27 Aug 2024).
- Exploration of hybrid online-offline schemes for storage allocation, leveraging offline DBP during low-activity windows to defragment memory or storage.
This body of research delineates a rich set of approaches and highlights the interdependence of structural hardness, repacking tradeoffs, and new algorithmic mechanisms in realizing efficient and adaptive dynamic packing systems.