The Depth-First Search (DFS) algorithm is a path-finding technique suitable for low-memory devices. Another common use is to build mazes with some minor modifications to the list of nodes visited and discovered, but the main algorithm stays just the same.
Finding your way out of a maze with DFS
Getting ready
This is a high-level algorithm that relies on each graph's implementation of the main functions (build, init, and so on), so that the algorithm is implemented in the Graph class.
It is important to take a moment and verify when the recipe is manipulating actual objects, or vertex IDs.