Abstract: In this paper, we give a constant-time approximation algorithm for the knapsack problem. Using weighted sampling, with which we can sample items with probability proportional to their profits, our algorithm runs with query complexity O(ε − 4 logε − 1), and it approximates the optimal profit with probability at least 2/3 up to error at most an ε-fraction of the total profit. For the subset sum problem, which is a special case of the knapsack problem, we can improve the query complexity to O(ε − 1 logε − 1).
Loading