开发者

Given a set of objects, how to calculate how many fit in a given volume?

This is more an algorithm question than programming, but it's implemented in programming so I'm asking it here.

I have a set of given objects with different known dimensions and need to figure out the max of objects that can be put inside another volume of known dimensions. What algorithms exist to explore this problem other than a combinatorial brute-force approach?

Also, if I assume they are not arranged, how many will fit?

Another way to look at it:

  1. What's the max of a set of LEGO blocks I can assemble to put inside a box and how do I calculate it?
  2. What's the max of a set开发者_开发问答 of LEGO blocks I can drop inside a box without arranging them and how do I calculate it?


This is a classic CS problem - read the wiki entry on Knapsack problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜