A
A
Agiot2018-05-02 19:35:22
Algorithms
Agiot, 2018-05-02 19:35:22

How to solve the 0-1 knapsack problem (a variation of it)?

Let there be a set of objects, each of which has two parameters - weight and value. There is also a backpack of a certain capacity. The goal is to build a backpack with the maximum value of the items inside, while respecting the backpack's limit on the total weight. All items are one of a kind.
How to solve the backpack problem if the backpack is limited not only by the carrying capacity, but also by the number of items that can be put into it (moreover, the number of items should be equal to this limit, no more and no less)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question