I am looking for some pointers to algorithms that should allow tiles without overlapping different size rectangles.
Given a set of rectangles of different sizes, apply them to an area of size H x W without overlapping. The goal would be to maximize the space used, or vice versa - to minimize the area of gaps. If there is not enough space, go to the second area of the same size, etc.
It is assumed that each width and height of the rectangle is smaller than the corresponding dimensions of the tile area. Rectangles do not rotate or otherwise transform, i.e. Their sides are horizontal or vertical.
I'm not looking for ready-made code, just wondering which approaches / algorithms are best used to solve this problem.
source share