Exercise 2a
Exercise 2a
1 Presented Problems
2
E A
1 5
3 3
1 1
B C D
2 1
Perform Breadth-First, Depth-First and Uniform-Cost search. For each step, write down the node which is cur-
rently expanded, the frontier, and the reached set or lookup table (if applicable).
Hint: You can generally write X(C, P ) for a node n, where X = n.STATE, C = n.PATH-COST, and P = n.PARENT.STATE.
You can omit C for Breadth-First and Depth-First search (as it is not needed during search).
Assume that I apply actions in the order: bus, car, delivery; and we start at the initial node s. For clarity, we name
states after the actions taken to get to them (e.g. after taking the bus twice, the state is labeled with bb); and the
order of actions reaching a state is not important (e.g. the states bc and cb are considered to be the same).
Problem 2.2.1: Assuming I want to make as few trips as possible, which search method should I use and what is
the resulting solution?
Problem 2.2.2: Assuming I want to minimize the cost, which search method should I use and what is the resulting
solution?
Problem 2.2.3: Perform depth-first search.
Problem 2.2.4: Perform depth-first search again, but now assume I explore actions in the order: delivery, car, bus.
1
2 Additional Problems
From Problem 2.6 (of Exercise 2b), perform Breadth-First, Depth-First using graph search, and Uniform-Cost
search for both time and price cost. For each step, write down the node which is currently expanded, the frontier,
and the reached set or lookup table (if applicable).
Hint: You can again write X(C, P ) for a node n, where X = n.STATE, C = n.PATH-COST,
and P = n.PARENT.STATE. You can omit C for Breadth-First and Depth-First search (as it is not needed during
search).
Problem 2.4.1: (from Russell & Norvig 3ed. q. 3.18) Describe a state transition graph in which Iterative Deepening
Search performs much worse (in time) than Depth-First Search (e.g. O(n2 ) vs. O(n)).
Problem 2.4.2: (from Russell & Norvig 3ed. q. 3.15) Consider a state transition graph where the start state is the
number 1 and the successor function for state n returns two states, numbers 2n and 2n + 1.
a. Draw the portion of the state transition graph for states 1 to 15.
b. Suppose the goal state is 11. List the order in which nodes will be generated (not expanded) for Breadth-First
search, Depth-Limited search with limit 2, and Iterative Deepening search. Would bidirectional search be
appropriate for this problem?
c. What is the branching factor in each direction of the bidirectional search?
d. Does the answer to c. suggest a reformulation of the problem that would allow you to solve the problem of
getting from state 1 to a given goal state with almost no search?
Problem 2.4.3: (from Russell & Norvig, 2ed. q. 3.6) Does a finite state transition graph always lead to a finite
search tree? How about a finite state transition graph that is a tree?