This is an example of solving the knapsack problem using Genetic Algorithms.
Global optimum is obtained in almost 80% of the total runs.
Elitism and wheel selection based on a cumulative probability distribution are used for selection of parents.
Crossover and mutation are fairly straightforward.
Compiled using g++ 7.1.1 and tested on Arch Linux.