in reply to optimization problem
Sounds like Knapsack problem and family ... but I'm not sure about your side conditions.
ah sounds good:
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
So pick a negative value of -1 or negative number representing the precision.
You'll find plenty of implementations
... though be aware that it's NP hard, runtime will depend on how good your result has to be and if you need a guarantied optimal solution.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: optimization problem (Knapsack)
by spencoid (Acolyte) on Jun 10, 2018 at 23:34 UTC |