This HTML5 document contains 4 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
isaphttp://webisa.webdatacommons.org/prov/
isahttp://webisa.webdatacommons.org/
n5stackoverflow.
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
provhttp://www.w3.org/ns/prov#
xsdhhttp://www.w3.org/2001/XMLSchema#
Subject Item
isa:270513535
rdf:type
prov:Entity
prov:value
For the algorithm you could use backtracking (EDIT although it does not quite match your general idea.) You just have to realize your movements are pushed into a virtual stack, and they must be unpushed (and therefore undone.) You might have to implement the stack yourself if the robot is an actually moving object, but you can rely on the call stack if you just want to solve the maze.
prov:wasQuotedFrom
n5:com
Subject Item
isap:161646533
prov:wasDerivedFrom
isa:270513535