Algorithm for fitting 2D polygons in an area?

不羁岁月 提交于 2019-12-07 10:33:06

问题


Is there a standard for this? Algorithm name?

Say: I have 10 polygons of different sizes. I have an area of specific size.

I want to know how to fill the most polygons in that area, and how they are fitted.

Note: Polygons may be rotated depending on the restriction set.


回答1:


One possible name is a Packing Problem. It is related to the Knapsack Problem. These problems tend to be NP-hard, and many require heuristics. If you can constrain the allowed forms of polygons and of the area, there may exist a more efficient algorithm for your special case.




回答2:


You can have a look at "Dancing Links" in Wikipedia for Donald Knuth's solution to the exact cover problem - which includes tiling - your question can be looked at as a tiling problem




回答3:


IF (that's a big if) all your polygons were rectangles, and the area into which they are to fit is also a rectangle, then this would be called bin-packing, Google will overwhelm you with information about this. If they're not then I guess that you are looking for a variant of bin-packing, and I guess some more that you are into an NP problem for which 'try and test' is about the best algorithm around.



来源:https://stackoverflow.com/questions/1824711/algorithm-for-fitting-2d-polygons-in-an-area

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