2 ms·
I don't understand this - I saw the Wilson's algorithm [1] generate huge loops as it hit the existing maze. Does it subsequently erase them? I couldn't see how
by NamTaf 12y ago
I don't understand this - I saw the Wilson's algorithm [1] generate huge loops as it hit the existing maze. Does it subsequently erase them?
I couldn't see how the tree could possibly handle loops.
[1]: http://bl.ocks.org/mbostock/11357811 http://bl.ocks.org/mbostock/11357811
- robinhouston 12y agoIf you look closely at the huge loops Wilson’s algorithm is generating, you'll see they are not really loops at all: they only join up to the existing maze at the end, and there is a small gap at the start.
- yelnatz 12y agoWhere do you see the loops? The algorithm uses "loop-erased" random walks. It starts at a node that isn't in the tree and randomly walks. If it hits itself while randomly walking (remember it isn't part of the tree yet), it erases the loop that it created and continues walking from that node again. If the walk hits the tree, connect the walked path to the tree, pick another node and start again.