Skip to content

Solving the knapsack problem with Jenetics 🧬

Notifications You must be signed in to change notification settings

beatngu13/knapsack-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.github/workflows/build.yml

knapsack-problem

Jenetics is an awesome Java library for genetic algorithms (GAs). Many Jenetics examples are very concise and make excessive use of lambdas, which can make it hard for beginners to take 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, implementing the following interfaces 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).

About

Solving the knapsack problem with Jenetics 🧬

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages