Depth-first search (DFS)
Visit every place reachable from the start. You can explore a maze this way. Follow a passage to its end, return to a fork and try the next passage.
Each call to visit remembers its own vertex. The stack shows where we will return. We visit each reachable vertex once.
With adjacency lists, traversal takes O(V + E) time for V vertices and E edges.