![]() |
The Knapsack problem is an example of the combinational optimization problem. This problem is also commonly known as the “Rucksack Problem“. The name of the problem is defined from the maximization problem as mentioned below:
Types of Knapsack Problem:The knapsack problem can be classified into the following types:
1. Fractional Knapsack ProblemThe Fractional Knapsack problem can be defined as follows:
Some practice problems on 0/1 Knapsack:
2. 0/1 Knapsack ProblemThe 0/1 Knapsack problem can be defined as follows:
Mathematically the problem can be expressed as:
Some practice problems on 0/1 Knapsack: Following are the differences between the 0/1 knapsack problem and the Fractional knapsack problem.
3. Bounded Knapsack ProblemThe Bounded Knapsack problem can be defined as follows:
Mathematically the problem can be expressed as:
Some practice problems on Bounded Knapsack: 4. Unbounded Knapsack ProblemThe Unbounded Knapsack problem can be defined as follows:
Mathematically the problem can be expressed as:
Some practice problems on Unbounded Knapsack: Variations of Knapsack Problem:There are several variations possible for the Knapsack Problem. Some of the well-known variations are provided below: 1. Multi-objective Knapsack problem:In this variation, the goal of filling the knapsack changes. Instead of maximizing only the value, there can be several other objectives. For example: Consider you are organizing a music show in a hall that has a capacity of 10,000. You are organizing a show and the size of the audience depends on the popularity of the singers. Also, the more popular the singer is, the more the fee. You want to maximize the profit and minimize the amount spend on the singer simultaneously and also want to bring as many singers as possible. 2. Multi-dimensional Knapsack problem:In this variation of the problem, the weight of any item i is given by an M dimensional vector {wi1, wi2, . . . wiM} and similarly, the capacity of the knapsack is also an M dimensional vector {W1, W2, . . . , WM}. 3. Multiple Knapsack problem:This variation of the knapsack problem is similar to the Bin Packing algorithm. The difference in both the problem is here we can pick a subset of the items whereas, in the Bin Packing problem, we have to pack all the items in any of the bins. The idea is that there are multiple knapsacks which may seem like adding capacity to the initial knapsack, but it is not similar to that at all. 4. Quadratic Knapsack problem:This variation has the goal of achieving the maximum value of a quadratic objective function that is subjected to binary and linear capacity constraints. 5. Geometric Knapsack problem:In this variation, there is a set of rectangles with different values and a rectangular knapsack. The goal is to pack the largest possible value into the knapsack. Applications of the Knapsack Problem:The Knapsack problem has several real-life applications. Some of them are mentioned here:
|
Reffered: https://www.geeksforgeeks.org
Algorithms |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |