Jump to content

Knapsack polynomial time solution


zak100

Recommended Posts

Hi,

I am trying to understand the FPTAS for the knapsack problem. I have got the following from wikepedia:

 

I have following questions:

 

(a)It shows two 2 ‘k’ symbols. I can’t understand the difference between them.

(b)Why its dividing the value  v_i with the value of ‘K’ which is a ratio of P/n multiply by epsilon

(c)what is the significance of Epsilon?

(d)why rounding would convert the problem into a polynomial time problem?

 

Somebody please guide me.

 

Zulfi.

cant understand difference between the 2 ks.jpg

Link to comment
Share on other sites

11 hours ago, zak100 said:

Hi,

I am trying to understand the FPTAS for the knapsack problem. I have got the following from wikepedia:

 

I have following questions:

(a)It shows two 2 ‘k’ symbols. I can’t understand the difference between them.

(b)Why its dividing the value  v_i with the value of ‘K’ which is a ratio of P/n multiply by epsilon

(c)what is the significance of Epsilon?

(d)why rounding would convert the problem into a polynomial time problem?

cant understand difference between the 2 ks.jpg

Hi again Zulfi!

(a) It is the same K, only the author used different typesetting, first for a K in normal text font, second with a K in math font.

(b) It makes the new value \(v_i'\) into a whole number value that is large (if \(\varepsilon\) is small) compared to the original real-valued \(v_i\).

(c) If \(\varepsilon\) is small, then the new  \(v_i'\) is big, and its size tells you about the size of \(v_i\) relative to the average \(P/n\) of all the different sizes.

(d) On https://en.wikipedia.org/wiki/Knapsack_problem you also have the dynamic programming algorithms that solve the problem in polynomial time for the new rounded weights.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.