2 Depth-first Search |
In depth-first search, the frontier acts as a stack: the last node added is the firt node chosen.
You can step though the search showing which nodes are selected in which order. The red path to the red outlined node was the last path selected. The neighbours of the red node are in blue, and the other nodes on the frontier are in green. (The old frontier contains the red node and the green nodes. The new frontier contains the blue nodes and the green nodes).
To see it again you can reset the search.
2 Depth-first Search |