Algorithm to organise rectangles in the fixed rectangular container
问题 My problem is pretty similar to 2D Knapsack problem, or cutting stock with one exception... the rectangles that fit into the container can be resized and cropped. No rotation is allowed though. The challenge is to make as little crops as possible and fill entire container (no gaps whatsoever). Has anyone encountered an algorithm that would do something similar. Any links, pseudo code much appreciated. Kept the question generic, but I'd like to apply it to organise photos on a fixed size page.