Similar to the classic 2D strip packing problem, we want to put N blocks into a 2d strip and minimize the height of the strip. Each block has to be put at the fixed x-coordinate. The width and height of all blocks are integer.
Below is an example of 4 blocks:
you can only move every block up and down to reduce the overrall height. And a possible solution can be:
This problem originated from a memory allocation problem. For a computer, there are N known processes. Their start time and memory usage are different. We need to allocate memory properly to minimize the peak memory usage.
Does anyone have any clue to solve this problem?