Cos314 Tutorial Answers
Cos314 Tutorial Answers
1b) h(x)=∣Xrobot−Xstation∣+∣Yrobot−Ystation∣
h(x)=∣1−4∣+∣2−5∣=3+3=6
2) No it is not the function assumes that to reach the end goal we need to go
through job work and this might cause us to overestimate the distance to
reach the goal as the current node to the goal load might be shorter than the
current node to Joe Berg to the goal node
h3(s) will be admissible. The min function will choose the smaller value
between the h1(s) and h2(s), the admissible function which has the lower
value because the 2 as it never OVERESTIMATES, there for it will be selected.
4a) BFS
4c) With DF S algorithm ten nodes will be visited before reaching the goal
state
5a) A B C D E F G
5b) ABDG
5c) the path would be A B D G K, since G is the goal node the goal states has
already been reached
6a) False
7a)
7b)
8) Best first search algorithms Evaluate the node with the lowest cost, After
reaching a node it will add the adjacent nodes to the open list when it is time
to go to the next list it will rank the notes according to their cost function and
go to the node with the lowest cost
9b) The salesman can move to an unvisited city and start and end at the
same city (node)
9c)
9d) A* as the salesman can travel to the city with the lowest cost at the time.
10a) A B C D E
10b) A B D H K M N L O E
10c) A B D H K L I J E
11a) A C G I F B D E Q
11b) A C B D
11c) Greedy hill climbing is an algorithm that only explores a state if the cost
of traveling to said state is less than the cost of the current state AKA
minimizing the heuristic value (h(n)). It will reach its conclusion quickly but it
is not reliable because it can get stuck in a local optimal and often does not
find the solution. Best first search algorithm considers both the cost so far
(g(n)) and the heuristic value (h(n)). It is slower than Greedy hill climbing but
is more likely to find the optimal solution ans it can navigate through the
entire tree. Keeps track of the nodes it have visited to and the ones it can
travel to.
12a) S B E I F A D H
12b) S B E I F A C G D H
12C) S B A D H
12D)
13b) S BH j
13c) S BH j
14b)