I'm trying to implement 2D bin packing using the Maximal rectangles algorithms as in the following paper.
http://clb.demon.fi/files/RectangleBinPack.pdf
In order to implement this, what type of a data structure will be most appropriate? After googling I found there are different implementation of Guillotine packing algorithm using trees. Can the same approach be applied to this as well. The algorithm itself is not much clear to me. Can I have more clarification on this as well.
I stumbled on something when researching for automatic CSS sprite generation. I think in the source the rectangles where represented by tuples, the actual algorithm worked with a binary tree. Maybe it is useful to you.
http://codeincomplete.com/posts/2011/5/7/bin_packing/
edit here is the code sample from https://github.com/jakesgordon/bin-packing/blob/master/js/packer.js