Online Simple Knapsack with Reservation Costs

Authors Hans-Joachim Böckenhauer , Elisabet Burjons , Juraj Hromkovič, Henri Lotze , Peter Rossmanith

Thumbnail PDF


  • Filesize: 0.88 MB
  • 18 pages

Document Identifiers

Author Details

Hans-Joachim Böckenhauer
  • Department of Computer Science, ETH Zürich, Switzerland
Elisabet Burjons
  • Department of Computer Science, RWTH Aachen, Germany
Juraj Hromkovič
  • Department of Computer Science, ETH Zürich, Switzerland
Henri Lotze
  • Department of Computer Science, RWTH Aachen, Germany
Peter Rossmanith
  • Department of Computer Science, RWTH Aachen, Germany


We want to thank the anonymous reviewers for pointing out imprecise formulations and helping to improve the overall quality of this work.

Cite AsGet BibTex

Hans-Joachim Böckenhauer, Elisabet Burjons, Juraj Hromkovič, Henri Lotze, and Peter Rossmanith. Online Simple Knapsack with Reservation Costs. In 38th International Symposium on Theoretical Aspects of Computer Science (STACS 2021). Leibniz International Proceedings in Informatics (LIPIcs), Volume 187, pp. 16:1-16:18, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2021)


In the Online Simple Knapsack Problem we are given a knapsack of unit size 1. Items of size smaller or equal to 1 are presented in an iterative fashion and an algorithm has to decide whether to permanently reject or include each item into the knapsack without any knowledge about the rest of the instance. The goal is then to pack the knapsack as full as possible. In this work, we introduce a third option additional to those of packing and rejecting an item, namely that of reserving an item for the cost of a fixed fraction α of its size. An algorithm may pay this fraction in order to postpone its decision on whether to include or reject the item until after the last item of the instance was presented. While the classical Online Simple Knapsack Problem does not admit any constantly bounded competitive ratio in the deterministic setting, we find that adding the possibility of reservation makes the problem constantly competitive, with varying competitive ratios depending on the value of α. We give upper and lower bounds for the whole range of reservation costs, with tight bounds for costs up to 1/6 - an area that is strictly 2-competitive - , for costs between √2-1 and 1 - an area that is strictly (2+α)-competitive up to ϕ -1, and strictly 1/(1-α)-competitive above ϕ-1, where ϕ is the golden ratio. With our analysis, we find a counterintuitive characteristic of the problem: Intuitively, one would expect that the possibility of rejecting items becomes more and more helpful for an online algorithm with growing reservation costs. However, for higher reservation costs above √2-1, an algorithm that is unable to reject any items tightly matches the lower bound and is thus the best possible. On the other hand, for any positive reservation cost smaller than 1/6, any algorithm that is unable to reject any items performs considerably worse than one that is able to reject.

Subject Classification

ACM Subject Classification
  • Theory of computation → Online algorithms
  • Online problem
  • Simple knapsack
  • Reservation costs


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Susanne Albers. Energy-efficient algorithms. Commun. ACM, 53(5):86-96, 2010. URL:
  2. Baruch Awerbuch, Yossi Azar, and Serge A. Plotkin. Throughput-competitive on-line routing. In 34th Annual Symposium on Foundations of Computer Science, Palo Alto, California, USA, 3-5 November 1993, pages 32-40. IEEE Computer Society, 1993. URL:
  3. Hans-Joachim Böckenhauer, Elisabet Burjons, Juraj Hromkovic, Henri Lotze, and Peter Rossmanith. Online simple knapsack with reservation costs. CoRR, abs/2009.14043, 2020. URL:
  4. Hans-Joachim Böckenhauer, Richard Dobson, Sacha Krug, and Kathleen Steinhöfel. On energy-efficient computations with advice. In Dachuan Xu, Donglei Du, and Ding-Zhu Du, editors, Computing and Combinatorics - 21st International Conference, COCOON 2015, Beijing, China, August 4-6, 2015, Proceedings, volume 9198 of Lecture Notes in Computer Science, pages 747-758. Springer, 2015. URL:
  5. Hans-Joachim Böckenhauer, Dennis Komm, Rastislav Královič, Richard Královič, and Tobias Mömke. Online algorithms with advice: The tape model. Inf. Comput., 254:59-83, 2017. URL:
  6. Hans-Joachim Böckenhauer, Dennis Komm, Richard Královič, and Peter Rossmanith. The online knapsack problem: Advice and randomization. Theor. Comput. Sci., 527:61-72, 2014. URL:
  7. Allan Borodin and Ran El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, 1998. Google Scholar
  8. Darryn E. Bryant. Packing paths in complete graphs. J. Comb. Theory, Ser. B, 100(2):206-215, 2010. URL:
  9. Stefan Dobrev, Rastislav Královič, and Dana Pardubská. Measuring the problem-relevant information in input. ITA, 43(3):585-613, 2009. URL:
  10. András Frank. Packing paths in planar graphs. Combinatorica, 10(4):325-331, 1990. URL:
  11. Xin Han, Yasushi Kawase, and Kazuhisa Makino. Online unweighted knapsack problem with removal cost. Algorithmica, 70(1):76-91, 2014. URL:
  12. Xin Han, Yasushi Kawase, Kazuhisa Makino, and Haruki Yokomaku. Online knapsack problems with a resource buffer. In Pinyan Lu and Guochuan Zhang, editors, 30th International Symposium on Algorithms and Computation, ISAAC 2019, December 8-11, 2019, Shanghai University of Finance and Economics, Shanghai, China, volume 149 of LIPIcs, pages 28:1-28:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL:
  13. Juraj Hromkovič, Rastislav Královič, and Richard Královič. Information complexity of online problems. In Petr Hliněný and Antonín Kučera, editors, Mathematical Foundations of Computer Science 2010, 35th International Symposium, MFCS 2010, Brno, Czech Republic, August 23-27, 2010. Proceedings, volume 6281 of Lecture Notes in Computer Science, pages 24-36. Springer, 2010. URL:
  14. Oscar H. Ibarra and Chul E. Kim. Fast approximation algorithms for the knapsack and sum of subset problems. J. ACM, 22(4):463-468, 1975. URL:
  15. Sandy Irani, Sandeep K. Shukla, and Rajesh Gupta. Algorithms for power savings. ACM Trans. Algorithms, 3(4):41, 2007. URL:
  16. Kazuo Iwama and Shiro Taketomi. Removable online knapsack problems. In Peter Widmayer, Francisco Triguero Ruiz, Rafael Morales Bueno, Matthew Hennessy, Stephan J. Eidenbenz, and Ricardo Conejo, editors, Automata, Languages and Programming, 29th International Colloquium, ICALP 2002, Malaga, Spain, July 8-13, 2002, Proceedings, volume 2380 of Lecture Notes in Computer Science, pages 293-305. Springer, 2002. URL:
  17. Kazuo Iwama and Guochuan Zhang. Online knapsack with resource augmentation. Inf. Process. Lett., 110(22):1016-1020, 2010. URL:
  18. Richard M. Karp. Reducibility among combinatorial problems. In Raymond E. Miller and James W. Thatcher, editors, Proceedings of a symposium on the Complexity of Computer Computations, held March 20-22, 1972, at the IBM Thomas J. Watson Research Center, Yorktown Heights, New York, USA, The IBM Research Symposia Series, pages 85-103. Plenum Press, New York, 1972. URL:
  19. Dennis Komm. An Introduction to Online Computation - Determinism, Randomization, Advice. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2016. URL:
  20. Alberto Marchetti-Spaccamela and Carlo Vercellis. Stochastic on-line knapsack problems. Math. Program., 68:73-104, 1995. URL:
  21. Alexander Schrijver and Paul D. Seymour. Packing odd paths. J. Comb. Theory, Ser. B, 62(2):280-288, 1994. URL:
  22. Daniel Dominic Sleator and Robert Endre Tarjan. Amortized efficiency of list update and paging rules. Commun. ACM, 28(2):202-208, 1985. URL:
  23. Natalia Vanetik. Path packing and a related optimization problem. J. Comb. Optim., 17(2):192-205, 2009. URL: