I have 3 boxes of variable size:
A: 5, B: 3, C: 6
I have items of size a: 1, b: 2, c: 2, d: 3, e: 5
I could obviously fit them in the following pattern:
A: a, b, c
B: d
C: e
but you could also do it like this:
A: e
B: a, b
C: c, d
Is there a way I can get all possible packings like this?
This feels like a bin packing challenge but I'm not trying to find an "optimal" solution, just all (or at least multiple) possible solutions.
I imagine I could maybe run a naive bin packing algorithm over the items in a random order until a solution is hit but that seems really inefficient...
Any ideas?
I just implemented what you asked for
Output
We see some solutions repeating, that is because there are two numbers in the inputs which are same.