How is 2D bin packing achieved programmatically?

I Googled “bin packing code” and this was my first hit: http://codeincomplete.com/posts/2011/5/7/bin_packing/ Here’s a summary: build a binary tree. Each branch in the tree contains a sprite. Each leaf node represents available space. Initially the tree has just the root node, which represents all available space. To add a sprite to the tree, search the … Read more

How can I programmatically determine how to fit smaller boxes into a larger package? [closed]

This is a Bin Packing problem, and it’s NP-hard. For small number of objects and packages, you might be able to simply use the brute force method of trying every possibility. Beyond that, you’ll need to use a heuristic of some sort. The Wikipedia article has some details, along with references to papers you probably … Read more

tech