top | item 21643966

(no title)

danpat | 6 years 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.

discuss

order

jka|6 years ago

This is an excellent reference, thanks a lot. Have you tried this for meal planning, out of interest?

danpat|6 years ago

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).