Command line tool that solves a constraint satisfaction problem (CSP) to generate an optimal n
-day grocery list.
- Maximum amount of money to spend
- Number of times a meal component can/must be used
git clone --recursive https://github.com/bornabesic/shoptimize.git
cd shoptimize
mkdir build
cd build
cmake .. -D CMAKE_BUILD_TYPE=Release
make
This project uses yaml-cpp library to parse the configuration from a YAML file. It is stored in lib/
as a git submodule. During the build process, the library is statically linked against the executable.
shoptimize <configfile> <storename>
Arguments:
configfile
: Path to a YAML configuration filestorename
: Name of a store (defined in the configuration file) to use
Expected output when using config/example.yaml configuration file.
$ shoptimize config/example.yaml Kaufland
Products: 4
Components: 3
Stores: 1
Meals: 12
Constraints: 2
Time: 0.00140942 s
Solutions: 56
Best solution:
{Minutensteaks} {Heringsfilet} {Pasta Pesto} {Pasta Pesto} {Heringsfilet} {Pasta Pesto} {Pasta Pesto} {Heringsfilet} {Pasta Pesto} {Heringsfilet} {Minutensteaks} {Heringsfilet}
Cost: 10.249