Skip to Main Content
The knapsack problem can and has been used to model many resource sharing problems. The allocation of a portion of a resource to a particular agent provides a benefit to the system, but also blocks other agents from utilizing that portion of the resource. For a problem where the number of agents as well as each agent's demand and potential benefit are known prior to any decision being made, the optimal allocation and its value can be calculated. In many situations these values are not known initially, but only learned over time. Online algorithms and competitive analysis are often employed when a problem requires decisions to be made prior to having all information available. In this paper we suggest an online version of the knapsack problem, provide some justification for the model, give the exact competitive ratio for the problem in the deterministic case, and provide bounds on the competitive ratio in the randomized case.