Fitting rectangles together in optimal fashion

筅森魡賤 提交于 2019-11-30 18:33:32
Unreason

Through packing images into square texture and Simon's answer I got to this link http://code.activestate.com/recipes/442299/

I did not check the recipe, but it seems to allow using non-square containers.

Grembo

I think what you describe is a variant of the "two dimensional bin packing" problem. The only difference is that you have the items and are trying to find the smallest rectangle.

This survey article is a good start.

The only way to guarantee and optimal solution is to brute force the answer. This quickly becomes unmanagable for personal computers when you have several rectangles, and allow for the possibility of rotation.

Wikipedia has a good article on packing problem http://en.wikipedia.org/wiki/Packing_problem

Here is a good description of a fast packing algorithm - http://www.codeproject.com/KB/web-image/rectanglepacker.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!