next up previous
Next: The traveling salesman Up: Self-avoiding walks Previous: Self-avoiding walks

Monte Carlo simulation of the SAW in 2d

It is convinient to represent the lattice as a two-dimensional array to record the sites that have been already visited. Choose an arbitrary site as the origin and assume that the first step is ``north'' (the other directions are equivalent by symmetry) We label the four possible directions from 0 to 3. Next, we generate a random integer to choose one of the three possible directions. If a step leads to an intersection, i. e. a site that has already been visited, the walk is terminated and we start again from the origin.



Adrian E. Feiguin 2004-06-01