A small program to explore USDA food nutrient information and search food combinations
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
database
various
LICENSE
README
TODO
ackpl.py
baseclasses.py
perfectmeal.py
perfectmeal_gui.py
pmeal.json
testing.py

README

Perfect Meal
Author: Christopher Olsen
Copyright Christopher Olsen 2013
License: GNU GPL v3 


To run on GNU/Linux:

first install Python and wxpython (if you already have Python 3.x installed this may
be a bit trickier than what I'm listing):

$ sudo apt-get install python2.7 python-wxtools

Download the zip file from github:

https://github.com/CJOlsen/perfect-meal/archive/master.zip
or 
click the "Download ZIP" button on https://github.com/CJOlsen/perfect-meal

then run perfectmeal_gui.py and it should work (you may need to add the wxpython
module to Python's "path" first)


Background/About:

The USDA maintains a huge dataset of foods and their nutrients, I was able to
find a JSON version of this data.  While a brute force search through the
data problem space to find a "perfect meal" (a combination of foods that meets a
full set of nutritional constraints) is NP-Hard, and a search to find *if*
a solution exists is NP-Complete, the problem can be approached through other
strategies - such as greedy algorithms and only searching a subset of the entire
database.  




The algorithm portion of this program is in ackpl.py and it's fully modular so it
can be used in other programs.  I haven't spun it off into its own repository yet
but I'm planning on it.