I have a couple of rectangles (~10'000 - 1'000'000) with various integer dimensions where each side is something between 1-10
I got to arrange these (without rotating) into a block of fixed width while minimizing height of the block (doesn't need to be the absolute minimum)
Additionally each rectangle is assigned a coordinate into some 2d vector space, and the packing algorithm should try to keep rectangles that are close-by each other in that vector space also more or less close-by each other in the packing (this in order to improve cache coherency)
Runtime performance of the algorithm is not very important.
Which algorithm is suitable for this problem?