Anonymous user
Knapsack problem/Unbounded: Difference between revisions
m
added a ;Task: (bold) header, changed task query to a directive, added other whitespace to the task's preamble.
m (added a ;Task: (bold) header, changed task query to a directive, added other whitespace to the task's preamble.) |
|||
Line 1:
{{task|Classic CS problems and programs}}
See also: [[Knapsack problem/Bounded]], [[Knapsack problem/0-1]]▼
A
He knows that he can carry no more than 25 'weights' in total; and that the capacity of his knapsack is 0.25 'cubic lengths'.▼
▲He knows that he can carry no more than 25 'weights'
Looking just above the bar codes on the items he finds their weights and volumes. He digs out his recent copy of a financial paper and gets the value of each item.▼
▲Looking just above the bar codes on the items he finds their weights and volumes. He digs out his recent copy of a financial paper and gets the value of each item.
<table
style="text-align: left; width: 80%;" border="4"
Line 46:
nowrap="nowrap" valign="middle"><=25</td><td
style="background-color: rgb(255, 204, 255);" align="left"
nowrap="nowrap" valign="middle"><=0.25 </td></tr
</table>
<br>
He can only take whole units of any item, but there is much more of any item than he could ever carry
'''How many of each item does he take to maximise the value of items he is carrying away with him?'''▼
;Task:
Note: ▼
▲
# There are four solutions that maximise the value taken. Only one ''need'' be given.▼
▲;Note:
▲
<!-- All solutions
Line 65 ⟶ 71:
# (9, 0, 11) also minimizes weight and volume within the limits of calculation
-->
;Related tasks:
* [[Knapsack problem/0-1]]
<br><br>
=={{header|Ada}}==
|