The Knapsack problem is one of the contemporary problems of modern computing and we will try to solve this using a Genetic Algorithm.
Basic solutions to the Knapsack problems with a high enough given number of items can take a very long time to compute. This is where genetic algorithms come into play. These algorithms produce random generation, where crossover and mutations of solutions take place, and then using a fitness function passes on the best solutions to next generation (in nature this is known as natural selection) to repeat the same on the new population till the time we hit the number of generation limit or achieve the fitness score expected from it.
Submitted by Deepak Kumar Jha (deepakjha)
Download packets of source code on Coders Packet