Corinne Yates
CS 377C, Spring 2001
Software Engineering Pattern

1 SEARCH TREE **

. . . Artificial Intelligence is defined by AI REASONING (12). This pattern, built with SEARCH STRATEGIES (47), gives the "intelligence" to AI in making decisions and finding solutions in a timely manner.

* * *

The search tree will find a potential solution to unknown questions by looking at the available data in an organized manner, one piece (or "node") at a time.

Suppose one is writing a program for an airline to find a way for a customer to get from City A to City B given a list of all of the possible flights between any two cities. The program will need to go through the list and determine which flight (or connecting series of flights) that the customer should take. This is implemented using a search tree. City A (where the customer currently is located) will be the initial piece of information, or "initial node." The search tree will consist of this initial node at the top of the tree. Next, the program would look at all of the flights beginning with City A. These flights would show cities that the customer could reach in just one flight, and so these cities (each city a node itself) are on the next level, below the initial node. Now, each of these cities has flights as well, which would be on the third level, and the tree would continue so forth.

Choosing a search strategy (i.e. Breadth-first or Depth-first) will tell the program how to progress down the search tree, or hierarchy of nodes that has been built from the information. There are clearly many different ways that one can get from City A to City B, so the search strategy is the key to determining which path will be selected.

Search trees, with search strategies, can also be found in finding solutions in puzzle-solving or simple games such as "The Eight Queens Problem" where one tries to place eight queens in locations on a chessboard such that none of them can move to the space of another.

Therefore:

Create search trees to solve Artificial Intelligence questions. Use each piece of information as a node and construct a hierarchy of nodes based on how the individual pieces of information connect together so that one can go along a path through a series of nodes in order to get from one to another.

(Diagram)

* * *

Use a SEARCH STRATEGIES (47) to determine the way of traveling down the hierarchy of the search tree. HEURISTICS (39) can be used to give weights or "costs" to the different paths between nodes and help in the strategy decisions of which path to ultimately choose.