Knapsack problem/Unbounded/Python dynamic programming: Difference between revisions

m
Line 76:
 
====DP, multiple size dimensions====
Our original problem has two dimensions to 'size': weight and volume. We can create a python size object, that kowsknows how to enumerate itself over its given dimensions, as well as perform logical and simple mathematical operations. With the use of the Size object, a correct solution to the given unbounded knapsack problem can be found by the following proceedure:
<lang python>from knapsack_sizer import makesize
 
Anonymous user