This is some genetic algorithms I wrote in Ruby for the knapsack problem.