Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a noob, and I'm not a mathematician (Although I will be a Math major next semester). My question is:

I have 68 maps I would like to use as posters on my wall at home. They are all rectangles, and all different dimensions. Is there an algorithm (or better yet, a website or other simple computer program I can use) to take the dimensions of all these posters as input and then compute the optimal tiling arrangement on the wall so there is little as possible "wasted" empty space?

share|cite|improve this question
You have multiple copies of each of the 68 maps? – Aryabhata Sep 10 '10 at 20:52
Can any be turned sideways? – Larry Wang Sep 10 '10 at 21:34
See Jamie Zawinski's Picture Tile. – Dennis Williamson Sep 10 '10 at 22:45

This problem is known as 2-dimensional bin packing, and some algorithms for this problem can be found here:

share|cite|improve this answer

You are attempting to solve what is referred to as a "packing problem". It's generally a hard problem but for your case I think that the existing methods will work. Try looking here:

It seems he has already coded something. If it's not what you're after, google "rectangle packing" and I'm sure you'll run into something.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.