Pivot algorithm
The pivot algorithm is a form of Monte Carlo algorithm used to generate configurations of self-avoiding walks, typically on a lattice. The algorithm typically begins with a straight line consisting of some number N points on the lattice, and transforms it into a disorganized shape known as a walk, in which no two points on the walk occupy the same site on the lattice. In two dimensions it operates according to the following steps:
- Select a random point between 1 and about which to pivot. This splits the walk in two, one of length and one of length.
- Randomly select which side of the point to pivot.
- Randomly select a transform such as rotation by 90, 180, or 270 degrees or reflection about the horizontal or vertical axis and apply it the points on the selected side of the pivot.
- Check whether any two points occupy the same site on the lattice. If they do, reject the pivot and try again. If they do not, proceed with another pivot.