问题
Given are n
boxes in three dimension (h
, w
, d
). The goal is to stack them on top of each other to have a maximum height (boxes can be rotated). Each box that you put on top should have a smaller dimension (w
, d
) than the one below.
How can we do it with dynamic programming and greedy?
回答1:
This is the box stacking problem - problem 4 there.
If you want to think about it yourself, think about how you can adapt the longest increasing subsequence algorithm for solving this.
来源:https://stackoverflow.com/questions/4511086/box-stacking-problem