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
- Visual representation of the items to be selected, with weight, benefit and coloring for selected items.
- Visual representation of the knapsack with total capacity and current load of items.
- GA settings such as Elitism, Crossover, Generatio Size, Mutation Rate, number of Genereration to stop.
- Upload sample text file and render it.
- Run multiple Knapsack Problems in the same window.
- Using binary encoding to represent the Knapsack problem.
- Using roulette-wheel selection, which is a simple weighted random selection method that implements fitness-proportionate selection.
- Ability to use Elitism.
- Uses three different crossover techniques.
- 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.