# Consider the problem of finding a path in the grid shown in picture from the position

**Question description**

(b) For the same grid, number the nodes expanded, in order, for a best-first search from s to g. Manhattan distance should be used as the evaluation function. The Manhattan distance between two points is the distance in the x-direction plus the distance in the y-direction. It corresponds to the distance traveled along city streets arranged in a grid. Assume multiple-path prun- ing. What is the first path found?

(c) On the same grid, number the nodes expanded, in order, for a heuristic depth-first search from s to g, given Manhattan distance as the evaluation function. Assume a cycle check. What is the path found?

(d) Number the nodes in order for an A∗ search, with multiple-path pruning,

for the same graph. What is the path found?

(e) Show how to solve the same problem using dynamic programming. Give

(f) Based on this experience, discuss which algorithms are best suited for this

problem.

(g) Suppose that the graph extended infinitely in all directions. That is, there is no boundary, but s, g, and the blocks are in the same positions relative to each other. Which methods would no longer find a path? Which would be the best method, and why?

## Tutor Answer

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors