I'm trying to develop some code for a "0-1 Knapsack" problem. Please see also related question:
I realize that above posting might be too broad, so I'll attempt to break it into sub-problems.
Right now, I've built a small program that can read an external file with values (per line) equal to: "Value", "Weight", and "Volume". This C++ code is attached (see "Code_Current.txt"). The same file (change .txt to .cpp) uses as input file "input.txt" (also attached).
To solve the knapsack problem, I've googled for existing code and came across a program that MIGHT provide a foundation. The code I found is attached ("Code_Google.tx".... also change .txt to .cpp).
Now, here's what I need some help with. I'd like to integrate the function from "Code_Google" merged/integrated into my code (as I'm actually reading the input file... vs. using hard-coded values in the program).
As I'm a C++ beginner, I'm having trouble w/ the merging (i.e. make the program flow into mine which reads the input file).
Can anyone provide me some help as to what must be changed in my program so that I can used the knapsack function?