Manuscript Offprint
arXiv:2611.08792Online Bin Packing with Dispatch Deadlines
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We study a generalization of online bin packing by introducing dispatch deadlines. Items arrive over time in an online fashion. Each item has an arrival time, a size in , and a deadline, all of which are revealed only when the item arrives. The algorithm must immediately and irrevocably assign the item to a unit-capacity bin that has not yet been dispatched. Each bin must be dispatched no later than the earliest deadline of the items assigned to it, and once it is dispatched, it cannot be used for future items. The goal is to minimize the number of bins used.
Applications arise naturally in logistics. Additionally, the offline version of this problem has appeared under several names, including the clique partition problem in weighted interval graphs and the BinSchedule problem. This problem is also a special case of online bin packing with conflicts and is closely related to online bin packing models with delay costs.
We study the competitive ratios of several classical online bin packing algorithms when applied to this problem, and show that a similar hierarchy of competitive ratios carries over. Our main technical results are that the competitive ratio of FIRST-FIT is exactly , and that no deterministic online algorithm has a competitive ratio less than , showing that FIRST-FIT is quite close to best possible. In addition, NEXT-FIT and WORST-FIT have competitive ratio exactly 3, and every algorithm in the ANY-FIT class has competitive ratio between and 3.
2012 ACM Subject Classification Theory of computation Online algorithms
Keywords and phrases Bin packing, scheduling, competitive analysis
Funding Wing-Kai Hon: Supported by NSTC, Taiwan, under Grant 113-2221-E-007-139-MY3.
Kazuo Iwama: Supported by NSTC, Taiwan, under Grants 114-2223-E-007-016 and NSTC 115-2223-E-007-012.
Acknowledgements We thank the anonymous reviewers for their helpful comments on improving the presentation and for pointing us to additional related work. ChatGPT was used to assist with literature searches and with improving the authors' existing text.
1 Introduction
Online bin packing is one of the central problems in online algorithms. In this problem, items arrive one by one, each with a size in . Upon arrival, an item must be immediately and irrevocably assigned to a unit-capacity bin, and the goal is to minimize the number of bins used. Finding optimal algorithms for this problem has been a long-standing line of work [5, 3, 4], and classical algorithms such as FIRST-FIT and BEST-FIT have been well-studied since the early work on bin packing [13, 15, 14].
Classical online bin packing has no notion of deadlines: once a bin is opened, it remains available forever. To add deadlines, at least two different approaches have appeared in the
Online Bin Packing with Dispatch Deadlines
literature. One is the dynamic bin packing problem, where items depart and are removed from their bins at their deadlines, while the bins remain available for future items [16, 9, 8, 20]. The other is the bin dispatch model: when an item's deadline is reached, the entire bin containing the item, which one may think of as a truck, must be dispatched and cannot be used for future items. This feature creates a tradeoff. Suppose that an item , with arrival time and deadline , is relatively tight, meaning that is relatively small. Assigning to an existing bin may save a bin now, but it may also force to be dispatched earlier, before later items that could have been packed into arrive.
While there has been considerable work on this model [6] and its equivalent formulation [17, 10, 18], all existing work studies the offline version. However, the tradeoff described above is also, and arguably even more, interesting in the online setting, where each packing decision must be made without knowing future items. In this paper, we study this online setting, which, to the best of our knowledge, has not appeared in the literature. We call this problem Online Bin Packing with Dispatch Deadlines (OBP-DD). An input is a finite sequence of items, where each item is represented as a tuple . Here, is the arrival time, is the size, and is the deadline, with . For convenience, we write , , and . The input is revealed in an online fashion. When an item arrives, its arrival time, size, and deadline are revealed, and the algorithm must immediately and irrevocably assign it to a unit-capacity bin that is not yet dispatched. That is, for every bin , we require and for every . The goal is to minimize the number of bins used.
The offline version has appeared under several names. If all items are known in advance, each item can be viewed as an interval with weight . A bin then corresponds to a set of intervals with a common intersection and total weight at most 1. Thus, the bin packing problem is equivalent to the clique partition problem in weighted interval graphs [17, 10, 18], where the goal is to partition the weighted intervals into the minimum number of bounded-weight cliques. This problem is strongly NP-hard and cannot be approximated within a factor of in polynomial time for any unless [17, 10]. A 2-approximation algorithm for general weights and an exact algorithm for the identical-weight case were later given in [18]. The same offline problem also appears as BinSchedule, where items have weights, arrival times, and deadlines; Berman et al. [6] gave a 3-approximation algorithm in general and a 3/2-approximation algorithm when the difference between the deadline and the arrival time is the same for all items.
As for the online version, note that OBP-DD is equivalent to classical online bin packing if all deadlines are sufficiently large. Furthermore, OBP-DD is a special case of online bin packing with conflicts. In this problem, a conflict graph specifies which pairs of items cannot share a bin, and each item reveals its size and its conflict edges to previous items upon arrival. Epstein and Levin [12] studied the problem for interval conflict graphs, giving a 4.7-competitive algorithm and a lower bound of for any online algorithm. In contrast, OBP-DD corresponds to the special case in which two items conflict exactly when their intervals are disjoint (i.e., the conflict graph is co-interval), and the items arrive in the order of left endpoints.
Closely related to deadline models are delay models. In the online bin packing with delay and holding costs problem [1], each item has a nondecreasing continuous delay-cost function , where is the time elapsed from the arrival of until its bin is released; open bins may additionally incur holding costs. If discontinuous delay-cost functions taking values in the extended reals are allowed, then OBP-DD is equivalent to the special case with no holding costs and for and otherwise. Another delay model is the bin packing with delays problem [2, 11], where the packing of an item may be delayed, incurring a nondecreasing continuous delay cost until the item is packed; whenever a set of items is packed into a bin, that bin is closed and cannot be used for future items. Similarly, deadlines can be represented using the same delay-cost function as above; however, since the packing of an item may be deferred, this is not equivalent to OBP-DD.
Real-world applications of OBP-DD arise in logistics, in particular in cross-docking. In traditional logistics, storage and order picking are often the most costly warehouse operations. Cross-docking reduces these costs by consolidating freight from different origins into outbound vehicles with minimal handling and little or no storage between unloading and loading [19]. In our abstraction, items are pieces of freight, bins are outbound trucks or containers, item sizes are capacity requirements, and deadlines are latest departure times.
Our Results. In this paper, we study the following natural question: how robust are classical online bin packing algorithms in the presence of dispatch deadlines? We address this question by directly applying these algorithms to OBP-DD and analyzing their performance. Several classical algorithms are considered: NEXT-FIT, FIRST-FIT, WORST-FIT, and the ANY-FIT class, which includes FIRST-FIT and WORST-FIT but not NEXT-FIT. In the classical setting, the following asymptotic competitive ratios are well known [13, 15, 14]: NEXT-FIT has ratio 2; every ANY-FIT algorithm has ratio at least 1.7 and at most 2; the lower bound 1.7 is matched by FIRST-FIT, while the upper bound 2 is matched by WORST-FIT. We extend these algorithms to OBP-DD in the most direct way. The packing rule is unchanged; the only difference is that bins are no longer available once they are dispatched. Thus, when an item arrives, the algorithm applies its usual rule only to the bins that are still open, and, unless the algorithm explicitly closes a bin earlier, each bin is kept open until it is forced to be dispatched by a deadline. Our results show that the same hierarchy of competitive ratios carries over from classical online bin packing to OBP-DD, but with larger ratios.
In Section 3, we first present rather straightforward results, which also illustrate fundamental differences between classical online bin packing and OBP-DD. We show that NEXT-FIT has competitive ratio exactly 3 (Theorem 1), every algorithm in the ANY-FIT class has competitive ratio at least 16/7 and at most 3 (Theorem 2), and WORST-FIT has competitive ratio exactly 3 (Theorem 3). The result for WORST-FIT also shows that the upper bound of 3 for the ANY-FIT class is tight. In Section 4, we show that FIRST-FIT has competitive ratio exactly 16/7 (Theorem 4), which implies that the lower bound of 16/7 for the ANY-FIT class is tight. In particular, FIRST-FIT has the best possible worst-case performance among all ANY-FIT algorithms. This implies that BEST-FIT, another classical online bin packing algorithm often compared with FIRST-FIT, performs no better than FIRST-FIT in the worst case in OBP-DD, since BEST-FIT is in the ANY-FIT class.
The upper bound for FIRST-FIT is our main technical result. Its proof is based on an input-reduction method. One challenge here is that FIRST-FIT does not use deadline values when deciding where to pack an item. In classical bin packing, the bins opened by FIRST-FIT remain available forever, so one can deduce bounds on the cumulative sizes of bins in their opening order; this is the basis of the standard area arguments used in bin packing analysis. In OBP-DD, however, bins may be dispatched and later bins may be opened in a highly interleaved way. This makes it difficult to deduce bounds on the cumulative sizes over a sequence of FIRST-FIT bins. To handle this, we give an input-reduction algorithm: given any input, it constructs another input on which FIRST-FIT uses the same number of bins, while the optimal offline solution uses no more bins, and the bins opened by FIRST-FIT are dispatched according to a more regular pattern. It then suffices to prove the upper bound
Online Bin Packing with Dispatch Deadlines
based on inputs with this regular pattern instead.
Note that FIRST-FIT achieves competitive ratio 16/7 without using the deadline information at all, which one might expect to severely lower the power of the algorithm. It turns out, however, that this is not the case, as 16/7 ≈ 2.28571 is quite close to the best possible ratio for any deterministic online algorithm: in Section 5, we show that no deterministic online algorithm can attain a competitive ratio less than 11/5 = 2.2 (Theorem 5). The trick is that our adversary can disrupt the online algorithm's decision-making ability: when a new item arrives, the online algorithm cannot tell whether the item's deadline is "early" or "late". This lower bound also separates OBP-DD from classical online bin packing, for which a 5/3-competitive algorithm is known [5].
We say that a bin is open from the time it is opened until the time it is dispatched. For consistency with this terminology, we use the term close instead of dispatch from now on. The two terms have the same meaning.
Multiple items can have the same arrival time or deadline. Without loss of generality, we use the following convention, since it cannot increase the cost. If several items have the same arrival time, they are processed one by one in increasing order of their indices. If arrivals and deadlines occur at the same time, arrivals are processed first, and then bins with an item whose earliest deadline is that time are closed.
The cost of an algorithm on an input is the cost of the packing produced by the algorithm on . We evaluate the performance of online algorithms via standard competitive analysis. For an input , let denote the cost of an online algorithm ALG on , and denote the cost of an optimal offline algorithm OPT on . The competitive ratio of ALG is defined as .
Another common performance measure is the asymptotic competitive ratio, defined as . We remark that all competitive-ratio bounds in this paper also hold for the asymptotic competitive ratio. This is because all of our upper bounds hold without an additive term, and all of our lower bounds are constructed via sequences of inputs such that . For NEXT-FIT, WORST-FIT, and FIRST-FIT, the equivalence of the two measures can also be shown directly by a simple input-repetition argument; see Appendix A.
Two Simple Bounds on OPT. Suppose is a packing of an input . Then, let denote the total size of all items in a bin , i.e., , and the total size of all items in , i.e., . Since each bin has capacity one, we obtain the following bound.
► Lemma 1. If is a packing of an input , then .
Two items and are said to be disjoint if (i.e., or ). Notice that two disjoint items can never be packed in the same bin. This gives the following bound.
► Lemma 2. If there are pairwise disjoint items in an input , then .
Algorithms. We now define the classical online bin packing algorithms considered in this paper in the setting of OBP-DD. Unless an algorithm explicitly closes a bin earlier, a bin is kept open until the earliest deadline among its items is reached. Among the algorithms considered below, only NEXT-FIT explicitly closes a bin early. NEXT-FIT (NF), which uses space, maintains at most one open bin at any time; when an item arrives, NF packs into the open bin if one exists and fits in it; otherwise, NF closes the open bin if one exists and opens a new bin for . ANY-FIT () is the class of online algorithms that never opens a new bin for an arriving item if fits in some currently open bin. WORST-FIT (WF) packs an arriving item into a currently open bin with largest remaining capacity among those in which fits; if no such bin exists, WF opens a new bin for . FIRST-FIT (FF) scans the currently open bins in the order in which they were opened, and packs an arriving item into the first bin in which fits; if no such bin exists, FF opens a new bin for . Thus, and , but .
3 Next-Fit, Any-Fit, and Worst-Fit
3.1 Next-Fit
► Theorem 1. The competitive ratio of NEXT-FIT is exactly 3.
Proof. We first show the lower bound. Let be a large integer, let , and let . Consider the input
where for , and . Also, for , . At time , for each , NF packs and together in one bin; if , it then opens a new bin for , since . These bins are closed at time . Then, for each time , NF opens one bin for , which is closed immediately at time . Thus, . On the other hand, OPT can pack all items together in one bin at time . For each time , OPT can pack , and together in one bin. Thus, , resulting in a lower bound of 3 for the competitive ratio of NF as .
We next show the upper bound. Consider an input . Let be the NF packing of , indexed by the order in which they are opened. We call an urgent bin if or . Let be the total number of urgent bins. Consider an urgent bin with , and let be the first item packed into . Then must have been closed before arrived. Indeed, if were still open when arrived, then NF would have packed into , since . Thus, contains an item whose deadline is before . Therefore, each urgent bin can be associated with an item such that these associated items are pairwise disjoint. By Lemma 2, . On the other hand, for every non-urgent bin , we have and . There are non-urgent bins. Summing this inequality over all non-urgent bins, each bin size appears in at most two terms, and hence . By Lemma 1, . Combining the two bounds, we obtain .
The lower bound input above also illustrates the difference between classical online bin packing and OBP-DD. The last items play the role of a “garbage collection” step: they are small items that OPT can use to fill the remaining space next to pairs of -items, but that NF is forced to pack separately because its earlier bins have already been
Online Bin Packing with Dispatch Deadlines

Figure 1 ALG and OPT packings for the lower-bound construction. Item sizes are not drawn to scale. Each bin is closed at the nearest dashed line to its right. The circled items are the items whose deadlines cause the corresponding bins to be closed at that time. At each time , each of the first three ALG bins has size , while the fourth has size ; at each time , the ALG bin has size . In contrast, all OPT bins are full.
closed. In the classical setting, equivalently when all items have deadline , the last NF bin would remain open and would have enough space to contain all items . Thus, the same input would make NF use only bins in the classical setting, rather than .
3.2 The Any-Fit Class
► Theorem 2. The competitive ratio of any algorithm in the ANY-FIT class is at least 16/7 and at most 3.
Proof. Let . We first show the lower bound. Let be a large integer divisible by 3, let , and let . Consider the input
where for , , , , , , and . Also, for , . By the ANY-FIT rule and the choice of item sizes, for each time , , ALG packs items in one bin, in one bin, in one bin, and in one bin; these four bins are closed at time . Then, for each time , , ALG opens one bin for , which is closed immediately at time . Thus, . On the other hand, for each time , , OPT can pack in one bin. For each time , , OPT can pack in one bin. For each time , , OPT can pack in one bin. Finally, OPT can pack in one bin. Thus, , resulting in a lower bound of 16/7 for the competitive ratio of ALG as . The two packings are illustrated in Figure 1.
We next show the upper bound. Consider an input . Let and be the numbers of bins with and , respectively, in the ALG packing of . By the rule, no two of these bins can be open at the same time; otherwise, the first item of the later-opened bin would fit into the earlier one. Thus, each of these bins can be associated with an item (the item whose deadline forces it to close) such that these associated items are pairwise disjoint. By Lemma 2, . On the other hand, by Lemma 1, we have . Combining the two bounds, we obtain . ◄
For completeness, we remark that the upper bound could also be proved by combining Theorem 1 with the stronger property that for every input and . This property is well-known in classical online bin packing [7], and the proof carries over almost identically to OBP-DD, with the additional case that an NF bin may have been closed by a deadline. We give the proof in Appendix B.
3.3 Worst-Fit
► Theorem 3. The competitive ratio of WORST-FIT is exactly 3.
Proof. Since , by Theorem 2, the competitive ratio of WF is at most 3. Notice that the same lower bound input from Theorem 1 applies to WF as well (WF produces the exact same packing as NF for the input). Thus, the competitive ratio of WF is at least 3.
4 First-Fit
► Theorem 4. The competitive ratio of FIRST-FIT is exactly 16/7.
By Theorem 2, the competitive ratio of FF is at least 16/7. It remains to prove that the competitive ratio of FF is at most 16/7, which we do in the rest of this section. At a high level, our proof consists of two steps. First, we give an algorithm that, given any input , constructs another input in a special form such that . Second, we show that for any input of that special form. Let us first define the special form as follows. Notice that the second property of this form implies that all bins opened at time are closed at as well.
► Definition 3. We say that an input is in canonical form if there exist times , for some , such that the FF packing of satisfies the following properties.
-
At least one bin is opened at time , for every , and no bin is opened at any other time.
-
For every , every bin opened at time contains exactly one item with deadline , called its trigger item, and all other items in the bin have deadline .
-
For every , the trigger items of all bins opened at time have total size at most 1.
We now give the reduction algorithm; see Algorithm 1. Informally, the main idea of the reduction is to take “snapshots” of the FF packing. Notice that at any time , if we select any subsequence of the currently open FF bins and form a new input consisting only of the items currently in these bins, in their original arrival order, then running FF from scratch on this new input produces exactly these bins. Thus, to obtain a canonical input, we can partition the FF bins into groups, take a snapshot of each group at a separate time, and give one item in each bin of the snapshot an early deadline so that the whole group closes before the next snapshot. Two questions remain: how to choose the trigger items so that their total size is at most 1, and how to make sure that the new input, consisting of these snapshotted items, is no harder for OPT. The key is to take snapshots based on OPT’s packing. Whenever OPT closes a bin, we take a snapshot of the not-yet-snapshotted FF bins that contain items from this OPT bin, and use one of these items in each FF bin as its trigger item. Since all these trigger items were packed in one OPT bin, they have total size at most 1. Moreover, the original OPT packing gives a feasible packing of the new input.
The assumption on Line 1 is without loss of generality, by an event-ordering argument; see Appendix C. We now prove the correctness of Algorithm 1.
Online Bin Packing with Dispatch Deadlines
Algorithm 1 Reduction to canonical form
Require: An input Ensure: An input in canonical form 1: Assume that all arrival times and deadlines in are distinct. 2: Run FF on , and fix an OPT packing of , indexed by increasing order of their closing times. 3: Let be the closing time of , for , and let . 4: Mark all bins in the FF packing of as unmarked, and set . 5: for do 6: List the items in as . 7: for do 8: Let be the bin containing in the FF packing of . 9: if is unmarked then 10: Mark . 11: Remove all items in whose arrival times are after from . 12: Change the arrival times of the remaining items in to in . 13: Change the deadline of to in . 14: Change the deadlines of the other remaining items in to in . 15: end if 16: end for 17: end for 18: Sort the items in by their new arrival times, breaking ties by their original arrival order in . 19: return the resulting input .
► Lemma 4. For every input , Algorithm 1 returns an input in canonical form such that and .
Proof. Let us continue to use the notation in Algorithm 1. For convenience, discard every index such that no bin in the FF packing of is marked during the processing of on the -th iteration of the for-loop on Line 5. Let be the number of remaining indices, and relabel the remaining pairs , preserving their original order, as . For every item of that is not removed from , let denote the corresponding item in . Thus, . For a set of items of , let .
After the execution of Algorithm 1, every bin in the FF packing of is marked exactly once. This is because every such bin contains an item belonging to some , so it is eventually marked; moreover, once a bin is marked, it is never marked again. Hence, every item in is either removed from , or changed to have arrival time and deadline either or , for some . Therefore, all items in arrive at one of the times , and so in the FF packing of , no bin is opened at any other time.
For each , let be the set of bins in the FF packing of that are first marked during the processing of . By the relabeling above, is nonempty for every . Write , where the bins are ordered by their opening order in the FF packing of . For each , define . These are exactly the items of that remain in after is marked. Thus, the items arriving at time in are exactly the items in . Moreover, by the final sorting step of Algorithm 1, their arrival order at is the same as the arrival order of their corresponding items in .
Note that for every and , the items removed from are exactly the items that arrive after in . Thus, when comparing the packing of the items in at time in with the packing of their corresponding items in , the removed items were not present yet in , and so they do not affect any “fit” or “non-fit” decision of FF.
▷ Claim 5. Let . In the FF packing of , if all bins opened before time are closed before time , then the bins opened at time are exactly .
Proof. For convenience, in this claim, an FF[]-bin means a bin in the FF packing of . We prove this claim by induction over the items arriving at time . For the base case, consider the first item arriving at time (i.e., the item corresponding to the bin-opening item of ). By the assumption of the claim, all bins opened before time are already closed, so FF opens a new bin for this item. We call this bin the FF[]-bin corresponding to .
For the inductive step, consider an item , for some , and suppose that every earlier item has already been packed into the FF[]-bin corresponding to , for every . We want to show that is also packed into the FF[]-bin corresponding to .
First, consider any . The first item of belongs to and arrives before in , so by the induction hypothesis, the FF[]-bin corresponding to has already been opened in . Since is first marked during the processing of , no item in has deadline before ; otherwise, the OPT bin containing that item would close before , and would have been marked earlier. Thus, is still open when arrives in . Since FF packs into in , the item does not fit into . Moreover, by the induction hypothesis, when arrives in , the FF[]-bin corresponding to contains exactly the items such that and arrives before in . Hence this bin has the same total size as had when arrived in . Therefore, does not fit into the FF[]-bin corresponding to in .
Now consider . If some earlier item of has already arrived in , then by the induction hypothesis, these earlier items have been packed into the FF[]-bin corresponding to . Moreover, this bin contains exactly the items such that and arrives before in . Hence it has the same total size as had when arrived in , so fits in this bin. Since does not fit into any earlier bin, FF packs into this bin.
It remains to consider the case where no earlier item of has arrived in yet. This means is the first item of to arrive, and so is the bin-opening item of . Therefore, no FF[]-bin corresponding to with has been opened yet when arrives. Since does not fit into any earlier bin, FF opens a new bin (i.e., the FF[]-bin corresponding to ) for .
By induction over the items arriving at time , the bins opened at time are exactly .
▷ Claim 6. In the FF packing of , for every , the bins opened at time are exactly .
Proof. By Claim 5, it suffices to show that, for every , all bins opened before time are closed before time . We prove this statement by induction on . For , no bin is opened before time , and so the statement is vacuous. For the inductive step, suppose that all bins opened before time are closed before time . By Claim 5, the bins opened at time are exactly . For each , contains the item that caused to be marked, and this item has deadline in . Hence, every bin opened at time is closed at time . Therefore, if , all bins opened before time are closed before time , and so the statement holds for .
Online Bin Packing with Dispatch Deadlines
Now, consider the FF packing of . By Claim 6, for every , the bins opened at time are exactly . Since is nonempty for every , at least one bin is opened at each time . We have already shown that no bin is opened at any other time. Moreover, for each , exactly one item in has deadline , namely the item that caused to be marked, and all other items in have deadline . Finally, all items with deadline at time were packed in , so their total size is at most 1. Therefore, the three properties in Definition 3 are satisfied, and so is in canonical form.
Recall that every bin in the FF packing of is marked exactly once. Therefore, the sets partition the bins in the FF packing of , and hence . On the other hand, by Claim 6, the FF packing of opens exactly bins at each time , and no bin is opened at any other time. Thus, .
Finally, we show that the original OPT packing of is a packing of , except that some items are removed from the bins. In this paragraph, we use the original indexing from Algorithm 1. Consider a bin , for some , and an item . If is removed in , then we are done, so suppose not. If is first marked during the processing of , then is changed to and is changed to either or in . Since , packing in the same OPT bin is still valid in . If is already marked during the processing of , for some , then is changed to and is changed to either or . Notice that the former is impossible since is not in , and so is changed to . Since , packing in the same OPT bin is still valid in . Thus, .
By the above lemma, to prove for every input , it is sufficient to prove it for those inputs that are in canonical form. Before we proceed, we state a simple algebraic property that will be used repeatedly.
▶ Property 7. Let with , , , and . Then .
We now prove the 16/7 upper bound. Let be an input in canonical form with times . For every , let be the number of FF bins opened and closed at time , and let be the total size of all items in these bins. Fix a lazy OPT packing of , where a lazy packing means every bin is kept open until the deadline of some item in the bin forces OPT to close the bin. Thus, OPT bins are closed only at times and possibly . For every , let be the number of OPT bins closed at time , and let be the total size of all items in these bins. The following lemma shows that it suffices to work on a single time .
▶ Lemma 8. If for every , , then .
Proof. Let be the number of OPT bins closed at time . Notice that by Lemma 1, since the remaining items not packed in the first OPT bins have total size . Thus, we have
where the last inequality follows from Property 7.
By the assumption of the lemma, for every , . Summing over all indices gives . Therefore .
We now show that the sufficient condition in the above lemma indeed holds.
▶ Lemma 9. For every , .
Proof. For convenience, let us redefine the notation to focus on a single time : let , , , and . Let be the FF bins opened and closed at time , indexed by the order in which they are opened. Notice that we have and . Hence, if or , then the ratio is at most 1 already. Let us assume and . We derive two bounds for the ratio.
▷ Claim 10. For every , .
Proof. We first show that . Notice that for every , the bin contains at least two items. This is because otherwise contains only its trigger item, so the trigger items of and have total size greater than 1, a contradiction to Definition 3. Furthermore, among , at most one bin has size less than 2/3. This is because if is the first such bin, then every item in a later bin has size greater than 1/3, and so every non-last later bin has size greater than 2/3. Let be such a bin if it exists, and otherwise choose any bin among . Since is opened after , we have . Hence .
Therefore, we have . By Property 7,
▷ Claim 11. For every , .
Proof. For , let . Then, every item in has size greater than . On the other hand, since the trigger items fit in one bin by Definition 3, . Notice that , and for every . Thus,
Therefore, we have . By Property 7,
Claim 10 gives the desired bound for , and Claim 11 gives it for .
In summary, Lemma 4 shows that for every input , there exists an input in canonical form such that ; Lemma 8 and Lemma 9 show that for every input in canonical form, . We have thus proven that the competitive ratio of FF is at most 16/7.
Online Bin Packing with Dispatch Deadlines
Algorithm 2 Adversary for the 11/5 general lower bound.
Require: A deterministic online algorithm ALG.
1: Let be a large power of two and .
2: Initialize , , and to be any real numbers such that .
3: for do
4: Let and .
5: for do
6: Release items for iteration according to the procedure described below.
7: .
8: .
9: end for
10: end for
11: Let and .
12: for do
13: Release an item .
14: end for
5 General Lower Bound
In this section, we show a lower bound of 11/5 for the competitive ratio of any deterministic online algorithm. Let us first give the intuition behind our adversary. Fix any deterministic online algorithm ALG. Similar to the lower bound, the adversary tries to force ALG to open bins in groups. In each group, every bin opened by ALG contains one item with an early deadline and other items with late deadlines. The early-deadline items force the bins of ALG to close, while the late-deadline items can later be garbage-collected and packed more efficiently by OPT. The difficulty is that ALG may try to pack the early-deadline items together. To prevent this, the adversary does not decide in advance whether a newly released item is early or late. Instead, it maintains three variables . Every new item arrives at time and is given a deadline in . If ALG opens a new bin for this item, the adversary declares it to be an early item by updating to its deadline. If ALG packs the item into an old bin, the adversary declares it to be a late item by updating to its deadline. Thus, after each update, every bin-opening item has deadline no later than the current , while every non-bin-opening item has deadline no earlier than the current . Since the updates only increase or decrease , and always preserve , these two properties hold throughout the construction. Once the adversary has forced the desired number of bins, it waits until time , so all bins are closed. It then chooses new values of and such that old , and starts the next group.
Let us now give the algorithm for the adversary; see Algorithm 2.
Item-release procedure. Whenever we say that the adversary releases an item of size by the update rule, we mean the following. Let . Release the item . If ALG opens a new bin for , then update ; otherwise, update .
At the beginning of iteration , no ALG bin is open at time . The adversary releases items by the update rule, with item sizes chosen according to the following decision tree. First release two items and of size . The item must open a new bin. If opens a new bin, release an item of size . If opens a new bin, the procedure ends. Otherwise, release an item of size . If opens a new bin, the procedure ends. Otherwise, release an item of size , which must open a new bin, and the procedure ends. If instead is packed with , release an item of size . If is packed with and , release two items and of size as follows. The item must open a new bin. If opens a new bin, the procedure ends. Otherwise, release an item of size , which must open a new bin, and the procedure ends. If opens a new bin, release an item of size . If opens a new bin, the procedure ends. Otherwise, release an item of size , which must open a new bin, and the procedure ends. The nine possible ways in which ALG can pack the above items are summarized below, where the bins are listed in their opening order:
| case | ALG packing | bin-opening items | remaining items |
|---|---|---|---|
| 1 | – | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 |
For convenience, let us use the notation -item and -item to denote items with size exactly and at most , respectively. The following lemma follows directly from the update rule and the nine cases listed above.
► Lemma 12. For every iteration , the procedure described above releases items satisfying the following properties, where and denote their values at the end of the procedure.
-
All these items arrive at , and ALG opens three bins for them.
-
The three bin-opening items have deadlines no later than and total size at most 1.
-
The remaining items consist of at most one -item, at most one -item, and at most one -item. All such items have deadline no earlier than .
► Theorem 5. No deterministic online algorithm has a competitive ratio less than 11/5.
Proof. Let ALG be any deterministic online algorithm, and consider the input generated by Algorithm 2. By Lemma 12, after each iteration , ALG opens three bins and all three bins are closed before the next iteration starts. Therefore all the iterations contribute bins to ALG. Moreover, since the final items are pairwise disjoint, ALG opens one bin for each of them. Thus, .
We now describe an OPT packing. For each iteration , pack the three bin-opening items of the iteration in one bin. These bins contribute bins. It remains to pack the remaining items from the iterations, together with the final items . For the items from iteration , there are at most ()-items. Pack three such items with one final item in one bin. This uses at most bins. Next, for each , pack two ()-items from iteration , one ()-item from iteration , and one final item in one bin. Since , each such bin has total size at most 1. This uses at most bins for iteration , and hence at most bins in total. The remaining ()-item from the last iteration, if it exists, is packed in one additional bin. Finally, for each iteration , there are at most remaining -items. Their total size is at most
Online Bin Packing with Dispatch Deadlines
14
, and so all these items fit in one additional bin. Therefore, .
Thus, and , resulting in a lower bound of for the competitive ratio of as .
6 Further Directions
The most immediate question is to narrow the gap between 11/5 and 16/7. Our results suggest that classical online bin packing algorithms with good competitive ratios may continue to perform well in OBP-DD. A natural next step is to analyze the FIVE-THIRDS algorithm [5], which is optimal in classical online bin packing. Another direction is to ask whether deadline information can be used to improve the ratio at all. On the lower-bound side, one could try to strengthen Lemma 12 so that the algorithm is forced to open four bins, rather than three. This appears difficult, since the item sizes would need to satisfy many inequalities.
In online bin packing, BEST-FIT performs on par with FIRST-FIT, while in dynamic bin packing it performs worse than FIRST-FIT [9]. It would be interesting to determine which behavior occurs in OBP-DD.
Another question is to identify restrictions on arrival times and deadlines that can make the problem easier. Recall that OBP-DD is equivalent to classical online bin packing when all deadlines are sufficiently large, or when all items have the same arrival time and deadline. What happens between these two extremes? For example, what is the competitive ratio when arrival times and deadlines take only two values, or when each item has a tight deadline, such as in a discrete-time model?
References
1 Lauri Ahlroth, André Schumacher, and Pekka Orponen. Online bin packing with delay and holding costs. Oper. Res. Lett., 41(1):1–6, 2013. doi:10.1016/J.ORL.2012.10.006.
2 Yossi Azar, Yuval Emek, Rob van Stee, and Danny Vainstein. The price of clustering in bin-packing with applications to bin-packing with delays. In Christian Scheideler and Petra Berenbrink, editors, The 31st ACM on Symposium on Parallelism in Algorithms and Architectures, SPAA 2019, Phoenix, AZ, USA, June 22-24, 2019, pages 1–10. ACM, 2019. doi:10.1145/3323165.3323180.
3 János Balogh, József Békési, György Dósa, Leah Epstein, and Asaf Levin. A new and improved algorithm for online bin packing. In Yossi Azar, Hannah Bast, and Grzegorz Herman, editors, 26th Annual European Symposium on Algorithms, ESA 2018, Helsinki, Finland, August 20-22, 2018, volume 112 of LIPIcs, pages 5:1–5:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPICS.ESA.2018.5.
4 János Balogh, József Békési, György Dósa, Leah Epstein, and Asaf Levin. A new lower bound for classic online bin packing. Algorithmica, 83(7):2047–2062, 2021. doi:10.1007/S00453-021-00818-7.
5 János Balogh, József Békési, György Dósa, Jirí Sgall, and Rob van Stee. The optimal absolute ratio for online bin packing. In Piotr Indyk, editor, Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 1425–1438. SIAM, 2015. doi:10.1137/1.9781611973730.94.
6 Piotr Berman, Jieun K. Jeong, Shiva Prasad Kasiviswanathan, and Bhuvan Urgaonkar. Packing to angles and sectors. In Phillip B. Gibbons and Christian Scheideler, editors, SPAA 2007: Proceedings of the 19th Annual ACM Symposium on Parallelism in Algorithms and Architectures, San Diego, California, USA, June 9-11, 2007, pages 171–180. ACM, 2007. doi:10.1145/1248377.1248405.
7 Joan Boyar, György Dósa, and Leah Epstein. On the absolute approximation ratio for First Fit and related results. Discret. Appl. Math., 160(13-14):1914–1923, 2012. doi:10.1016/J.DAM.2012.04.012.
8 Joseph Wun-Tat Chan, Prudence W. H. Wong, and Fencol C. C. Yung. On dynamic bin packing: An improved lower bound and resource augmentation analysis. Algorithmica, 53(2):172–206, 2009. doi:10.1007/S00453-008-9185-Z.
9 Wun-Tat Chan, Tak Wah Lam, and Prudence W. H. Wong. Dynamic bin packing of unit fractions items. In Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung, editors, Automata, Languages and Programming, 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, July 11-15, 2005, Proceedings, volume 3580 of Lecture Notes in Computer Science, pages 614–626. Springer, 2005. doi:10.1007/11523468_50.
10 Mingxia Chen, Jianbo Li, Jianping Li, Weidong Li, and Lusheng Wang. Some approximation algorithms for the clique partition problem in weighted interval graphs. Theor. Comput. Sci., 381(1-3):124–133, 2007. doi:10.1016/J.TCS.2007.04.030.
11 Leah Epstein. On bin packing with clustering and bin packing with delays. Discret. Optim., 41:100647, 2021. doi:10.1016/J.DISOPT.2021.100647.
12 Leah Epstein and Asaf Levin. On bin packing with conflicts. SIAM J. Optim., 19(3):1270–1298, 2008. doi:10.1137/060666329.
13 David S. Johnson. Near-optimal bin packing algorithms. PhD thesis, Massachusetts Institute of Technology, 1973. URL: http://hdl.handle.net/1721.1/57819.
14 David S. Johnson. Fast algorithms for bin packing. J. Comput. Syst. Sci., 8(3):272–314, 1974. doi:10.1016/S0022-0000(74)80026-7.
15 David S. Johnson, Alan J. Demers, Jeffrey D. Ullman, M. R. Garey, and Ronald L. Graham. Worst-case performance bounds for simple one-dimensional packing algorithms. SIAM J. Comput., 3(4):299–325, 1974. doi:10.1137/0203025.
16 Edward G. Coffman Jr., M. R. Garey, and David S. Johnson. Dynamic bin packing. SIAM J. Comput., 12(2):227–258, 1983. doi:10.1137/0212014.
17 Jianbo Li, Mingxia Chen, Jianping Li, and Weidong Li. Minimum clique partition problem with constrained weight for interval graphs. In Danny Z. Chen and D. T. Lee, editors, Computing and Combinatorics, 12th Annual International Conference, COCOON 2006, Taipei, Taiwan, August 15-18, 2006, Proceedings, volume 4112 of Lecture Notes in Computer Science, pages 459–468. Springer, 2006. doi:10.1007/11809678_48.
18 Young-Soo Myung. On the clique partitioning problem in weighted interval graphs. Theor. Comput. Sci., 396(1-3):290–293, 2008. doi:10.1016/J.TCS.2008.02.016.
19 Jan Van Belle, Paul Valckenaers, and Dirk Cattrysse. Cross-docking: State of the art. Omega, 40(6):827–846, 2012. doi:10.1016/jOmega.2012.01.005.
20 Prudence W. H. Wong, Fencol C. C. Yung, and Mihai Burcea. An 8/3 lower bound for online dynamic bin packing. In Kun-Mao Chao, Tsan-sheng Hsu, and Der-Tsai Lee, editors, Algorithms and Computation - 23rd International Symposium, ISAAC 2012, Taipei, Taiwan, December 19-21, 2012. Proceedings, volume 7676 of Lecture Notes in Computer Science, pages 44–53. Springer, 2012. doi:10.1007/978-3-642-35261-4_8.
A Asymptotic Competitive Ratio
For algorithms such as NF, WF, and FF, the equivalence of the two measures (competitive ratio and asymptotic competitive ratio) can also be proved by a simple input-repetition argument. The main idea is that every (small) input can be repeated multiple times without changing the algorithm's behavior on each copy.
Specifically, let be an input, and let . For , define , where is the sequence concatenation operator and is obtained from by increasing the arrival time and deadline of every item by .
Online Bin Packing with Dispatch Deadlines
Consider . Notice that the following property holds: . This is because, by the choice of , all bins used for one copy are closed before the next copy begins, and produces the same packing for each copy. However, this property need not hold for an arbitrary algorithm. For example, consider an algorithm that uses WF during the time interval and FF everywhere else.
We now show that this property implies equivalence of the two ratios. Let and denote the competitive ratio and asymptotic competitive ratio of ALG, respectively. By definition, . For the other direction, fix any input and consider as defined above. Notice that and, by the property, . Hence, . Since this holds for every input , we have . Thus, .
B Comparison of Any-Fit and Next-Fit
We prove the property that NF uses at least as many bins as any algorithm on every input.
► Lemma 13. For every input and , .
Proof. Let be the ALG packing of , indexed by the order in which the bins are opened. For each , let be the first item packed by ALG into , and let be the index of the bin in the NF packing that contains . We prove by induction on that for every . Clearly . Suppose for some . If NF has not already opened bin before processing , then it has packed all items between and (including but excluding ) into bin . If bin of NF is closed before arrives, then NF opens bin for . Thus, suppose bin of NF is still open when arrives. When ALG opens for , the items currently packed in are a subset of the items packed by NF in bin . Since bin of NF is still open, is also still open. Moreover, since ALG opens a new bin for , the item does not fit in . Therefore, cannot fit in bin of NF either, and so NF packs into a later bin. In all cases, . By induction, for every . Thus, .
C Justification of the Distinct-Time Assumption
We justify the assumption on Line 1 of Algorithm 1 that all arrival times and deadlines are distinct. We show that any input can be perturbed to satisfy this assumption without changing the packing produced by FF and the optimal cost.
Since the input is finite, we may choose smaller than half the minimum distance between any two distinct event times (where an event is an arrival or a deadline). Consider any time at which multiple events occur. We perturb the arrivals at to distinct times in , while preserving their original processing order, and perturb the deadlines at to distinct times in .
At every item arrival, the same previous items have arrived and the same bins have already closed as in the original input. Thus, by induction over the item arrivals, FF produces the same packing. Moreover, two items are disjoint after the perturbation if and only if they are disjoint before the perturbation. Therefore, the set of all feasible packings is unchanged, and so is the optimal cost.