The question is really simple, i have an array of random sized squares (width, height) and a fixed width surface. What's the best efficient algorithm to arrange squares on this surface? There must be no useless gap between squares. Is it possible at all? Without using AI or heavy processing?
Something similar to this picture, but assume that my surface is not bounded at bottom, its a fixed-width and unbounded height surface.