Solving the Restricted Quadratic Multi-Knapsack Problem (RQMKP) with mathematical programming and Python
Dr. Hannah Fry’s book, The Mathematics of Love [1], is one of those rare finds, smart, funny, and incredibly easy to read. I enjoyed it so much that I ended up giving copies to some of my closest friends. They loved it too, but a few of them hit a snag with Chapter 8, which, ironically, was the chapter they were most excited about.
This chapter goes into the tricky business of organizing wedding seating arrangements, using mathematical programming and optimization to figure out how to seat guests so everyone has the best time possible. Sounds cool, right? But here’s the catch, the book doesn’t actually walk you through how to set up or solve the problem, which left my friends feeling a bit lost.
Now, I know what you’re thinking: wedding seating? Really? But don’t be fooled , it’s a really difficult problem to solve, and the solution has way more applications than just weddings (although this one is already important). Think organizing tables on cruise ships [3], forming sports teams or workgroups, optimizing portfolios, and in my world as a business school professor…