Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

CS 5100: Foundations of Artificial Intelligence (Fall 2021) Chris Amato

Student: NEHA RAMACHANDRA (002124304) Due September 30, 2021

Solving Problems by Searching

1 Solving Problems by Searching


AIMA 3.14. Which of the following are true and which are false? Explain your answers.
(a) Depth-first search always expands at least as many nodes as A* search with an admissible heuris-
tic.
FALSE
In most of the cases of the Depth First Search, it is really not possible to find the Goal state by expanding the very first
node. Hence the chances of the DFS to expand very minimal number of nodes is very less.
As the DFS is a uninformed search method and stores the nodes in Stack, it only expands those nodes which are on top of
the table unlike A* which is a uniformed search.
A* search seems to be very efficient in reaching the Goal state by expanding least number of nodes with an admissible
heuristics.
Therefore, eventhough with the best heuristics, it is very difficult for the DFS to reach the goal with optimal expanding.

(b) h(n) = 0 is an admissible heuristic for the 8-puzzle.


TRUE

Basically the admissible heuristics will not overestimate the cost.


Hence, h(n) = 0 gives a clear declaration that the order is 0, which cannot be greater than any other order h(n). Because 0 is not greater
than n.

(c) A* is of no use in robotics because percepts, states, and actions are continuous.

FALSE.

Eventhough in robotics, the percepts, states and actions are continuous, the way they actually perform in real-time is different.
Firstly, all the state spaces will be converted into discrete from continuous, before they are put into actions. Also, the cahnges in the
aspects such as percepts and actions are mainly done after the search operation happens.

(d) Assume that a rook can move on a chessboard any number of squares in a straight line, vertically
or horizontally, but cannot jump over other pieces. Manhattan distance is an admissible heuristic
for the problem of moving the rook from square A to square B in the smallest number of moves.

FALSE.

AIMA 3.18. Describe a state space in which iterative deepening search performs much worse than
depth-first search (for example. O(n2 ) vs. O(n)).

1
AIMA 3.21. Prove each of the following statements, or give a counterexample:
(a) Breadth-first search is a special case of uniform-cost search.

(b) Uniform-cost search is a special case of A* search.

2 Search Problem 1
Misc 1. Consider the two graphs shown in Figures 1 and 2. In what order does BFS, DFS and UCS
(assume you use the graph search version) expand the nodes for each graph (assume that nodes are
added to the stack/queue in alphabetical order)? The agent starts at node s and must reach node g.In
the queue/stack column of the table, write all the viable nodes that are reachable from the current
node and mention the current node in the currNode column. For instance, the reachable nodes from
s are i and h(for example purpose). So, queue/stack: i,h and current node = s.Please keep in mind
the rules of stacks and queues while writing the nodes which are reachable(order matters) (Note: All
iterations might not be necessary.)

GRAPH A

Table 1: Answer:

BFS DFS UCS


Iter. Queue <- CurrNode Stack -> CurrNode Queue <- CurrNode
0. S - S -
1. A,B S A,B S
2. B A A,G B
3. G B
4. - G
5.
6.
7.
8.

2
Figure 1: Graph A

Figure 2: Graph B

3
3 Search Problem 2
Consider the graph shown in the below figure. In what order does A* expand the nodes for each graph
(assume that nodes are added to the stack/queue in alphabetical order)? The agent starts at node s
and must reach node g.Please write the nodes expanded while performing A* and an explanation(4-
5 words) for each node. For instance, as per the performance of A*, t expands to l. So write: t
−− > l because cost is 2 and heuristic is 1.(the above example is not related to the grave and used for
instantaneous purposes only). Please change the reason as per the working of A*. (Note: All iterations
might not be necessary.)

You might also like