I am looking for an algorithm that will solve my problem in the most efficient way.
Description of the problem:
I have a list of elements (only positive integers are allowed) and a fixed number of boxes of the same capacity. So far I have been thinking about a branching algorithm, but I'm not quite sure if this is the best approach in this case.
Example:
Given a list of items:
(3, 4, 4, 2, 3, 9, 2)
and three cells of capacity 9 each I need to pack them: (the order of the elements does not matter)
[3, 4, 2], [4, 3, 2], [9]
I think this is a variant of the packaging problem (I know NP-complete), but since I am not trying to minimize the number of drawers used, I wonder if there is a better solution.
source share