A genetic algorithm for the reconstruction of physical events