Recipes for the Planet
I’m not sure between this project and optime, which was the chicken and which the egg. Did I just need a guinea pig project to test my optimizer or did I make an optimizer for this project?
Anyway, most probably I got a bit carried away after reading this article on Our World in Data: Environmental Impacts of Food Production. The article compares a number of food products based on CO2 emissions, land use, water use, eutrophication per kg but also per 100 g of protein, 100 g of fat and per 1000 kcal.
I thought it would be interesting to take this one step further and use this data to create ‘recipes’ that would target a certain nutritional value (in terms of kcal, grams of fat, grams of protein) while minimizing the environmental impact. This problem seemed perfect for a genetic algorithm, et voila: optime was born (or, optime was laid and then I needed something to try it out et voila, this project hatched)!
Turns out, neither chickens nor eggs in the most optimal recipe, but pain-au-chocolat and pumpkin seeds! You may get different results because of the random events (something with gods and dice).
You can directly open and explore the Notebook in Google Colab here:
Or download it on GitHub here.
Here’s a graph of how the optimizer optimized the optimization goals:
And one of the top recipes:
Which sounds delicious and has the following nutritional value and environmental impact:
kg 1.052732
kcal 2505.851226
g protein 71.942087
g fat 97.814726
Emissions 1.226780
Land use 2.623058
Eutrophication 7.946141
Water withdrawals 230.737192
The Notebook allows you to limit the number of ingredients, which will lead to sub-optimal but more practical recipes!
See if you can tweak the parameters in the Notebook to get closer to the target nutritional targets at lower environmental impact!
Let me know if you have suggestions for improvements. Not on the recipe but on the notebook.