/CS106-Knapsack

Assignment 3 of CS106, using Google OR Tools and Genetic Algorithm for knapsack problem

Primary LanguagePython

Knapsack CS106

Installation

Python >= 3.8

pip3 install -r requirements.txt

Download data

bash download_data.sh

Unzip folder named kplib contains data from here

Run

Test case results are saved in TestResults folder. The name of each subdirectory represents the budget of the calculation performed.

For example: 300_s stands for computation budget is 300 seconds.

python3 main.py -o 1 : Run OR Tools 
                   2 : Run Genetic Algorithm

Feel free to clone my source code: https://github.com/anhquan075/knapsack