/knapsack-problem-php

Knapsack Problem solver implementation in PHP.

Primary LanguagePHP

knapsack-problem-php

Knapsack Problem solver implementation in PHP.

How to run

Run with command:
php ScriptRunner.php --file=<file_path - string> --weight=<int> --algorithm=<int>
Example (if script is run from main directory):
php ScriptRunner.php --file=file.csv --weight=50 --algorithm=1
php ScriptRunner.php --file=file.csv --weight=20.12

Parameters

  • file - text, CSV file path, required
  • weight - int/float, maximum weight of knapsack, required
  • algorithm - int, algorithm type value, optional, default: 1

Available algorithms

  • GreedyAlgorithm - value: 1