| Overall Reading | |
|---|---|
| Brookshear: | bottom of p. 440, Ch. 10.3 |
Outline:
Interestingly, for computers, this is one of the more natural areas of success in "Artificial Intelligence".
Let's consider some examples:
To play a good game of Tic-Tac-Toe, a computer does not really need to know how to think. It can simply simulate all possible games in advance, and only then, commit to a given move.
Then why can't a computer play a "perfect" game of chess? Because there are way too many possible games. Way too many! We will never in our lifetime see a computer that would have the speed and memory to be able to simulate the game all the way to the end.
So lacking the ability to map out the entire game, how is a computer to decide its next move?
Let's play (listed in order of 'coolness' ?):
For start states which are "far" away from the goal state, this search tree might become huge (even for computers). It may not be reasonable to expect to build the entire tree. Fortunately, as soon as you find a path to a goal state, you can stop the process.
So, if you are to build up the tree from scratch, with hopes of finding the goal quickly, how should you proceed?
How do you do this as a human?
Possible approaches:
The key, however, is how to evaluate the relative "goodness" of various intermediate states. The "promising" ones are hopefully closer to the goal state.
A heuristic is a (computable) quantitative measure which provides an estimate of the true distance from a state to the goal.
The better the heuristic is, the better the search can progress! (this is really a key for computers playing chess).
Let's consider the eight-puzzle.
So which of the following two states is "better" ?
| 1 | 2 | 3 |
| 4 | 5 | |
| 7 | 8 | 6 |
| 2 | 3 | |
| 4 | 5 | 6 |
| 7 | 8 | 1 |
| 1 | 2 | 3 |
| 4 | 5 | |
| 7 | 8 | 6 |
| 2 | 3 | |
| 4 | 5 | 6 |
| 7 | 8 | 1 |
The rest of the figures below demonstrate the use of this algorithm on an example, while using the second of the two heuristics developed for the eight-puzzle (summing the number of moves away for each out-of-place tile).