Skip to content

varlog23/knapsack-problem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

knapsack-problem

Jenetics is an awesome Java library for genetic algorithms (GAs). Unfortunately, many examples for Jenetics are very concise, which makes it hard for beginners to use them as a starting point for their custom problems.

The goal of this project is to provide a detailed implementation that solves the infamous knapsack problem, extending various base classes to illustrate Jenetics' core concepts.

The Problem(s)

The project consists of two implementations: a single- (so package) and a multi-objective optimization (mo package). Both knapsack problems stem from John Burkardt's home page from the Department of Scientific Computing of the Florida State University:

Note that while the knapsack problem is a good example to demonstrate a single-objective GA, it is generally not necessary to use a multi-objective GA for multiple knapsacks. The different objectives—i.e. the separate knapsacks—do not compete with each other. One is basically only interested in the combination of knapsacks that yields the highest profit. However, the example still helps to get used to Jenetics' relatively new API for multi-objective problems (io.jenetics.ext.moea).

TODOs

  • Use Gene interface instead of AnyGene
  • Add custom Alterer
  • Add multi-objective problem
  • Set up Travis build
  • Set up SonarCloud
  • Improve documentation (e.g. Javadoc)
  • Increase test/code coverage

About

Solving the knapsack problem with a genetic algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%