English

Online Unit Profit Knapsack with Untrusted Predictions

Data Structures and Algorithms 2022-03-02 v1

Abstract

A variant of the online knapsack problem is considered in the settings of trusted and untrusted predictions. In Unit Profit Knapsack, the items have unit profit, and it is easy to find an optimal solution offline: Pack as many of the smallest items as possible into the knapsack. For Online Unit Profit Knapsack, the competitive ratio is unbounded. In contrast, previous work on online algorithms with untrusted predictions generally studied problems where an online algorithm with a constant competitive ratio is known. The prediction, possibly obtained from a machine learning source, that our algorithm uses is the average size of those smallest items that fit in the knapsack. For the prediction error in this hard online problem, we use the ratio r=aa^r=\frac{a}{\hat{a}} where aa is the actual value for this average size and a^\hat{a} is the prediction. The algorithm presented achieves a competitive ratio of 12r\frac{1}{2r} for r1r\geq 1 and r2\frac{r}{2} for r1r\leq 1. Using an adversary technique, we show that this is optimal in some sense, giving a trade-off in the competitive ratio attainable for different values of rr. Note that the result for accurate advice, r=1r=1, is only 12\frac{1}{2}, but we show that no algorithm knowing the value aa can achieve a competitive ratio better than e1e0.6321\frac{e-1}{e}\approx 0.6321 and present an algorithm with a matching upper bound. We also show that this latter algorithm attains a competitive ratio of re1er\frac{e-1}{e} for r1r \leq 1 and ere\frac{e-r}{e} for 1r<e1 \leq r < e, and no algorithm can be better for both r<1r<1 and 1r<e1\leq r<e.

Keywords

Cite

@article{arxiv.2203.00285,
  title  = {Online Unit Profit Knapsack with Untrusted Predictions},
  author = {Joan Boyar and Lene M. Favrholdt and Kim S. Larsen},
  journal= {arXiv preprint arXiv:2203.00285},
  year   = {2022}
}
R2 v1 2026-06-24T09:57:27.788Z