Hacker News new | ask | show | jobs
by danpat 2401 days ago
If you want to get fancy with your meal planning, you can use a constraint solver like Google's or-tools to figure out what recipes to cook to meet nutritional (and other) goals semi-optimally:

Example code:

https://github.com/google/or-tools/blob/stable/examples/pyth...

which solves the Stigler Diet problem: https://en.wikipedia.org/wiki/Stigler_diet

The combinatoric difficulty of optimal nutrition planning is not something I see brought up very often, and I find that fascinating in its own right. It's harder than it looks, and I feel many people don't understand why.

1 comments

This is an excellent reference, thanks a lot. Have you tried this for meal planning, out of interest?
Not seriously. I work on other similar optimization problems for my day job though, I can definitely imagine adding a bunch more complexity to guide the solver toward the right solution shape (price, volume, meal frequency, preferred foods, variety, etc).