Consider the tree of all loop-free paths that is derived from the following graph, where labels S and G stand for Start and Goal, respectively. Assume that the distance matrix for the graph is as given in the table below.
The weight matrix is symmetric with respect to the main diagonal. A zero matrix entry indicates that there is no edge between the vertices corresponding to the column and row labels. Any non-zero matrix entry indicates that there is an edge between the two vertices corresponding to the column and row labels, and the distance between those two vertices is given by the value of the weight.
Table: Distance/Weight Matrix D
| | | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 6 | 1.4 | |
a) Apply the greedy best-first search to identify a path from state S to state G: define an appropriate heuristic and evaluation function. Draw the complete search tree generated due to the best-first search. Show the search queue contents as well as evaluation function (both g and h) values for each node in the search tree. Label each expanded node using a sequence of positive integers.
b) Apply the A* search algorithm to identify the optimal path from S to G: define the heuristic function so that the solution found by the A* search is optimal. Draw the complete search tree generated due to an A* search. Show the search queue contents as well as evaluation function (both g and h) values for each node. Label each expanded node using a sequence of positive integers.