Starting from:

$34.99

CS6515 Coding Project I Solution

Knapsack - 10 Points
In this assignment you will use the provided code template to implement a dynamic programming solution to Knapsack. Your solver needs to follow the prescribed guidelines given in the code comments – it should implement a non-recursive dynamic programming solution to the knapsack problem, finding the maximum value possible for a given maximum weight and list of possible items. Note that this solution should not allow for multiple copies of the same item.
Restrictions
• You must complete this assignment on your own; do not share your code with anyone and do not copy code from the Internet.
• Template code is provided and must be used.
• You code must be compatible with python 3.10.
• Do not modify the structure or program-flow of this assignment in any way – only add code where directed to do so by the code comments. Do not add functions, variables, or other code constructions except where told to do so – each individual component of your submission will be tested by the auto-grader when it is submitted.
A Base Case is provided for testing. The successful execution of your algorithm should print the following output to the console using the provided item list file (defaultItems.txt):
Results : The following items were chosen :
"banana" Wt : 27 Val : 60
"compass" Wt : 13 Val : 35
"glucose" Wt : 15 Val : 60
"map" Wt : 9 Val : 150
"note-case" Wt : 22 Val : 80
"sandwich" Wt : 50 Val : 160 "socks" Wt : 4 Val : 50
"sunglasses" Wt : 7 Val : 20
"suntan cream" Wt : 11 Val : 70
"water" Wt : 153 Val : 200
"waterproof overclothes" Wt : 43 Val : 75
"waterproof trousers" Wt : 42 Val : 70
For a total value of <1030> and a total weight of [396]
Submission
1

More products