boxing algorithm problem

276 Views Asked by At

This is a bit of a computational algorithm problem, I am not entirely sure if here would be the right place to ask this, but here is the problem.

I got some “containers” that each can hold 15, and I have a bunch of positive integers that are all less than 15, I need to put all these integers into as less containers as possible. At the beginning, there are already some partially filled containers, say 3 containers filled with x, y, z already, they still have space of 15-x, 15-y, 15-z that shouldn’t be wasted, beyond that, I can get as many empty containers as possible for fill the rest of those integers. How can I find the best arrangement as using the least amount of containers.

This is actually a problem I have encountered in a program meant for cloud server renting system. How should I approach this problem, or if there are already some known solutions to this? Any suggestion will be appreciated, thank you.