Problem Statement: You have n1 items of size s1, n2 items of size s2, and n3 items of size s3. You'd like to pack all of these items into bins each of capacity C, such that the total number of bins used is minimized.
My Solution:
Bin(C,N1,N2,N3) = max{Bin(C-N1,N1-1,N2,N3)+N1 if N1<=C and N1>0,
Bin(C-N2,N1,N2-1,N3)+N2 if N2<=C and N2>0,
Bin(C-N3,N1,N2,N3-1)+N3 if N3<=C and N3>0,
0 otherwise}
The above solution only fills a single bin efficiently. Can anybody suggest how to modify the above relation so that I get the total bins used for packing items efficiently?