Algorithm for Items Best Fit/Arangement in a Box I was looking for an algorithm that will give the best fit arrangement of package items in a box. For example given a large box and various items with multiple shapes(can be rectangle, square and so on and so forth), how will I arrange the items so that it will fit in the box? DO we have already an algorithm for that? If yes, what algorithm is it?

If no, I was thinking of making an algorithm for it.
Yes, there are plenty of algorithms.

Here are some existing literature about packing rectangles.


What algorithm can be used for packing rectangles of different sizes into the smallest rectangle possible in a fairly optimal way? 
Pack rectangular objects of different sizes in a fixed size rectangle? 
Approximation Algorithms for Rectangle Packing Problems. 
Optimal rectangle packing.


Here are some libraries that can be used readily.


Python 2D rectangle packing library
Rectangle packing program
Github topic on packing algorithms