2425 CSC14003 23CLC01 - 05 HW01
2425 CSC14003 23CLC01 - 05 HW01
Homework 01
Submission Notices:
Conduct your homework by filling answers into the placeholders given in this file (in Microsoft Word format).
Questions are shown in black color, instructions/hints are shown in italic and blue color, and your content
should use any color that is different from those.
After completing your homework, prepare the file for submission by exporting the Word file (filled with
answers) to a PDF file, whose filename follows the following format,
<StudentID-1>_<StudentID-2>_HW01.pdf (Student IDs are sorted in ascending order)
E.g., 2252001_2252002_HW01.pdf
and then submit the file to Moodle directly WITHOUT any kinds of compression (.zip, .rar, .tar, etc.).
Note that you will get zero credit for any careless mistake, including, but not limited to, the following things.
1. Wrong file/filename format, e.g., not a pdf file, use “-” instead of “_” for separators, etc.
2. Disorder format of problems and answers
3. Conducted not in English
4. Cheating, i.e., copy other students’ works or let the other student(s) copy your work.
Problem 1 (1pt) Choose True or False for each statement to indicate whether the statement is true or
false and then give your explanation.
1
exceed the true cost in some
cases—specifically when h1 is
too large and h2 is small—so h3
is not guaranteed to be
admissible.
Ex:
h* = 10
h1 = 9 < h* => admissible
h2 = 6 < h* => admissible
h3 = 2*h1 – h2
= 2*9 – 6 = 12 > 10
=> inadmissible
Problem 2 (2pt) You are given the initial state (i) and the goal state (ii) of an 8-puzzle as shown below.
2 8 3 1 2 3
1 6 4 8 4
7 5 (i) 7 6 5 (ii)
a) (1pt) Apply graph-search A* with heuristic h1 = the number of misplaced numbered tiles. Ties are
broken randomly.
Draw the search tree that includes all states generated during the algorithm procedure.
Compute the triple (g, h, f) for each state.
Mark the optimal strategy found.
2
b) (1pt) Repeat the question a) with heuristic h2 = the sum of the (Manhattan) distance of every
numbered tile to its goal position.
3
Problem 3 (2.5pts) Consider a delivery robot world with mail
and coffee to deliver.
Assume a simplified domain with four locations as shown
aside. This domain is quite simple, yet it is rich enough to
demonstrate many of the problems in representing actions and
in planning.
The robot, called Rob, can pick up coffee at the coffee shop, pick up mail in the mail room, move, and
deliver coffee and/or mail. Delivering the coffee to Sam's office will stop Sam from wanting coffee. There
can be mail waiting at the mail room to be delivered to Sam's office.
4
Rob can move clockwise (mc) or move counterclockwise (mcc). Rob can pick up coffee (puc) if Rob is at
the coffee shop and it is not already holding coffee. Rob can deliver coffee (dc) if Rob is carrying coffee
and is at Sam's office. Rob can pick up mail (pum) if Rob is at the mail room and there is mail waiting
there. Rob can deliver mail (dm) if Rob is carrying mail and he is at Sam's office. Assume that it is only
possible for Rob to do one action at a time.
Formulate the task above as a search problem by determining the primary concepts.
Problem 4 (2.5pts) Consider the following graph. The start and goal states are S and F respectively.
For each of the following strategies, work out order in which states are expanded, as well as the path and
show the search tree used to find this solution. In all cases, assume ties resolve in such a way that states
with earlier alphabetical order are expanded first.
a) Tree-search depth-first search (DFS)
b) Breadth-first search (BFS)
5
c) Uniform cost search (UCS)
d) Graph-search greedy best first search (GBFS) with the heuristic h shown on the graph
e) Graph-search A* with the same heuristic.
Note that
Tree-search DFS avoids repeated states by checking new states against those on the path from the
root to the current node.
The early goal test is applied in DFS, BFS, and GBFS.
6
0.5pt UCS SBACG SBDF
DHEF
7
Problem 5 (2pts) Present your study about Recursive best first search (RBFS).
a) (0.5pt) State the principle of the Recursive Best-First Search (RBFS) algorithm.
b) (1pt) Demonstrate the key steps of this algorithm using a small example graph. Note: The graph must
be different from the Romania map used in the lecture.
c) (0.5pt) Describe one limitation of the RBFS algorithm.
Solution:
a)
RBFS does not lose best-first search optimality due to restrictive memory. It always expands the
node n with the lowest f-value, but it does not store all generated nodes on the open list, as a best-
first search would.
The space complexity of the algorithm is O(bd) as it only stores nodes appearing in the current path
from node to the root. This makes it ideal for solutions with very limited memory, as it does not
take up memory proportional to the total number of nodes generated, but rather proportional to the
depth.
If the f-value of the current path goes beyond f-values of other paths, then RBFS performs
backtracking to see better alternatives. But the algorithm doesn't just throw away the current
subtree -- it records the best f-value seen in the abandoned subtree, to separate out the latest call for
reference later.
On return from a subtree, RBFS passes back to its parent the smallest f-value it saw in the subtree.
This helps avoiding unnecessary recomputation of some suboptimal paths and ensures the
efficiency of seeking for routes under memory constraints.
The algorithm is recursive based in which each recursive call works under dynamically selected f-
limit. This bound indicates the level where the current path should be discarded in favor of other
options.
RBFS with admissible and consistent heuristics is complete for optimal solutions even with limited
memory. It does so by examining every required path in turn, but does so efficiently by
intelligently backtracking and memory of value.
The recursive structure of RBFS ensures that the best path found is automatically remembered
without explicit path storage as the solution path will be reconstructed by the sequence of recursive
invocations that arrive at a goal.
b) The graph:
Firstly, f-limit is initialized as ∞, we expand node A (Start) to get 3 successors that include: B, C, D
8
Calculate f-values for all successors: hD = 8, hC = 6 and hB = 7.
Select the node with minimum f from the successor list: C. The f-value of C remains within the
current hlimit.
Determine the runner-up successor node = D.
Establish flimit = runner-up f-value = min(flimit, D.f) = D.f = 7. Continue recursion with node C.
9
c) Describe one limitation of the RBFS algorithm.
One significant limitation of RBFS is its potential for excessive recomputation.
Since RBFS only maintains linear space, it must "forget" previously explored subtrees when memory
becomes full. When the algorithm later determines that a forgotten subtree contains the optimal path,
it has to completely re-explore that entire subtree from scratch. This leads to redundant work, as the
same nodes and paths may be generated and evaluated multiple times throughout the search process.
This recomputation overhead can make RBFS significantly slower than algorithms like A* that
maintain all explored nodes in memory, especially in problems where the optimal solution requires
frequently switching between different branches of the search tree. The time complexity can become
exponential in the worst case, even though the space complexity remains linear.
10