I too read the thread on generating an optimal recipe using a genetic algorithm and noticed a few people mentioning how a linear programming algorithm is pretty well suited for this sort of problem, so I did some research on how this could be achieved and came up with a web version of this. Given a URL for a recipe on diy.soylent as well as the ID for a nutrient profile (which you can obtain by editing the profile and looking at the URL; mine is 536e74ebd8223302004d4618, for instance), it downloads the data and then chooses ingredients and their amounts to fit the profile. (Here’s the code for anyone interested, and the algorithm it’s using.)
After going through this exercise, however, I realized something very important. You and I will never find full nutrition facts for products we buy on the store or online, because manufacturers aren’t required to collect and publish this information. Consider any ingredient in the USDA database compared with the nutrition facts section on the side of a box. There’s a lot of data that just isn’t there! This bothers me greatly, because it means if I try to create a recipe like everyone else here, I will be in the dark about how many nutrients I am really consuming – it is likely I will be getting more than I really need. For things like carbs, fat, and protein this is not an issue, but for vitamins like A, D, E, K (which are fat-soluble, so they can collect over time) or minerals like iron which can be toxic if taken in high doses, this is concerning.
So then I tried making a new recipe, this time with ingredients I’d found in the USDA database. I also added items for bulk minerals, where I can pretty well safely guess the numbers I see are representative of what’s in the powder. Here’s the result of that (be patient, takes a little while to load). The container sizes and prices are fake for this particular recipe, so ignore those in the output above. The thing I’ve noticed, though, is that you can already see that this approach will be a lot more expensive and less economic in general than using products I can find online. (I found it interesting, for instance, that the algorithm has chosen that much potassium iodide.)
What do you think? Are there any ingredients I can add to make this cheaper or more nutritious? Am I worrying too much about the lack of knowledge we have around these other products?