Sort the two dimension vectors separately into ascending order, and . Then return true exactly when for every . Sorting costs and the coordinate comparisons cost .
Sufficiency follows by matching corresponding ranks and translating that rank matching back to the original axes. For necessity, suppose for some . The dimensions must all be assigned to strictly larger target dimensions. None of the first sorted target dimensions is large enough, leaving at most eligible slots. The pigeonhole principle gives a contradiction. This proves the sorted-coordinate criterion for box containment, including ties: equality fails the required strict fit.
Articles by others on the same topic
There are currently no matching articles.