Random Walk Algorithm

This week I tried to figure out how to create a self-avoiding walk which was fully filled in a M by N matrix. This constraint is a special case of the original self-avoiding walk, which limited the steps to exact M*N in a given M by N lattice. I wrote the code inspired by the idea of Hamiltonian path. The advantage was that it was easy to understand, yet it sacrificed the computational complexity. Details will come soon.

Check the code in this Github page. Check out the DEMO in the browser.

Or see the screen recording below.

I am still investigating the pivot algorithm. Keep posted.