Skip to content

C++ implementation of a genetic algorithm for the binary knapsack problem.

License

Notifications You must be signed in to change notification settings

RicardoRibeiroRodrigues/genetic-algorithm-bin-knapsack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm genetic algorithm for the binary knapsack problem.

C++ implementation of a genetic algorithm for the binary knapsack problem.

How to use:

  • Compile with:
g++ -O3 genetic_algo_knapsack.cpp -o genetic_algo_knapsack
  • Usage: Flags:
  • -r : Binary number to enable or disable using random items for the knapsack.
  • -g : Integer for the number of generations the algorithm is going to run.
  • -s : Integer for the number of solutions per population for the algorithm.
./genetic_algo_knapsack -r 1 -g 10000 -s 20

(Note: If random is disabled, you must provide the itens for the knapsack in the format (weight value) via stdin).

About

C++ implementation of a genetic algorithm for the binary knapsack problem.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages