diff --git a/Competitive Coding/Greedy/Knapsack/README.md b/Competitive Coding/Greedy/Knapsack/README.md new file mode 100644 index 000000000..1ae6579ca --- /dev/null +++ b/Competitive Coding/Greedy/Knapsack/README.md @@ -0,0 +1,22 @@ +# 0-1 Knapsack Problem +------------------------- + + + The knapsack problem or **rucksack problem** is a problem in *combinatorial optimization* : Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. It derives its name from the problem faced by someone who is constrained by a fixed-size knapsack and must fill it with the most valuable items. + + ## Applications + ----------------------------- + Knapsack problems appear in real-world decision-making processes in a wide variety of fields: + * Finding the least wasteful way to cut raw materials + * Selection of investments and portfolios + * Selection of assets for asset-backed securitization + * Generating keys for the Merkle–Hellman cryptosystems + +## Computational Complexity + -------- + * The decision problem form of the knapsack problem is NP-complete + * The optimization problem is NP-hard + * There is a pseudo-polynomial time algorithm using dynamic programming + * Many cases that arise in practice, and "random instances" from some distributions, can nonetheless be solved exactly + + 