depth-first search


depth-first search

(algorithm)A graph search algorithm which extends thecurrent path as far as possible before backtracking to thelast choice point and trying the next alternative path.Depth-first search may fail to find a solution if it enters acycle in the graph. This can be avoided if we never extend apath to a node which it already contains.

Opposite of breadth first search. See also iterative deepening.