Genetic programming algorithm for optimization problem