Skip to content

jcovaa/DA-project2

Repository files navigation

DA-Project2

Compile the performance test (in code directory)

g++ -std=c++17 -I. performance/PerformanceRunner.cpp FileReader.cpp Truck.cpp Algorithms.cpp Pallet.cpp -o performanceRunner

It runs the the follow datasets: datasets = {"01", "02", "03", "07", "08", "10", "11", "12", "13", "14"};

Run the ilp knapsack python script

python3 code/ilp_knapsack.py input/dataset/TruckAndPallets_01.csv input/dataset/Pallets_01.csv output/output.txt

Run main code (in code directory)

g++ -std=c++11 main.cpp -o main Algorithms.cpp FileReader.cpp Menu.cpp Pallet.cpp Truck.cpp PerformanceEvaluator.cpp

Run the graphic script (in project directory)

  • has to have a virtual environment (venv) with pandas and matplotlib installed
source venv/bin/activate
python3 code/performance/plot_runtime.py

Input files - use like this

  • TruckAndPallets_01.csv
  • Pallets_01.csv

Implemented datasets

Pallets_11.csv and TruckAndPallets_11.csv

  • Tie-Breaker and Greedy Trap
  • Multiple subsets yield the same total profit (e.g., [1,2], [3,4,5,6])

Pallets_12.csv and TruckAndPallets_13.csv

  • Stress DP without Brute-Force Explosion
  • n = 12 (safe for brute-force)
  • capacity very large - W = 50000

Pallets_13.csv and TruckAndPallets_14.csv

  • Stress Greedy Algorithm
  • Using W = B, v1 = 1, w1 = 1, v2 = B - 1, w2 = B

Pallets_14.csv and TruckAndPallets_14.csv

  • Backtracking Efficiency test
  • Many combinations exceed the weight limit quickly, allowing backtracking to prune branches early

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published