The authors prove here that if some regular domain P of Rn contains elements of Zn, then one can almost surely reach some of these elements by moving along the edges of the lattice defined by some basis of Zn while minimizing some distance function to P, the parameters which define this random function being randomly reset every time a local optimum is attained. From this result they deduce various heuristics for dealing with programs with linear integer constraints and discuss the possible choices for a basis of Zn as well as the possible strategies for the control of the parameters which define the objective function.