7 December 2020

The ever-elusive riddle: What's the best way to cut Christmas cookies?

Result

At some point in life, most people have stood over a rolled-out slab of cookie dough and pondered just how to best cut out cookies with as little waste as possible. Now, even math experts have given up on finding a computer algorithm to answer this type of geometric problem.

Photo: Getty Images
Photo: Getty Images

How can we maximize dough while cutting out Christmas cookies? How do we pack a suitcase or fill a kitchen cabinet while making the best use of space? One may have thought, “there must be a best way to do this.” Pondering such questions too deeply now appears to be a complete waste of time. The science is now here to support that it is impossible, for the time being, to figure out what works best for more than four or five spicy gingerbread men or Christmas tree cookies.

Assistant Professor Mikkel Abrahamsen of the Department of Computer Science and two research colleagues studied how difficult it is to figure out the optimal way to pack objects in two dimensions without overlap — a conundrum that computer scientists have plugged away at for decades.

"While algorithms let us solve seriously complex problems, this is one that remains too much of a mouthful for today’s computers. For now, it isn’t possible to pack more than 5-10 objects optimally. And, our result suggests that this number probably won’t increase much for the time being," explains Mikkel Abrahamsen.

Packing things optimally isn’t just an occasional problem at home, but in a variety of industries, including clothing manufacturing and metal processing. In each case, it is important to cut out materials with as little waste possible. In shipping, it applies to the packing of containers.

Only four gingerbread cookies

We know the size of the smallest square container in which we can pack up to 10 square 1x1 meter pallets. But by simply adding one additional pallet, it becomes impossible to calculate the optimal size of the container. Abrahamsen explains:

“As more pallets are added, the calculation time increases beyond exponentially. Not even the best computers can keep up. Theoretically it's possible. But based upon the speed at which computing power is growing, it will probably take millions of years before we are able to optimize the handling of a few additional objects."   

Furthermore, if one is working with more complicated shapes, like Christmas tree-shaped gingerbread, Mikkel Abrahamsen says that optimal solutions can only be found for up to four objects today. 

Left: Optimal packing of five squares. Right: The currently best known packing of eleven unit squares into a larger square.
Left: Optimal packing of five squares. Right: The currently best known packing of eleven unit squares into a larger square.

An infinite number of options

What makes it so difficult? Abrahamsen explains that the problem is similar to solving equations of degree five or higher, and with many unknowns. Here, it is known that such a solution cannot always be written down using regular arithmetic operations.

"Our study proves that the problem has a nature that we in mathematics refer to as continuous — which in a nutshell, means that one must know all of the coordinates at which the cookies can be placed and all of the angles at which they can be rotated," explains Abrahamsen.

As the possible combinations are infinite, there is no way to create a list of all the locations needed to try in order to find an optimal packing solution. Instead, algorithms that solve packing problems optimally need to be more analytical, which is time consuming. This contrasts with many other known algorithmic problems, where one can try a limited number of combinations before finding one that is optimal. Thus, packing problems are much more difficult.

So in practice, there are no better solutions to packing problems than the ones we humans can come up with.

"In both industry and over the kitchen counter we must continue to be satisfied with our less-than-optimal solutions and rest assured that we humans are still better than computers for these types of tasks — for the time being," concludes Mikkel Abrahamsen.