Knapsack problem/Continuous: Difference between revisions

m
copy edit - wiki link to wikipedia
(→‎{{header|OCaml}}: Added PureBasic)
m (copy edit - wiki link to wikipedia)
Line 1:
{{task|Classic CS problems and programs}}
 
See also: [[Knapsack problem]] and [http[wp://en.wikipedia.org/wiki/Continuous_knapsack_problem |Wikipedia]].
 
A robber burgles a butcher's shop, where he can select from some items. He knows the weights and prices of each items. Because he has a knapsack with 15 kg maximal capacity, he wants to select the items such that he would have his profit maximized. He may cut the items; the item has a reduced price after cutting that is proportional to the original price by the ratio of masses. That means: half of an item has half the price of the original.
Line 578:
=={{header|Ursala}}==
We might as well leave this one to the experts by setting it up as a
[http[wp://en.wikipedia.org/wiki/Linear_programming |linear programming]] problem and handing it off to an external library (which will be either [http://sourceforge.net/projects/lpsolve lpsolve] or
[http://www.gnu.org/software/glpk/glpk.html glpk] depending on the
[http://www.basis.uklinux.net/avram run-time system] configuration).