Abstract 1 Introduction 2 Bounded Greedy Algorithm 3 Bounded Greedy Algorithm with Predictions 4 Extensions 5 Conclusion References

Online Algorithms for Set Packing with Renewable Capacities

Anya Chaturvedi ORCID School of Computing and Augmented Intelligence, Arizona State University, USA    William K. Moses Jr ORCID Department of Computer Science, Durham University, UK    Christian Scheideler ORCID Department of Computer Science, Paderborn University, Germany    Prudence W. H. Wong ORCID School of Computer Science and Informatics, University of Liverpool, UK
Abstract

We propose and study a new extension of the classical set packing problem, which we call the online D-set packing with renewable capacities (D-SPaRC) problem. In the D-SPaRC setting, there is a collection of resources with associated capacities. Requests arrive one by one, and for each request, a decision has to be made to accept it or not before seeing future requests. Each request is associated with a collection of subsets of resources, with each subset having cardinality at most D. When accepting a request, exactly one of these subsets must be chosen, which consumes one unit of capacity on each of the involved resources. Over time, the available resource capacities may be renewed, allowing additional requests to be accepted. Many online problems, including packing, routing, and scheduling, can be formulated as a D-SPaRC problem, thus underlining its usefulness.

We first present a simple greedy algorithm that is O(c^min(D1/c^min1))-competitive for D2 and 3-competitive if D=1, where c^min is the minimum capacity of the resources. We then show that, for c^min=Ω(logD), the greedy algorithm can be extended to an online algorithm with predictions whose competitive ratio is never worse than that of the original greedy approach and can, in fact, be reduced to a constant when the predictions are optimal. Finally, we generalize the D-SPaRC problem in two meaningful ways, namely by addressing non-uniform request priorities and by handling requests with non-uniform weights.

Keywords and phrases:
Set packing, online algorithms, learning-augmented algorithms
Funding:
Christian Scheideler: DFG Projects SCHE 1592/10-1 and 1592/11-1.
Copyright and License:
[Uncaptioned image] © Anya Chaturvedi, William K. Moses Jr., Christian Scheideler, and Prudence W.H. Wong; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Online algorithms
Editors:
George B. Mertzios and Andréa W. Richa

1 Introduction

The online D-set packing with renewable capacities (D-SPaRC) problem consists of a set V of resources (simply called nodes in the following) with associated capacities c^:V. Let c^min=minvc^(v). Initially, the available capacity c(v) at every node v is equal to c^(v). Requests r1,r2, arrive one by one, where each ri is a non-empty collection of non-empty subsets of V, with each subset having cardinality at most D (representing the maximum allowed resource demand per request). For each ri, a decision must be made to accept or reject it before seeing future requests. A request ri can only be accepted if there exists a set Sri with c(v)1 for all vS. We call such sets feasible. If ri is accepted, exactly one feasible set S must be picked, and c(v) is decreased by 1 for all nodes vS. Independent of the decisions and unknown to the online algorithm, the node capacities are renewed over time, i.e., there is a sequence of capacity renewal vectors c1,c2, over V, where ci(v)0 specifies the amount of the available capacity at node v that is renewed between requests ri and ri+1. More specifically, given a renewal of ci(v), the available capacity of v is updated to min{c^(v),c(v)+ci(v)} before request ri+1 is proposed. The primary objective of this paper is to accept as many requests as possible, and the quality of our solutions is measured using the competitive ratio, which is the worst-case ratio of the performance of an optimal offline algorithm to that of the proposed online algorithm over any sequence of requests. We will also discuss some extensions at the end of this paper.

The D-SPaRC problem has interesting applications in the context of renewable energy. Consider, for example, a future scenario in which windmills recharge batteries for package-delivering drones. Given a request to send a package from a source A to a destination B, where B is too far away from A to deliver the package on a single battery charge, several optional flight paths – in which drone batteries can be replaced en route at windmills – can then be used to ensure the package is delivered to B. Any collection of such windmills may be represented as a set, and therefore, a request to deliver a package can be modeled as a collection of subsets of the set of windmills. This can be formulated as a D-SPaRC problem if the number of times a battery is allowed to be replaced for a single package is upper-bounded by D. We illustrate this using an example in Figure 1. Instead of windmills at fixed locations, one can also envision a scenario in which batteries are available on mobile units, like trucks, so that certain drone routes are only temporarily available.

Figure 1: Illustration of the D-SPaRC problem applied to drone-based package delivery, where a drone must transport a package from a warehouse (source, left) to a mailbox (destination, right). Windmills serve as intermediate battery-replacement stations, represented as nodes, where each windmill v has maximum capacity c^(v), depicted as a vertical stack of batteries, where green and red batteries indicate available and depleted capacity, respectively. An edge between two nodes indicates the drone can travel between them on a single battery charge. For this instance, consider the request ri={{a,c,d},{a,b,e}} with D=3. ri can be accepted using the feasible subset {a,c,d} (while the other is infeasible since e has no remaining capacity).

In general, we may consider any situation in which there is a collection of suppliers of a certain type of renewable resource, and a request is only allowed to use those combinations of suppliers that do not exceed the allowed budget of any given request while satisfying its needs. In that case, we may end up with weighted combinations of suppliers, which can be modeled as multisets and can be covered by one of our extensions. The D-SPaRC formulation can also cover scenarios in which suppliers are temporarily out of service (i.e., unable to deliver their available resources), provided this occurs independently of the online algorithm’s choices. In that case, a request contains only multisets of suppliers currently in service.

1.1 Our Contributions

We present a new variant of the set packing problem and show that a simple greedy algorithm is O(c^min(D1/c^min1))-competitive for D2 and 3-competitive if D=1, where c^min is the minimum capacity of the resources. Its proof is inspired by an analysis of a greedy algorithm for the unsplittable flow problem [23], but the new aspect here is that we are dealing with renewable resources, which significantly complicates the witness argument in the proof.

We then show that, for c^min=Ω(logD), the greedy algorithm can be extended to an online algorithm with predictions whose competitive ratio is never worse than that of the original greedy approach and can, in fact, be reduced to a constant when the predictions are optimal. The key idea here is to compare the performance of an optimal algorithm with the performance of the greedy algorithm and an optimal algorithm that only have half of the capacity available in the resources, and whenever the capacity of a resource is renewed by an additive c in the former case, it is only renewed by c/2 in the latter case. It turns out that the greedy algorithm still remains O(c^min(D2/c^min1))-competitive in that case, and the optimal algorithm for half of the capacities still remains constant competitive if c^min=Ω(logD). Combining these two insights then allows us to design an online algorithm with predictions that is O(logD)-competitive for any predictions and constant competitive if the predictions are optimal, under the assumption that c^min=Ω(logD).

Finally, we generalize the D-SPaRC problem in two meaningful ways, namely by addressing non-uniform request priorities and by handling requests with non-uniform weights. In fact, given a maximum priority of pmax, a competitive ratio of O(c^min(Dlog(pmax+1)/c^min1)) can be reached, and given a maximum weight of μ^, a competitive ratio of O(c^min(D1/(c^minμ^)1)) can be reached.

1.2 Related Work

Set packing is a fundamental problem that belongs to Karp’s 21 𝒩𝒫-complete problems [22]. Suppose that we are given a finite set S and a collection 𝒞 of subsets of S. Then, the (decision variant of the) set packing problem asks if there are k pairwise disjoint subsets in 𝒞. The set packing problem is not only 𝒩𝒫-complete, but its optimization version has been shown to be as hard to approximate as the maximum clique problem by Hazan, Safra, and Schwartz [19], and the best known algorithm approximates it within a factor of O(|S|) (see the work of Halldórsson, Kratochvíl, and Telle [18]). A more tractable problem is the D-set packing problem in which each set contains at most D elements. When D=1, the problem is trivial, and when D=2, the problem is equivalent to finding a maximum cardinality matching, which can be solved in polynomial time. For any D3, the problem is 𝒩𝒫-hard, as it is a generalization of the D-dimensional matching problem, and Karp [22] showed that 3-dimensional matching is 𝒩𝒫-hard. However, there are constant-factor approximation algorithms (e.g., Cygan [9], Fürer and Yu [15]).

D-set packing is equivalent to D-hypergraph matching where the sets of size at most D correspond to hyperedges of size at most D. Online D-hypergraph matching has been studied by Tröbst and Udwani [30], where they show that any (randomized) online algorithm has competitive ratio at least (2+o(1))/D. (Note that they define competitive ratio inversely to the definition used in this paper, i.e., they consider the ratio of the algorithm performance to the optimal performance.) They also study the version of the problem where edges are allowed to be assigned fractionally. Notice that D-hypergraph matching differs from D-SPaRC in two ways: the hyperedges (sets) are disjoint and the nodes are not renewable.

A closely related problem to our formulation of the online D-set packing problem (without considering renewable capacities) is the online unsplittable flow problem (UFP), also referred to as the online unsplittable routing problem. In online UFP, we are given an undirected graph consisting of n nodes and positive real-valued edge capacities. Each request comes in as a tuple of its associated source and destination nodes, along with a corresponding demand d[0,1]. The goal is to maximize the number of requests accepted. We can successfully satisfy a request if there exists a path in the graph such that each involved edge has sufficient capacity to satisfy the given demand d (and the flow is never split amongst multiple paths). Once a request is accepted, the capacities along the chosen path will be updated accordingly. One can observe that online UFP, where each demand is exactly 1, can be modeled using our formulation of online D-set packing, where each element is an edge, and each collection of elements represents a potential flow path to satisfy a given request. Furthermore, D would be an upper bound on the length of any flow path in the graph. The online version of the UFP was first studied by Awerbuch, Azar, and Plotkin [2], who considered the case where the minimum edge capacity is Ω(logn) and designed an O(logn)-competitive algorithm. Over the years, various works have continued to study the problem, aiming to improve the competitive ratio by leveraging different parameters (e.g., flow number by Kolman and Scheideler [23]) or different techniques (e.g., primal-dual technique by Buchbinder and Naor [8]).

Motivated by packet forwarding, Emek, Halldórsson, Mansour, Patt-Shamir, Radhakrishnan, and Rawitz [12, 13] introduced a formulation of the online set packing problem where initially we are aware of several subsets of S whose elements are unknown, and elements arrive in an online manner, revealing which subset(s) they belong to. The goal is to irrevocably assign incoming elements to one of their potential subsets such that the total number of subsets with all elements assigned is maximized. For this formulation, they developed a randomized distributed algorithm to solve the problem and showed a nearly matching lower bound on the competitive ratio that holds even in the centralized setting. This version of the online set packing problem, where subsets are inputs and elements are requests, is a variant of D-SPaRC where the roles are reversed. Thus, solutions to D-SPaRC are not applicable to this formulation.

There is also some overlap between D-SPaRC and the online knapsack problem. In the online knapsack problem, a knapsack of some capacity receives elements one by one, each with a specific weight and value. An irrevocable decision to accept or reject the element is made, and the goal is to maximize the total value of the elements accepted to the knapsack without exceeding its capacity. One may notice that for the version of online knapsack where all elements have the same value but possibly different integer-value weights, this may be modeled as the non-uniform weight version of the D-SPaRC problem (see Section 4). The work of Marchetti-Spaccamela and Vercellis [29] was the first to study the online knapsack problem and showed that in the general case, there is no online algorithm that can achieve a non-trivial competitive ratio. The work of Zhou, Chakrabarty, and Lukose [32] subsequently studied this problem by assuming that the weight of each item is much smaller than the knapsack capacity and that the value-weight ratio of each item is lower and upper bounded by two constants L and U, respectively. They were able to design an algorithm that solves the online knapsack with competitive ratio ln(U/L)+1, which they showed to be optimal. There has been much subsequent research on the problem, and the interested reader may refer to the survey by Böckenhauer, Hromkovič, Komm, Rossmanith, and Stocker [5].

Another line of work related to D-SPaRC is augmenting online algorithms with replenishment, as done by Kang, Liu, and Udwani [21]. They introduce a black-box method that extends many existing online resource allocation algorithms (for resources with fixed capacities) to work with an arbitrary (adversarial or stochastic) replenishment process.

As mentioned earlier, drone routing can be modeled via the D-SPaRC problem. In particular, consider a graph where the vertices are windmills at which drone batteries can be stored/charged. Each node’s capacity represents the number of drone batteries that can be stored/charged at that node. The input is a sequence of delivery requests, where each request consists of a sequence of at most D nodes to be traversed by a drone (to deliver a package from a starting point to an ending point). The goal is to satisfy the maximum number of requests, where a request is satisfied if each node in the assignment has non-zero capacity when the request is being serviced. Drone routing is a more recent variant of the vehicle routing problem, introduced by Dantzig and Ramser [11], a source of active research for the past 67 years. An excellent survey on various work that has been done in this area is that of Laporte [25]. Macrina, Di Puglia Pugliese, Guerriero, and Laporte [28] provide a wonderful survey of work focused on drone routing.

Many works have considered providing additional information to an online algorithm in order to improve its performance. One important model is the advice model, where an oracle has advance knowledge of the entire input, chooses to encode some information in a string of bits, and makes this string available to the algorithm throughout the runtime to aid in the computation. For more information on this advice model, please see the relevant section in Komm [24] and the survey by Boyar, Favrholdt, Kudahl, Larsen, and Mikkelsen [6]. Typically, the oracle is assumed to be correct. Learning-augmented algorithms, also known as algorithms with predictions, attempt to capture more realistic situations where the information, potentially generated by a machine learning algorithm, may not always be correct. In this model, introduced by Lykouris and Vassilvitskii [27], the prediction may or may not be correct. Algorithms are then designed to leverage correct predictions to achieve better performance while withstanding incorrect predictions, i.e., performing as well as if no prediction was available. To the best of our knowledge, there has been no prior attempt to study the set packing problem, let alone the D-SPaRC problem, in a learning-augmented model. However, in this setting, the knapsack problem has been studied [1, 3, 7, 10, 16, 17, 20, 26, 31].

It should be noted that there are many packing problems that may seem related to set packing, such as bin packing, but are, in fact, different and the solutions to these problems do not immediately apply to set packing.

2 Bounded Greedy Algorithm

For any resource vV and x{0,,c^(v)} (specifying the unavailable capacity in v) let fv(x)=Dx/c^(v). Let the weight of a set SV be defined as f(S)=vSfv(c^(v)c(v)). Our Bounded Greedy Algorithm (BGA) works as follows: Let W be a suitable parameter. Given a request r, accept it whenever there is a feasible set Sr with f(S)W, and pick any such set in this case. Otherwise, reject it. We show the following result.

Theorem 1.

The BGA with W=2D is O(c^min(D1/c^min1))-competitive for D2 and 3-competitive for D=1.

Proof.

First, consider the case D2. Let be the set of requests accepted by the BGA and 𝒪 be the set of requests accepted by the optimal offline solution OPT. Furthermore, let 𝒪=𝒪. Our goal will be to show that |𝒪| can be upper-bounded in terms of ||, which will then allow us to determine the competitive ratio of the BGA.

Consider any request r𝒪. Since r was not accepted by the BGA, it must hold for the set S(r) taken by OPT that

  1. 1.

    S(r) was infeasible or

  2. 2.

    f(S(r))>W

at the point when the BGA considered r. We will capture these two cases via some appropriate potential function. For any vV let the potential of v be defined as ϕ(v)=(c^min/c^(v))i=0c^(v)c(v)1fv(i), where c(v) is the available capacity at v when the BGA considered r, and let ϕ(S(r))=vS(r)ϕ(v). It holds that

ϕ(v) =c^minc^(v)i=0c^(v)c(v)1Di/c^(v)=c^minc^(v)D(c^(v)c(v))/c^(v)1D1/c^(v)1
=c^minc^(v)(D1/c^(v)1)(fv(c^(v)c(v))1)

Since c^(v)(D1/c^(v)1) is monotonically decreasing with increasing c^(v) and therefore attains its maximum at c^min(D1/c^min1),

ϕ(v)1D1/c^min1(fv(c^(v)c(v))1)

In case 1, there must be a node vS(r) with c(v)=0 and, therefore,

ϕ(S(r))ϕ(v)D1D1/c^min1

In case 2, we see that

ϕ(S(r)) =vS(r)ϕ(v)1D1/c^min1vS(r)(fv(c^(v)c(v))1)
1D1/c^min1(f(S(r))D)D1D1/c^min1

because in case 2, f(S(r))>W=2D.

Thus, in both cases, ϕ(S(r))D1D1/c^min1. Therefore,

|𝒪| =r𝒪1=D1/c^min1D1r𝒪D1D1/c^min1
D1/c^min1D1r𝒪ϕ(S(r))

Next, we will upper bound the right-hand side in terms of ||. For that, we have to determine how to formulate suitable weights for the requests in so that they cover r𝒪ϕ(S(r)).

Figure 2: Illustration of the algorithm’s progression and the charging argument at a single node v. Initially, c(v)=c^(v). Requests r1,r2, arrive one by one; each accepted request ri is assigned the battery at height c^(v)c(v) (i.e., the lowest available slot), and c(v) is decremented by 1 (used batteries are labeled by the request that consumed them). A request is rejected if no available capacity remains at v (shown for ri, marked Rejected!). Between consecutive requests, capacity renewals may replenish c(v) up to c^(v); upon renewal, batteries associated with earlier requests are replenished first, shifting the remaining used batteries down accordingly.

Note that if c(v)=c^(v), i.e., v has not been used by any request or its capacity has been fully recharged in the meantime, ϕ(v)=0. Thus, whenever ϕ(v)>0, this is witnessed by requests whose BGA-sets include v. Given a request r𝒪 and a node vS(r), let c(v) be the available capacity at v when the BGA considers r. Consider the capacity c^(v) of v to be represented by a stack of c^(v) many slots with heights 0 to c^(v)1, where the c^(v)c(v) lowest slots are occupied by the BGA-requests that were last accepted by the BGA and whose sets include v, ordered from the oldest at slot 0 to the youngest at slot c^(v)c(v)1 (see Figure 2). If we now charge a weight of (c^min/c^(v))fv(i) to each request of height i, we can cover ϕ(v) in ϕ(S(r)). To determine the maximum total weight a request r can contribute to node v in r𝒪ϕ(S(r)), we first observe that the initial height of r at v is c^(v)cr(v), where cr(v) is the available capacity at v when considering r, and afterwards the height of r in v monotonically decreases over time. More precisely, whenever the capacity at v gets renewed by γ, the height of r drops by γ, and once the height of r drops below 0 this way, it will not be considered for future requests accepted by OPT. Certainly, r cannot be charged for an arbitrary number of requests in OPT because once v has been used by c^(v) many requests accepted by OPT, OPT can only choose v for additional requests if its capacity gets renewed. Hence, the total weight that needs to be charged to r w.r.t. node v gets maximized if it stays at its initial height for c^(v) many OPT requests and additionally c^(v)cr(v) many OPT requests at height h for all h{0,,c^(v)cr(v)1}. Thus, the maximum total weight that a request r contributes to node v in r𝒪ϕ(S(r)) is at most

c^(v)c^minc^(v)fv(c^(v)cr(v))+c^minc^(v)i=0c^(v)cr(v)1fv(i)
(c^min+c^minc^(v)(D1/c^(v)1))fv(c^(v)cr(v))

From the equation ex=i0xi/i! it easily follows that limxx(D1/x1)=lnD and we already stated above that the function x(D1/x1) is monotonically decreasing for x1. Thus, c^(v)(D1/c^(v)1)lnD for all D2 and c^(v)1. Moreover, if c^min=ϵlnD then c^min(D1/c^min1)=ϵlnD(e1/ϵ1)ϵ(e1/ϵ1)c^(v)(D1/c^(v)1). Thus, for c^min=ϵlnD,

(c^min+c^minc^(v)(D1/c^(v)1))fv(c^(v)cr(v))
(c^min+ϵ(e1/ϵ1)D1/c^min1)fv(c^(v)cr(v))
=(c^min+c^minlnD)f(c^(v)cr(v))=c^min(1+1lnD)fv(c^(v)cr(v))

Therefore,

|𝒪| D1/c^min1D1r𝒪ϕ(S(r))D1/c^min1D1rc^min(1+1lnD)f(S(r))
=c^min(1+1lnD)D1/c^min1D1rf(S(r))
3c^minD1/c^min1D1W||
=O(c^min(D1/c^min1)||)

for W=2D and D2. Since |𝒪𝒪|||, the theorem follows.

It remains to consider the case D=1. For D=1, fv(x) is always 1. Therefore, the BGA with W=2D=2 accepts any request r that has a set {v}r with c(v)>0, and picks any such node for r in this case. Thus, for any request r𝒪, the node in S(r) taken by r was infeasible for the BGA because c(v)=0. This implies that

ϕ(S(r))=c^minc^(v)i=0c^(v)c(v)1fv(i)=c^min

and therefore,

|𝒪|1c^minr𝒪ϕ(S(r))

To cover r𝒪ϕ(S(r)), it suffices for every request r accepted by the BGA to assign a weight of at most

c^(v)c^minc^(v)+c^minc^(v)(c^(v)cr(v))2c^min

to (the node v picked by) r. Hence,

|𝒪|1c^minr2c^min=2||

which implies that the BGA is 3-competitive in this case.

Due to a lower bound of Ω(c^minD1/(c^min1)) in [23] that holds for any 2c^minlogD and any deterministic online algorithm for (a special case of) the D-SPaRC problem, the upper bound is almost optimal. The theorem also implies that for D2 and c^minlogD, the BGA is O(logD)-competitive.

3 Bounded Greedy Algorithm with Predictions

Next, we will investigate how the BGA can be combined with predictions so that, for the case that the predictions are good, a constant competitive ratio can be reached, while for the case that the predictions are bad, the BGA with predictions will have a competitive ratio that is not worse than the competitive ratio of the original BGA algorithm.

Consider any β(0,1) with c^min1/β. First, we want to compare the performance of BGA(β) with OPT, where the bounded greedy algorithm BGA(β) can only use a β-fraction of the capacities of the nodes. More precisely, initially, for every node vV, the available capacity at v for BGA(β) is just βc^(v), and it takes 1/β capacity renewals at v until the capacity for BGA(β) renews by 1. In this case, it holds:

Theorem 2.

For any β(0,1) with β1 and βc^min1, BGA(β) with W=2D is O(c^min(D1/(βc^min)1))-competitive for D2 and 1+2/β-competitive if D=1.

Proof.

For simplicity, redefine the node capacities so that BGA(β) is operating on the original capacities c^(v) while OPT is operating on the capacities β1c^(v). Then the proof follows along the same lines as the proof of Theorem 1. The only difference is that we have to adapt the weight associated with a request r to cover r𝒪ϕ(S(r)) (where ϕ is defined as before because we consider here the situation of the BGA). More precisely, a request r might be used up to β1c^(v) times as witness for some request accepted by OPT before changing its height due to capacity renewals, and afterwards, in the worst case up to β1 times as witness for each height h{0,,c^(v)cr(v)1}. This increases the weight associated with r by a factor of β1, which increases the competitive ratio by a factor of β1, resulting in O(β1c^min(D1/c^min1)). Substituting c^(v) by βc^(v) results in the bound in Theorem 2 for D2. The special case D=1 follows along the same lines.

Since the number of requests accepted by OPT is at least as large as the number of requests accepted by the BGA, Theorem 2 immediately implies the following result, where, analogously to BGA(1/2), OPT(1/2) is the optimal algorithm that has only half of the capacity of OPT.

Corollary 3.

OPT(1/2) is O(c^min(D2/c^min1))-competitive compared to OPT.

For c^min=Ω(logD), we can prove a stronger result.

Theorem 4.

If c^minγlogD for a sufficiently large constant γ, then OPT(1/2) is constant competitive compared to OPT.

Proof.

The proof uses the Lovász Local Lemma (LLL) [14]:

Lemma 5 (Lovász Local Lemma).

Let A1,,An be events in an arbitrary probability space. Suppose that G=(V,E) is a dependency graph of these events and that there are real numbers xi(0,1) for all 1in with

Pr[Ai]xi{i,j}E(1xj)

for all 1in. Then,

Pr[i=1nA¯i]i=1n(1xi).

In particular, with positive probability no bad event Ai holds.

Let r1,,rn be the requests accepted by OPT for the original capacities, and let S(ri) be the set selected for ri. We assume for the rest of the proof that D2 and n is above a sufficiently large constant since otherwise the theorem is trivially true. Consider the random experiment that for each of the accepted requests ri, OPT(1/2) decides independently of the other requests with probability p=(1ϵ)/2 for some constant 0<ϵ<1 whether to accept ri as well. Let event B be true iff OPT(1/2) accepts at most pn/2 requests. Then it follows from the Chernoff bounds that

Pr[B]e(1/2)2pn/2=e(1ϵ)n/16

Furthermore, for every node v and request ri with vS(ri), let event A(v,i) be true iff OPT(1/2) uses more than c^(v)/2 of v’s capacity after considering ri, i.e., the available capacity is less than c^(v)/2. To bound the probability that A(v,i) is true, let X(v,i) be the total amount of used capacity in v after OPT considered ri and the random variable X(v,i) be the total amount of used capacity in v after OPT(1/2) considered ri. Certainly, 𝔼[X(v,i)]=pX(v,i)pc^(v). Since the decision to accept a request accepted by OPT is done independently of the other requests, it follows from the Chernoff bounds that

Pr[X(v,i)c^(v)/2]=Pr[X(v,i)(1+(12p)/(2p))pc^(v)]e12p2ppc^(v)/3=eϵc^(v)/6

To determine the dependencies between the events A(v,i), we use w.l.o.g. the rule that whenever the used capacity of a node v is c, this is due to the last c requests r accepted by OPT with vS(r). In this case, two events A(v,i) and A(w,j) are dependent if and only if S(ri)S(rj) and there is a node vS(ri)S(rj) where ri and rj witnessed the used capacity in v at the same time. Since ri can only witness a used capacity in nodes vS(ri) and for each such v, ri can witness a used capacity jointly with at most 2c^(v) many other requests, it follows that A(v,i) can depend on at most wS(ri)2c^(w) many other events A(w,j). Furthermore, all events A(v,i) depend on B. For all events A(v,i) let us choose x(v,i)=x(v)=ϵc^(v)D, and for event B choose x(B)=e(1ϵ)n/32. Then it follows that

x(v,i)(1x(B))wS(ri)(1x(w))2c^(w) ϵc^(v)D(1x(B))wS(ri)e2ϵc^(w)D2c^(w)
ϵc^(v)D(1x(B))e4ϵeϵc^(v)/6

if c^minγlogD for some sufficiently large constant γ and n is above a sufficiently large constant. Thus,

Pr[X(v,i)c^(v)/2]x(v,i)(1x(B))wS(ri)(1x(w))2c^(w)

Moreover,

x(B)i=1nvS(ri)(1x(v,i)) =x(B)i=1nvS(ri)(1ϵc^(v)D)
x(B)i=1nvS(ri)e2ϵc^(v)D
x(B)i=1ne2ϵc^min=x(B)e2ϵn/c^min

Since e2ϵn/c^mine(1ϵ)n/32 if the constant γ in c^min is large enough, it follows that

Pr[B]x(B)i=1nvS(ri)(1x(v,i))

Thus, due to the LLL, with positive probability, no bad event B or A(v,i) holds, which means we have a valid solution for OPT(1/2) with constant competitiveness.

The condition in Theorem 4 that c^minγlogD is best possible up to constant factors, as shown in the following lemma.

Lemma 6.

For c^min=o(logD), OPT(1/2) cannot be constant competitive compared to OPT.

Proof.

The independence number of a hypergraph H=(V,E), denoted by α(H), is the maximum size of a subset UV that does not contain an edge of the hypergraph. Consider a random D-regular k-uniform hypergraph H=(V,E) with V={1,,n}. For any node i let E(i) be the set of hyperedges containing i. To obtain an instance of the D-SPaRC problem, consider the requests r1,r2,,rn on the resource set E with ri={E(i)} for all i. If all resources have capacity k, then all requests can be accepted because each hyperedge (representing a resource) is requested by exactly k requests. However, if all resources have a capacity of k1, the maximum number of requests that can be accepted is equal to the independence number α(H). Bennett and Frieze [4] have shown that for random D-regular k-uniform hypergraphs H, α(H) converges to n(klogD(k1)D)1/(k1) for any fixed k and D being sufficiently large, which implies that a constant factor difference between k and k1 w.r.t. the maximum number of accepted requests is only achieved if k=Ω(logD), resulting in the lemma. In fact, for the special case of k=2, the difference is as high as Θ((logD)/D), and therefore, for c^min=2, there are instances of the D-SPaRC problem where OPT(1/2) is just Θ(D/(logD))-competitive compared to OPT.

Now, we are ready to explain how to extend the BGA with predictions. Suppose, for simplicity, that all nodes have even capacities. In this case, we can evenly distribute the capacity of v among two copies v1 and v2 so that each copy has a capacity of c^(v)/2. Whenever there is a renewal of the capacity of v, the renewed capacity will alternately be given to v1 and v2. The available capacities in the copies v1 are exclusively available for some oracle Ω that uses predictions, while the available capacities of the copies v2 are exclusively available for the BGA. Whenever the BGA accepts a request, Ω is not consulted, but whenever the BGA does not accept a request r and there is at least one feasible set S(r) w.r.t. the copies v2, we consult Ω whether to accept the request, and if so, which feasible set S(r) to take.

Let us call this BGA with predictions BGA(Ω). Combining Theorems 2 and 4, we get:

Theorem 7.

If Ω is ω-competitive w.r.t. OPT(1/2) and c^minγlogD for a sufficiently large constant γ then BGA(Ω) is O(min{ω,logD})-competitive.

Hence, our BGA with predictions can make the best use of the predictions without sacrificing the original competitive ratio of the original BGA.

4 Extensions

In this section, we study two extensions of the basic D-SPaRC problem.

4.1 Non-uniform priorities

Suppose that each request ri has a priority p(ri) and the goal is to maximize the sum of the priorities of the accepted requests. Furthermore, suppose that the maximum priority pmax is known in advance to the online algorithm and that c^minlog(pmax+1). Then we can use the following priority-based BGA algorithm: Use the standard trick of cutting the requests into k=log(pmax+1) priority classes, where priority class i0 contains all priorities in the interval [2i,2i+11), and reserve a 1/k fraction of the capacity of each node for each priority class. Moreover, capacity renewals are evenly distributed among the reserved capacities. Then it follows from Theorem 2:

Theorem 8.

If k=log(pmax+1) and c^mink is an integer multiple of k, the priority-based BGA with W=2D is O(c^min(Dk/c^min1))-competitive for D2 and O(k)-competitive for D=1.

Hence, if D2 and c^minklogD then the priority-based BGA is O(klogD)-competitive.

4.2 Non-uniform weights

Suppose that we allow the sets a request can choose from to be arbitrary non-empty multisets of V of size at most D, where a node in V can occur up to μ times in a multiset S, for some μ>1. Note that in this case, Dμ>1 as well, i.e., we do not have to consider the special case D=1. Then we can use the following weighted BGA algorithm: Given a request r, accept it whenever there is a feasible multiset Sr with f(S)W, and pick any such set in this case. A multiset S is feasible if for every vV, c(v)μ(v), where μ(v) is the number of times v appears in S, and the weight f(S) is defined as

f(S)=vSi=0μ(v)1fv(c^(v)c(v)+i)

where fv(x)=Dx/c^(v) is defined as before. Then it follows:

Theorem 9.

If c^minμ then the weighted BGA with W=D+D1+(μ1)/c^min is O(c^minD2(μ1)/c^min(D1/c^min1))-competitive.

Proof.

Let 𝒪, 𝒪, and be defined as in the proof of Theorem 1. Consider any request r𝒪. Since r was not accepted by the weighted BGA, it must hold for the set S(r) taken by OPT that (1) S(r) was infeasible or (2) f(S(r))>W at the point where the BGA considered r. We capture these two cases via a potential function ϕ(S(r))=vS(r)i=0μ(v)1ϕ(v,i) with

ϕ(v,i) =c^minc^(v)j=μ(v)+i+1c^(v)c(v)μ(v)+iDj/c^(v)=c^minc^(v)1D(μ(v)1)/c^(v)j=0c^(v)c(v)+i1Dj/c^(v)
c^minc^(v)Di/c^(v)D(μ(v)1)/c^(v)Dc^(v)c(v)1D1/c^(v)1
1D(μ1)/c^min1(D1/c^min1)Di/c^(v)(fv(c^(v)c(v))1)
=1D(μ1)/c^min1(D1/c^min1)(fv(c^(v)c(v)+i)Di/c^(v))

In case 1, there must be a node vS(r) with c(v)<μ(v) and therefore there is some i in i=0μ(v)1ϕ(v,i) where c^(v)c(v)+i=c^(v). Thus,

ϕ(S(r)) i=0μ(v)1ϕ(v,i)1D(μ1)/c^min1(D1/c^min1)(fv(c^(v))D(μ1)/c^min)
1D(μ1)/c^minDD(μ1)/c^min(D1/c^min1)

In case 2, we see that

ϕ(S(r)) =vS(r)i=0μ(v)1ϕ(v,i)
1D(μ1)/c^min1(D1/c^min1)vS(r)i=0μ(v)1(fv(c^(v)c(v)+i)Di/c^min)
1D(μ1)/c^min1(D1/c^min1)(f(S(r))D1+(μ1)/c^min)
1D(μ1)/c^minDD(μ1)/c^min(D1/c^min1)

Thus, in both cases,

ϕ(S(r))1Dμ/c^minDD(μ1)/c^min(D1/c^min1)

Note that if c(v)=c^(v), i.e., v has not been used by any request or its capacity has been fully recharged in the meantime, ϕ(v,i)=0 for all i. Thus, whenever ϕ(v,i)>0, this is witnessed by requests whose BGA-sets include v. For the charging argument, for every slot occupied by a request r in v,

c^(v)c^minc^(v)fv(c^(v)cr(v))+c^minc^(v)(i=0c^(v)cr(v)1fv(i))+c^minc^(v)i=0μ1Di/c^(v)

has to be used, where the last term is due to the fact that ϕ(S(r)) may also contain Dk/c^(v)’s with negative k’s, which is covered by the request currently responsible for the lowest capacity slot in v. Note that

c^minc^(v)i=0μ1Di/c^(v)c^minc^(v)(11/D1/c^(v))c^minD1/c^(v)lnDc^minD1/c^minlnDf(c^(v)cr(v))

Continuing like in the proof of Theorem 1 will then result in the theorem.

5 Conclusion

In this paper, we introduced the D-SPaRC problem and showed that simple greedy algorithms have a low competitive ratio for it and its extensions. We also extend the greedy approach to an online algorithm with predictions for the D-SPaRC problem with c^min=Ω(logD) that is never worse than the greedy algorithm without predictions and can reach a constant competitive ratio in case of optimal predictions. The problem is further generalized to address both non-uniform request priorities and requests with non-uniform weights.

In the future, it will be interesting to investigate various extensions to our formulation. For example, strengthening the analysis to accommodate temporary modifications to the maximum capacity (c^(v)) of any involved resource v, potentially resulting from maintenance and future upgrades. It might also be worth exploring a modification where, after accepting one request, it can adaptively be updated – midway to use a different set of resources while still satisfying the D cap – to accommodate new incoming requests, thereby maximizing the total number of requests satisfied. In applications such as drone delivery, further improvements of the competitive ratio might be possible by allowing delayed decisions or load balancing via service drones.

References

  • [1] Spyros Angelopoulos and Shahin Kamali. Rényi-ulam games and online computation with imperfect advice. In MFCS, volume 272 of LIPIcs, pages 13:1–13:15, 2023. doi:10.4230/LIPIcs.MFCS.2023.13.
  • [2] Baruch Awerbuch, Yossi Azar, and Serge Plotkin. Throughput-competitive on-line routing. In Proceedings of 1993 IEEE 34th Annual Foundations of Computer Science, pages 32–40. IEEE, 1993. doi:10.1109/SFCS.1993.366884.
  • [3] Jakub Balabán, Matthias Gehnen, Henri Lotze, Finn Seesemann, and Moritz Stocker. Online knapsack problems with estimates. In 50th International Symposium on Mathematical Foundations of Computer Science, MFCS, volume 345 of LIPIcs, pages 12:1–12:19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.MFCS.2025.12.
  • [4] Patrick Bennett and Alan M. Frieze. On the chromatic number of random regular hypergraphs. SIAM J. Discret. Math., 38(2):1369–1380, 2024. doi:10.1137/22M1544476.
  • [5] Hans-Joachim Böckenhauer, Juraj Hromkovič, Dennis Komm, Peter Rossmanith, and Moritz Stocker. A survey of online knapsack problems. Discrete Applied Mathematics, 378:492–507, 2026. doi:10.1016/j.dam.2025.08.011.
  • [6] Joan Boyar, Lene M. Favrholdt, Christian Kudahl, Kim S. Larsen, and Jesper W. Mikkelsen. Online algorithms with advice: A survey. ACM Computing Surveys (CSUR), 50(2):1–34, 2017. doi:10.1145/2993749.2993766.
  • [7] Joan Boyar, Lene M. Favrholdt, and Kim S. Larsen. Online unit profit knapsack with untrusted predictions. In SWAT, volume 227 of LIPIcs, pages 20:1–20:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.SWAT.2022.20.
  • [8] Niv Buchbinder and Joseph Naor. Online primal-dual algorithms for covering and packing. Mathematics of Operations Research, 34(2):270–286, 2009. doi:10.1287/moor.1080.0363.
  • [9] Marek Cygan. Improved approximation for 3-dimensional matching via bounded pathwidth local search. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS, pages 509–518. IEEE Computer Society, 2013. doi:10.1109/FOCS.2013.61.
  • [10] Mohammadreza Daneshvaramoli, Helia Karisani, Adam Lechowicz, Bo Sun, Cameron N. Musco, and Mohammad Hajiesmaili. Near-optimal consistency-robustness trade-offs for learning-augmented online knapsack problems. In ICML, volume 267 of Proceedings of Machine Learning Research, pages 12459–12489. PMLR, 13–19 July 2025. URL: https://proceedings.mlr.press/v267/daneshvaramoli25a.html.
  • [11] George B. Dantzig and John H. Ramser. The truck dispatching problem. Management science, 6(1):80–91, 1959. doi:10.1287/mnsc.6.1.80.
  • [12] Yuval Emek, Magnús M Halldórsson, Yishay Mansour, Boaz Patt-Shamir, Jaikumar Radhakrishnan, and Dror Rawitz. Online set packing and competitive scheduling of multi-part tasks. In Proceedings of the 29th ACM SIGACT-SIGOPS symposium on Principles of distributed computing, pages 440–449, 2010. doi:10.1145/1835698.1835800.
  • [13] Yuval Emek, Magnús M Halldórsson, Yishay Mansour, Boaz Patt-Shamir, Jaikumar Radhakrishnan, and Dror Rawitz. Online set packing. SIAM Journal on Computing, 41(4):728–746, 2012. doi:10.1137/110820774.
  • [14] Paul Erdős and László Lovász. Problems and results on 3-chromatic hypergraphs and some related questions. In Infinite and Finite Sets (Colloq. Math. Soc. J. Bolyai, Vol. 11), pages 609–627. North-Holland, 1975.
  • [15] Martin Fürer and Huiwen Yu. Approximating the k -set packing problem by local improvements. In Combinatorial Optimization - Third International Symposium, ISCO, volume 8596 of Lecture Notes in Computer Science, pages 408–420. Springer, 2014. doi:10.1007/978-3-319-09174-7_35.
  • [16] Matthias Gehnen, Henri Lotze, and Peter Rossmanith. Online simple knapsack with bounded predictions. In STACS, volume 289 of LIPIcs, pages 37:1–37:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.STACS.2024.37.
  • [17] Mohammad H. Hajiesmaili. Trade-off analysis in learning-augmented algorithms with societal design criteria. SIGMETRICS Perform. Evaluation Rev., 51(2):53–58, 2023. doi:10.1145/3626570.3626590.
  • [18] Magnús M. Halldórsson, Jan Kratochvíl, and Jan Arne Telle. Independent sets with domination constraints. Discret. Appl. Math., 99(1-3):39–54, 2000. doi:10.1016/S0166-218X(99)00124-9.
  • [19] Elad Hazan, Shmuel Safra, and Oded Schwartz. On the complexity of approximating k-set packing. Comput. Complex., 15(1):20–39, 2006. doi:10.1007/S00037-006-0205-6.
  • [20] Sungjin Im, Ravi Kumar, Mahshid Montazer Qaem, and Manish Purohit. Online knapsack with frequency predictions. In NeurIPS, pages 2733–2743, 2021. URL: https://dl.acm.org/doi/10.5555/3540261.3540470.
  • [21] Suho Kang, Ziyang Liu, and Rajan Udwani. A black-box approach for exogenous replenishment in online resource allocation. In International Conference on Integer Programming and Combinatorial Optimization, pages 326–340. Springer, 2025. doi:10.1007/978-3-031-93112-3_24.
  • [22] Richard M. Karp. Reducibility among combinatorial problems. In Proceedings of a symposium on the Complexity of Computer Computations, The IBM Research Symposia Series, pages 85–103, 1972. doi:10.1007/978-1-4684-2001-2_9.
  • [23] Petr Kolman and Christian Scheideler. Improved bounds for the unsplittable flow problem. Journal of Algorithms, 61(1):20–44, 2006. doi:10.1016/j.jalgor.2004.07.006.
  • [24] Dennis Komm. An introduction to online computation. Springer, 2016. URL: https://link.springer.com/book/10.1007/978-3-319-42749-2.
  • [25] Gilbert Laporte. Fifty years of vehicle routing. Transportation science, 43(4):408–416, 2009. doi:10.1287/trsc.1090.0301.
  • [26] Adam Lechowicz, Rik Sengupta, Bo Sun, Shahin Kamali, and Mohammad Hajiesmaili. Time fairness in online knapsack problems. In ICLR, 2024. URL: https://openreview.net/forum?id=9kG7TwgLYu.
  • [27] Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. Journal of the ACM (JACM), 68(4):1–25, 2021. doi:10.1145/3447579.
  • [28] Giusy Macrina, Luigi Di Puglia Pugliese, Francesca Guerriero, and Gilbert Laporte. Drone-aided routing: A literature review. Transportation Research Part C: Emerging Technologies, 120:102762, November 2020. doi:10.1016/j.trc.2020.102762.
  • [29] Alberto Marchetti-Spaccamela and Carlo Vercellis. Stochastic on-line knapsack problems. Mathematical Programming, 68:73–104, 1995. doi:10.1007/BF01585758.
  • [30] Thorben Tröbst and Rajan Udwani. Almost tight bounds for online hypergraph matching. Operations Research Letters, 55:107143, 2024. doi:10.1016/j.orl.2024.107143.
  • [31] Ali Zeynali, Bo Sun, Mohammad Hassan Hajiesmaili, and Adam Wierman. Data-driven competitive algorithms for online knapsack and set cover. In AAAI, pages 10833–10841. AAAI Press, 2021. doi:10.1609/AAAI.V35I12.17294.
  • [32] Yunhong Zhou, Deeparnab Chakrabarty, and Rajan M. Lukose. Budget constrained bidding in keyword auctions and online knapsack problems. In Christos H. Papadimitriou and Shuzhong Zhang, editors, Internet and Network Economics, 4th International Workshop, WINE 2008, Shanghai, China, December 17-20, 2008. Proceedings, Lecture Notes in Computer Science, pages 566–576. Springer, 2008. doi:10.1007/978-3-540-92185-1_63.