What is the most accurated algorithm to Knapsack when weight and values are positive?
What is the most accurated algorithm to Knapsack when weight and values are positive?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
not sure what language your using but Wikipedia has a great page on information and algorithms to solve it. If you want more sample code to understand how to do it, check this site out: http://rosettacode.org/wiki/Knapsack_problem/Unbounded/Python_dynamic_programming (this is all in python but there’s more languages).
Basically it depends on what your doing but the most common way to solve this is dynamic programming.