Press "Enter" to skip to content

Giving and wrapping gifts with the help of optimization

Now that the holiday season is upon us, the spirit of gift-giving is in full swing. Meanwhile, we students are finishing up our Fall semester classes. As a result, I hope to combine these two topics by discussing some of what I’ve learned from MA 630, a course on mathematical optimization, and how it applies to choosing and—more importantly—wrapping the perfect gift.

Optimization is a concept many of us are familiar with since an early taste of it appears in the introductory calculus courses most of us take at Stevens. A beautiful part of optimization is that we can determine whether some quantity is optimal (the best out of any possible outcome) based on the behavior of derivatives (or, in the multivariable setting, gradients) of certain other quantities. 

More precisely, if this quantity, usually called the objective function, has a derivative or gradient, we know that any optimal solution will be at a point where the function’s derivative (or gradient) is zero. We can also include constraints, which are important when we’re trying to bound our objective function in some way or only have so many resources available to us. 

A seasonal example of this is the problem of wrapping a gift so that you end up with the least amount of paper waste. Here, the objective function will be the surface area of the gift that you are trying to wrap, and the constraints would be a bound on how much paper and tape you have, or a limit on how much waste you want to have (it could be anything really, depending on what sort of constraint you care about). 

Many other people have thought about this, to the point where even companies have released memos to their employees on how to wrap gifts properly. There are also many YouTube videos that demonstrate how it’s done — if you’re reading this article online, you can watch some here and here. What’s common about all these strategies is their use of optimization to find the optimal strategy. 

It becomes a bit more complicated when you introduce constraints — these are when Lagrange multipliers enter the picture, and slightly different equations have to be solved. These equations will nevertheless involve derivatives (or gradients) of the objective function and functions that quantify the constraints. 

What I found fascinating about optimization is that optimal solutions can also be found in the case when we cannot take derivatives of our functions. This is the case of nonsmooth optimization, which also has its conditions and strategies for finding the optimal solution or set of optimal solutions. 

And it’s not even that far off from the smooth case — instead of gradients, we rely on a set of so-called subgradients that help us deal with points at which the objective function or constraint functions don’t have derivatives. I won’t go into the details as much here, but the upshot is that with nonsmooth optimization at our disposal, we can tackle many more problems.

One difficult problem might be choosing which gift will maximize the recipient’s happiness while minimizing the monetary cost (if the giver is on a budget). Fortunately, optimization gives you the tools to do this if you can define an objective function and constraints. 

The objective function might be way too much work to derive (I’ll leave it up to the readers to craft their own unique objective function for each recipient), but I hope that at least the gift-wrapping techniques are a practical help for you during the holidays. I also hope that you are all able to optimize your rest and recovery after a long semester — you got through lots of difficult experiences in courses and extracurriculars (as well as this article), so you deserve a break!