A Genetic Algorithm for a fitting problem