Add genetic algorithm and some algorithm improvments.