I am looking for a pseudo-code solution for what is effective. A problem with several backpacks (the optimization operator is halfway down the page). I think this problem is NP Complete, so the solution should not be optimal, and if it is sufficiently effective and easy to implement, it will be good.
The problem is this:
- I have many work items, each of which takes a different (but fixed and known) amount of time to complete.
- I need to divide these work elements into groups in order to have the least number of groups (ideally), and each group of work elements takes no more than a given common threshold - say, 1 hour.
I am flexible about the threshold - it does not need to be hard applied, although it should be close. My idea was to distribute work items into boxes, where each bit represents 90% of the threshold, 80%, 70%, etc. Then I could compare items that occupy 90%, for those that occupy 10%, etc.
Any better ideas?
design algorithm knapsack-problem
Malcomtucker
source share