HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

Algorithm to generate self-avoiding random walk on a lattice

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
randomlatticealgorithmgeneratewalkavoidingself

Problem

Where can I find some code to generate random self-avoiding walks on 2 and 3-dimensional lattices whose side-lengths are powers of two? The walk should pass through every point on the lattice More specifically, how can I find a random hamiltonian path on a large $2^n \times 2^n$ or $2^n \times 2^n \times 2^n$ grid graph?

The distribution doesn't have to be completely uniform, however in general the lattice should look wrinkled. The method used to generate the path should have low probability of producing extremely long stretches of straight line.

Solution

A procedure is described in A combinatorial algorithm for effective generation of long maximally compact lattice chains.

Context

StackExchange Computer Science Q#78049, answer score: 6

Revisions (0)

No revisions yet.