0% found this document useful (0 votes)
16 views

Cos314 Tutorial Answers

The document discusses various algorithms and heuristics used in search problems, including the Manhattan distance heuristic and the A* algorithm. It compares different search strategies such as BFS, DFS, and greedy hill climbing, highlighting their efficiency and reliability. Additionally, it covers specific examples and calculations related to these algorithms, emphasizing the importance of admissibility in heuristic functions.

Uploaded by

ratjatjimalatji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Cos314 Tutorial Answers

The document discusses various algorithms and heuristics used in search problems, including the Manhattan distance heuristic and the A* algorithm. It compares different search strategies such as BFS, DFS, and greedy hill climbing, highlighting their efficiency and reliability. Additionally, it covers specific examples and calculations related to these algorithms, emphasizing the importance of admissibility in heuristic functions.

Uploaded by

ratjatjimalatji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

COS314 TUTORIAL

1a) the Manhattan distance heuristic, it is used to estimate the distance


between 2 points in a grid-like environment by summing the difference in
coordinates along each axis

1b) h(x)=∣Xrobot−Xstation∣+∣Yrobot−Ystation∣

Substitute the values:

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

3)Q h3(s) = min(h1(s), h2(s))

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

4b) BFS visits 5 nodes before reaching the goal state

4c) With DF S algorithm ten nodes will be visited before reaching the goal
state

4d) 4 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

9a) Current position represented as an integer, the other cities he has


visited, the cost to travel between cities..

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)

13a) S BH j (Remember we want the lowest cost not heuristic function)

13b) S BH j

13c) S BH j

13D) H(n) is inadmissible we see this when we want to go from F to J the


heuristic value is 2 but the cost is only 1 inadmissible functions never
overestimate the cost to get to a state
14a)

14b)

You might also like