Skip to content

A genetic algorithm implementation of the binary Knapsack problem.

Notifications You must be signed in to change notification settings

edervishaj/genetic-knapsack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of the binary Knapsack Problem with a genetic algorithm approach.

The input to the solver (KnapSackGA.java) is a file called init.txt which contains in each line the followings:

  1. number of items (e.g. 7)
  2. value of each item (space separated) (e.g. 1 2 3 4 5 6 7)
  3. weight of each item (space separated) (e.g. 14 11 10 13 12 9 8)
  4. knapsack maximum size (e.g. 70)
  5. population size (e.g. 50)
  6. number of generations (e.g. 100)
  7. crossover probability (e.g. 0.6)
  8. mutation probability (e.g. 0.015)

Releases

No releases published

Packages

No packages published

Languages