Has anybody played with / thought of a simple way of implementing a self-avoiding walk algorithm for working through 2D matricies?
I’m trying to ‘walk’ through a [jit.matrix] without repeating steps (which makes me think along the lines of [urn]?), but want to be able to move up/down too. Also, since the steps want to be limited to immediate neighbour cells, maybe I should be looking towards some sort of drunk/markov type thing?
The trouble with a purely random walk, for anything other than a 2×2 matrix is that there is no guarantee you’ll visit every element, which is what @owmtxy wants I think. If you allow wraparound (create a torus out of your matrix), then I think you can do for 2xN, but again no guarantee for 3×3 or larger (thats taking steps to neighbours only).
A possible way to look at this is with various space filling curves.