We analyze the competitive ratio and the advice complexity of the online unbounded knapsack problem. An instance is given as a sequence of n items with a size and a value each, and an algorithm has to decide how often to pack each item into a knapsack of bounded capacity. The items are given online and the total size of the packed items must not exceed the knapsack's capacity, while the objective is to maximize the total value of the packed items. While each item can only be packed once in the classical 0-1 knapsack problem, the unbounded version allows for items to be packed multiple times. We show that the simple unbounded knapsack problem, where the size of each item is equal to its value, allows for a competitive ratio of 2. We also analyze randomized algorithms and show that, in contrast to the 0-1 knapsack problem, one uniformly random bit cannot improve an algorithm's performance. More randomness lowers the competitive ratio to less than 1.736, but it can never be below 1.693. In the advice complexity setting, we measure how many bits of information the algorithm has to know to achieve some desired solution quality. For the simple unbounded knapsack problem, one advice bit lowers the competitive ratio to 3/2. While this cannot be improved with fewer than log(n) advice bits for instances of length n, a competitive ratio of 1+epsilon can be achieved with O(log(n/epsilon)/epsilon) advice bits for any epsilon>0. We further show that no amount of advice bounded by a function f(n) allows an algorithm to be optimal. We also study the online general unbounded knapsack problem and show that it does not allow for any bounded competitive ratio for deterministic and randomized algorithms, as well as for algorithms using fewer than log(n) advice bits. We also provide an algorithm that uses O(log(n/epsilon)/epsilon) advice bits to achieve a competitive ratio of 1+epsilon for any epsilon>0.
翻译:本文分析了在线无界背包问题的竞争比与建议复杂度。问题实例由包含n个物品的序列给出,每个物品具有尺寸和价值,算法需决定如何将每个物品多次装入容量有限的背包中。物品以在线方式给出,已装入物品的总尺寸不得超过背包容量,目标在于最大化已装入物品的总价值。在经典的0-1背包问题中每个物品仅能装入一次,而无界版本允许物品被重复装入。我们证明在简单无界背包问题(每个物品的尺寸等于其价值)中,存在竞争比为2的算法。同时分析了随机算法,并证明与0-1背包问题不同,单个均匀随机比特无法提升算法性能。增加随机性可将竞争比降低至1.736以下,但始终无法低于1.693。在建议复杂度框架下,我们量化了算法需获取多少比特信息才能达到特定解质量。对于简单无界背包问题,一个建议比特可将竞争比降至3/2。虽然对于长度为n的实例,少于log(n)个建议比特无法进一步改进,但通过O(log(n/epsilon)/epsilon)个建议比特可实现1+epsilon的竞争比(对任意epsilon>0)。进一步证明任何以函数f(n)为界的建议量都无法使算法达到最优。我们还研究了在线一般无界背包问题,证明对于确定性算法、随机算法以及使用少于log(n)个建议比特的算法,该问题不存在有界竞争比。同时提出一种使用O(log(n/epsilon)/epsilon)个建议比特的算法,对任意epsilon>0均可实现1+epsilon的竞争比。