Represent a -dimensional box by its side-length vector and allow axis permutations. A box fits another when its permuted dimensions are all strictly smaller. Sorting each vector reduces containment to coordinatewise strict comparison, by the sorted-coordinate criterion for box containment. For an input-order-preserving subsequence, the longest chain ending at position has one plus the greatest chain length at an earlier fitting position. This last-box decomposition proves the dynamic programming recurrence. Sorting all dimensions and testing all ordered index pairs takes running time. Arbitrary reordering is a different convention, handled by the containment Directed acyclic graph.
Let and be the separately sorted dimension vectors. Matching corresponding ranks proves the forward construction when every . Conversely, if , then the source dimensions from rank onward require distinct targets strictly larger than , but only the last target ranks could qualify. The pigeonhole principle rules out such a permutation. Strict inequality matters: equal side lengths do not fit under this convention. Sorting and checking gives an decision algorithm.

Articles by others on the same topic (0)

There are currently no matching articles.