This problem can be described as follows;
given a rectangle, the width and height can be randomly large number; and given some smaller rectangles or squares, means basic element, such as 6*6, 8*4, 4*4, 6*4, 4*4, 2*2, 1*1; is there some algorithm to cover the given rectangle efficiently? there are two constraints,
- it's better to use the same basic element;
- cover the bigger basic element first.
For example, give a 8*8 square; can be divided into one 6*6, and then seven 2*2; the other option is four 4*4; the other option is two 8*4; and another option is eight 1*1; and there are still some other options to get the 8*8 square. Use the two constraints given, will choose two 8*4 as best result.
Is there some good algorithm to solve this problem?