Talk:Knapsack problem/Unbounded: Difference between revisions

Line 20:
 
:::Note however that that page addresses a slightly different problem; the "0-1" problem, where you can take at most 1 of each item. Whereas in the problem here we can take as many of each item as we want. --[[User:Spoon!|Spoon!]] 02:48, 6 January 2009 (UTC)
 
==The problem with the PARI/GP solution==
 
Is that it output includes non-optimal solutions, something like:
<pre>$ 30000 : 0 panecea, 0 ichor, 12 gold
$ 31800 : 0 panecea, 1 ichor, 12 gold
$ 33600 : 0 panecea, 2 ichor, 12 gold
$ 35400 : 0 panecea, 3 ichor, 12 gold
$ 37200 : 0 panecea, 4 ichor, 12 gold
$ 39000 : 0 panecea, 5 ichor, 12 gold
$ 40100 : 0 panecea, 7 ichor, 11 gold
$ 41900 : 0 panecea, 8 ichor, 11 gold
$ 43700 : 0 panecea, 9 ichor, 11 gold
$ 45500 : 0 panecea, 10 ichor, 11 gold
$ 47300 : 0 panecea, 11 ichor, 11 gold
$ 49100 : 0 panecea, 12 ichor, 11 gold
$ 50900 : 0 panecea, 13 ichor, 11 gold
$ 52700 : 0 panecea, 14 ichor, 11 gold
$ 54500 : 0 panecea, 15 ichor, 11 gold
$ 54500 : 3 panecea, 10 ichor, 11 gold
$ 54500 : 6 panecea, 5 ichor, 11 gold
$ 54500 : 9 panecea, 0 ichor, 11 gold</pre>
 
You need to go the extra mile and reduce the output to the ''very'' "best", as the task description requires. --[[User:Paddy3118|Paddy3118]] 06:59, 30 October 2010 (UTC)
Anonymous user