- Go to nodejs.org to download nodejs
- Install nodejs installer
- Launch terminal or command line
- $ node main.js inputFile.json mode#
$ node main.js inputFile.json mode#
0 - Brute Force Tree
1 - Tree Optimized w/ weight optimizations
2 - Tree Optimized w/ weight optimizations + greedy upper bound optimizations
3 - Greedy
{
"limit": 13,
"items": [
{
"weight": 3,
"worth": 6,
"name": "A"
},
{
"weight": 5,
"worth": 3,
"name": "B"
},
{
"weight": 1,
"worth": 2,
"name": "C"
},
{
"weight": 7,
"worth": 5,
"name": "D"
},
{
"weight": 4,
"worth": 5,
"name": "E"
}
]
}