Skip to content

Javascript implementation to solve Knapsack Problem using Genetic Algorithm

Notifications You must be signed in to change notification settings

AyhamJaradat/KnapsackProblem

Repository files navigation

KnapsackProblem

Javascript implementation to solve Knapsack Problem using Genetic Algorithm

The Goal:

This is an old project I did once, when I was a student learning AI and Genetic Algorithm.

I build it with Javascript, jquery and LOVE.

Back in 2016, we were required to develop a project that solves 0-1 Knapsack Problem using Genetic Algorithm. The Project is built as a web application that gives the user the ability to test GA for knapsack problem with different input data and GA parameters.

See it Live

You can play around with it live here: Open the KnapsackProblem

System UI Features:

  1. Visual representation of the items to be selected, with weight, benefit and coloring for selected items.
  2. Visual representation of the knapsack with total capacity and current load of items.
  3. GA settings such as Elitism, Crossover, Generatio Size, Mutation Rate, number of Genereration to stop.
  4. Upload sample text file and render it.
  5. Run multiple Knapsack Problems in the same window.

System Genetic Algorithm Functionality:

  1. Using binary encoding to represent the Knapsack problem.
  2. Using roulette-wheel selection, which is a simple weighted random selection method that implements fitness-proportionate selection.
  3. Ability to use Elitism.
  4. Uses three different crossover techniques.
  5. Full javascript implementation of Genetic Algorithm.

-- note:

If you love reading, take a look at this report that explains all of the details about the project and the Algorithm.

ScreenShots :

screenshot1

screenshot2

screenshot2

About

Javascript implementation to solve Knapsack Problem using Genetic Algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published