# Math Puzzle: calculating the dimensions of variable rectangles in a fixed square

I've got the following problem,

I've got a fixed size square and within there are a fixed number of rectangles to be contained within it. I want the rectangles to cover the maximum amount of space within the square. The size of the rectangles is determined by a weighting. The higher the value of an individual weight of a rectangle, the bigger its surface area.

Assuming I have a predetermined weighting for all 9 rectangles, how do I derive at the coordinates (for their position in the square) and their dimensions (width and length).

this has had me puzzled, hope someone can help me out...thanks!!

-
Could you make your question a bit more specific? – Thierry Zell Aug 15 '10 at 2:55

With no more constraints than this, a simple tiling arises by making all the lengths the same as the side of the square, and the widths proportional to the weights.

In other cases, there are existing algorithms (for example, cUtting board out of logs) that employ such heuristics. Care to tell us more?