I need to develop an algorith to determine the optimum packing arrangement of dimensionally identical rectangles in a large rectangle of fixed size. 90 degree rotations are permitted.
I've researched in to packing problems and tried to digest the contents of a few papers, but many seem to not be directly related to my problem. They seem to be concerned with finding the minimum number of larger rectangles required to pack a fixed number of random smaller rectangles.
My problem is, how many smaller rectangles can I pack in a single large rectangle?
I'm not a mathematition - I am engineer so this problem is not so much a theoretical one - this is a pallet packing arrangement of real items and so the "theoretical optimum" packing arrangement may not be the best for me.
I need to find a compromise between optimum and simplicity as the pallets will be packed by people. I appreciate that this might be difficult to quantify so I am also looking for advice on this. I was thinking a long the lines of setting an upper bound on the number of total 90degree rotations allowed in any one arrangement, as to maintain a good amount of order in the total arrangement.
Would very much appreciate the help.
Given your requirement for simplicity I would suggest dividing the pallet into two rectangular regions and packing the objects in the first region with the longer dimension in the direction of the longer dimension of the pallet and in the remaining rectangular region of the pallet packing them rotated by 90 degrees.
Then try the same thing but starting with packing the objects in the first region with the longer dimension in the smaller dimension of the pallet (obviously not necessary for a square pallet).
With such a simple arrangement, for any real world situations I can imagine, a simple brute-force search should be fast enough here.
The following python script can be a start for you (multiply licensed under any license approved by the Open Source Initiative, with addition of WTFPL):