|
|
|
|
|
by swalsh
2446 days ago
|
|
I ended up building my own solution to this problem too (though mine is not open to public) The main thing I wanted to optimize was menu planning. So I wrote a genetic algorithm which will generate a menu, add the score, mutate the menu in some way, and iterate. In my database I have a rough price per ingredient, and my families enjoyment of the recipe (though I have kind of a lagging gradient which reduces the score per recipe to prevent duplication). I also have included in my algorithm what I call slots. So something like a lasagna will take 4 slots where as a stir fry will be 1 slot. I sync my schedule and break it down to slots. This allows the algorithm to fit the recipe to the time available. I dont score slots though otherwise short recipes always win. Since the algorithm optimizes based on the week, but keeps a running inventory it's pretty good at maximizing my grocery bill and family enjoyment. My average grocery bill is between $40-$60 a week. And I cook 5 times a week. |
|
Although my goal was to find recipes that shared ingredients to cut back on wastage. I used a constraint solver (https://developers.google.com/optimization) and asked it to produce 5 recipes requiring the minimum number of ingredients, and was rather amused that the first run included such classics as "boiled egg", "butter potato" and "toast".