Depth-first Traversal (cont)
An aside on nondeterminism ...
"for each neighbour " doesn't specify a visiting order
As long as we visit all neighbours, the traversal algorithms work
Could choose a random order each time
- might lead to a different solution
- but always leads to a solution, if one exists
Such algorithms are called nondeterministic
Cf. "regular" (deterministic) algorithms ...
- always behave the same for a given start state
|