Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Knapsack problem
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Fully polynomial time approximation scheme ==== The [[fully polynomial time approximation scheme]] (FPTAS) for the knapsack problem takes advantage of the fact that the reason the problem has no known polynomial time solutions is because the profits associated with the items are not restricted. If one rounds off some of the least significant digits of the profit values then they will be bounded by a polynomial and 1/Ξ΅ where Ξ΅ is a bound on the correctness of the solution. This restriction then means that an algorithm can find a solution in polynomial time that is correct within a factor of (1-Ξ΅) of the optimal solution.<ref name="Vazirani, Vijay 2003"/> '''algorithm''' FPTAS '''is''' '''input:''' Ξ΅ β (0,1] a list A of n items, specified by their values, <math>v_i</math>, and weights '''output:''' S' the FPTAS solution P := max <math>\{v_i\mid 1 \leq i \leq n\} </math> // the highest item value K := Ξ΅ <math>\frac{P}{n}</math> '''for''' i '''from''' 1 '''to''' n '''do''' <math>v'_i</math> := <math>\left\lfloor \frac{v_i}{K} \right\rfloor</math> '''end for''' '''return''' the solution, S', using the <math>v'_i</math> values in the dynamic program outlined above '''Theorem:''' The set <math>S'</math> computed by the algorithm above satisfies <math>\mathrm{profit}(S') \geq (1-\varepsilon) \cdot \mathrm{profit}(S^*)</math>, where <math>S^*</math> is an optimal solution.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Knapsack problem
(section)
Add topic