Determination of the orbital parameters of the M 51 system using a genetic algorithm