General purpose genetic algorithm