Problem 2072. Packing Santa's Sleigh: First Layer

This Challenge is inspired by the Packing Santa's Sleigh contest at kaggle that runs until January 26, 2014.

The Bag has a 1000 x 1000 base with the contest having 1,000,000 packages.

This Challenge is to place as many of the first N Santa Presents onto the 1000 x 1000 grid. The packages have been presorted to have Z as max, not provided, thus minimizing the X*Y cross section. Only the first 240 packages are provided as package 241 busts the bag bottom making an area greater than 1,000,000. Packages out of sequence cause a severe penalty thus all packages less than the highest package used must fit on the board.

Input: Presents ; Presents(240,2)

Output: L, xyTL; L(1000,1000) of values 0:n<=240, 0 is unused space

Scoring: Unused Area

Example:

[2 2;3 3;1 2] is Presents

L

1 1 2 2 2 0  thru column 1000
1 1 2 2 2
3 3 2 2 2
0 0 0 0 0 0 rows 4 thru 1000 are zeros

xyTL [1 1;1 3;3 1]

Scores 1,000,000 - 15= 999985

Boxes 1:236 are possible, 97.5719% efficient pack in < 1sec.

TestSuite Sample Code:

In the TestSuite at the end is wrapper code for entering the kaggle contest. Update your SantaPack routine and execute the wrapper to see your contest score. The official presents.mat file needs to be downloaded. The wrapper has further discussion on efficient methods and current scores.

Solution Stats

57.14% Correct | 42.86% Incorrect
Last Solution submitted on Oct 01, 2020

Solution Comments

Show comments

Problem Recent Solvers4

Suggested Problems

More from this Author294

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!