Intro to Knapsack Issue, its Types and How to fix them

The Knapsack issue is an example of the combinational optimization issue. This issue is likewise frequently called the “ Rucksack Issue“. The name of the issue is specified from the maximization issue as discussed listed below:

Provided a bag with optimum weight capability of W and a set of products, each having a weight and a worth related to it. Choose the variety of each product to take in a collection such that the overall weight is less than the capability and the overall worth is optimized.

Kinds Of Knapsack Issue:

The knapsack issue can be categorized into the list below types:

  1. Fractional Knapsack Issue
  2. 0/1 Knapsack Issue
  3. Bounded Knapsack Issue
  4. Unbounded Knapsack Issue

The Fractional Knapsack issue can be specified as follows:

Provided the weights and worths of N products, put these products in a knapsack of capability W to get the optimum overall worth in the knapsack. In Fractional Knapsack, we can break products for optimizing the overall worth of the knapsack.

Some practice issues on 0/1 Knapsack:

The 0/1 Knapsack issue can be specified as follows:

We are offered N products where each product has some weight ( w i) and worth ( v i) related to it. We are likewise offered a bag with capability W The target is to put the products into the bag such that the amount of worths related to them is the optimum possible.

Keep In Mind that here we can either put a product entirely into the bag or can not put it at all.

Mathematically the issue can be revealed as:

Optimize sum_{i = 1}^{N}v_{i}x_{i}    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    and x i ∈ {0, 1}

Some practice issues on 0/1 Knapsack:

Following are the distinctions in between the 0/1 knapsack issue and the Fractional knapsack issue

Sr. No

0/1 knapsack issue

Fractional knapsack issue

1. The 0/1 knapsack issue is resolved utilizing vibrant shows technique. Fractional knapsack issue is resolved utilizing a greedy technique.
2. The 0/1 knapsack issue has not an ideal structure. The fractional knapsack issue has an ideal structure.
3. In the 0/1 knapsack issue, we are not enabled to break products. Fractional knapsack issue, we can break products for optimizing the overall worth of the knapsack.
4. 0/1 knapsack issue, discovers a most important subset product with an overall worth less than equivalent to weight. In the fractional knapsack issue, discovers a most important subset product with an overall worth equivalent to the weight.
5. In the 0/1 knapsack issue we can take items in an integer worth. In the fractional knapsack issue, we can take items in portions in drifting points.

The Bounded Knapsack issue can be specified as follows:

Provided N products, each product having actually an offered weight w i and a worth v i, the job is to make the most of the worth by picking an optimum of K products amounting to an optimum weight W

Mathematically the issue can be revealed as:

Optimize sum_{i = 1}^{N}v_{i}x_{i}    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    and x i ∈ {0, 1, …, K}

Some practice issues on Bounded Knapsack:

4. Unbounded Knapsack Issue

The Unbounded Knapsack issue can be specified as follows:

Provided a knapsack weight W and a set of N products with specific worth v i and weight w i, we require to determine the optimum quantity that might comprise this amount precisely. This is various from 0/1 Knapsack issue, here we are enabled to utilize an unrestricted variety of circumstances of a product.

Mathematically the issue can be revealed as:

Optimize sum_{i = 1}^{N}v_{i}x_{i}    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    based on sum_{i = 1}^{N}w_{i}x_{i} leq W    and x_{i} epsilon mathbb{Z}    and x i ≥ 0.

Some practice issues on Unbounded Knapsack:

Variations of Knapsack Issue:

There are numerous variations possible for the Knapsack Issue. A few of the widely known variations are offered listed below:

1. Multi-objective Knapsack issue:

In this variation, the objective of filling the knapsack modifications. Rather of optimizing just the worth, there can be numerous other goals.

For instance: Consider you are arranging a music program in a hall that has a capability of 10,000. You are arranging a program and the size of the audience depends upon the appeal of the vocalists. Likewise, the more popular the vocalist is, the more the charge. You wish to make the most of the earnings and lessen the quantity invest in the vocalist at the same time and likewise wish to bring as lots of vocalists as possible.

2. Multi-dimensional Knapsack issue:

In this variation of the issue, the weight of any product i is offered by an M dimensional vector {w i1, w i2, … w iM} and likewise, the capability of the knapsack is likewise an M dimensional vector {W 1, W 2, …, W M}.

3. Numerous Knapsack issue:

This variation of the knapsack issue resembles the Bin Loading algorithm The distinction in both the issue is here we can select a subset of the products whereas, in the Bin Packaging issue, we need to load all the products in any of the bins. The concept is that there are several knapsacks which might appear like including capability to the preliminary knapsack, however it is not comparable to that at all.

4. Quadratic Knapsack issue:

This variation has the objective of accomplishing the optimum worth of a quadratic unbiased function that goes through binary and direct capability restraints.

5. Geometric Knapsack issue:

In this variation, there is a set of rectangular shapes with various worths and a rectangle-shaped knapsack. The objective is to load the biggest possible worth into the knapsack.

Applications of the Knapsack Issue:

The Knapsack issue has numerous real-life applications. A few of them are discussed here:

  • Among the early applications of the Knapsack issue remained in building and construction and scoring of examinations in which the test takers have an option regarding which concerns they respond to.
  • The subset amount issue is resolved utilizing the idea of the Knapsack issue.
  • The several unbiased variations of the Knapsack issue is often utilized for transport logistics optimization issues.
  • The several knapsack issue is frequently utilized in lots of loading and scheduling algorithms in Operational Research study.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: