  The history of the Magellanic Clouds is investigated using N-body
hydrodynamic simulations where the initial conditions are set by a genetic
algorithm. This technique allows us to identify possible orbits for the
Magellanic Clouds around the Milky Way, by directly comparing the simulations
with observational constraints. We explore the parameter space of the
interaction between the Magellanic Clouds and the Milky Way, considering as
free parameters the proper motions of the Magellanic Clouds, the virial mass
and the concentration parameter ($c$) of the Galactic dark matter halo. The
best orbital scenarios presented here are considered with two different sets of
parameters for the Milky Way disc and bulge components. The total circular
velocity at the Sun's position ($\rm{R_{\odot}}=8.5\,\rm {kpc}$) is directly
calculated from the rotation curve of the corresponding Galactic mass model.
Our analysis suggests that the Magellanic Clouds have orbited inside the virial
radius of the Milky Way for at least $3\,\rm{Gyr}$, even for low mass haloes.
However, this is possible only with high values for the concentration parameter
($c\ge20$). In both orbital models presented here, the mutual interaction
between the Magellanic Clouds is able to reproduce the observed features of the
Magellanic System.
