Knapsack Problem IRL

Orders for placing Girl Scout cookies are starting to hit the workplace email lists which is always a unique buying experience. The cookies are available for a limited time so you have to order when you can especailly since I always seem to run into girls selling them when I don’t have any cash on me (time for a Square charitable collaboration?).

This year I decided to apply the knapsack algorithm to find the best possible approach to buying cookies. I used the code from the wikipedia page, and edited it for GS cookies. Since I bike most days I limited the weight to 80 ounces. I wanted to maximize for the cookies I liked as well as maximize the number of cookies I would get.

Looks like the Savannah smiles really threw off my preferences:
4 of: do-si-does
3 of: samoas
1 of: savannah smiles

Regardless, I am looking forward to getting my order!

Try for yourself with this gist