Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Tree search

In AI search, we need a way of structuring the search space so that we can traverse it systematically.

A common structure is a "tree". Define a data structure with "parent" nodes and "child" nodes beneath them, and child nodes beneath them, and so on.

Example with chess game: The "parent" is the current state of the chess board. The "children" are the immediate next moves. Each "child" itself has "children" (moves from it) and so on. Pick the best immediate "child" to move to.

This idea can be applied to many problems, not just games.

  


Example - Xs and Os

  

Introduction to Xs and Os (Tic-Tac-Toe).



Representing Xs and Os as a search problem in a tree.
Image courtesy of Ralph Morelli.

See Luger Fig II.5


Binary tree

A special form of tree.
  


You do not have to draw the tree

With the "tree search" idea, do we have to draw tree graphs of every problem?

No.





ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.