Breadth-first tree search (source code)

= Breadth-first tree search

The <tree search> version of <breadth-first search> explores action histories in nondecreasing length without automatically removing repeated states. A finite <branching factor> ensures that every finite depth contains finitely many histories, so the method is a <complete search algorithm> for goals reachable at finite depth. With equal positive action costs it is an <optimal search algorithm> for total action cost. It need not terminate on an unsolvable instance with an infinite <search tree>, and it need not optimize a terminal reward unrelated to depth.