Talk:Knapsack problem/Unbounded: Difference between revisions

No edit summary
Line 8:
 
:Yes, in theory. Dynamic programming runs in time polynomial in the size of the sack weight, sack volume, and number of types of items; whereas the exhaustive search runs in time exponential in the number of types of items. But since the number of types of items here is so small (3), you won't see much of a difference. --[[User:Spoon!|Spoon!]] 07:04, 3 December 2008 (UTC)
 
:: I'm new to this big-O notation stuff, but I think my algorithm would run in time proportional to: <pre>the product of ( the minimum of ( max_restriction(r)/restriction(r of i) for all restrictions r ) ) for each item i </pre> I can't see the exponential? --[[User:Paddy3118|Paddy3118]] 07:44, 3 December 2008 (UTC)
Anonymous user