[Math] How to divide a large rectangle into N smaller rectangles

algorithmsrectangles

I would like to divide a NxMpx rectangle(matrix) into X piece different size smaller rectangles. X is a variable so it dosn't have a fix value.The smaller rectangles must fill the 80-90% area of large one. Small rectangles must to be different area.

enter image description here

Is there any algorithm or formula to solve this kind of problems.

(Ideas, links are welcome. I'v already searched a lot of websites with google, but unfortunately nothing usefull, maybe i am using wrong keywords or i don't know.)

Thank You

Best Answer

The problem is that there are so many ways that you have not specified what you want well enough. You can just split the rectangle into $N$ horizontal or vertical stripes. You can cut those stripes as you do. You can even make four rectangles that leave a little bit of space in the middle.

Related Question