Is Hamiltonian path solvable in nondeterministic log space?
Vertices are notated in base 2
Keep two counters
First counter is current vertex
Second counter implies max vertex encountered in sequence. 0 means 1 is not encountered. 1 means 1 is encountered. 2 means 2 and 1 is encountered. etc.
Random walk starting at vertex 0
Hamiltonian path if and only if second counter equals max vertex.
Clearly log space.
Is this correct?
—-
No, this algorithm is not correct.
It decides the existence of a walk from vertices
0ton-1of lengthn.