Genetic Algorithms for the optimal design of an articulated structures