Homework 18: Directed Graph Search

Submit this homework using Gradescope. You can type up your answers, or write legibly and scan them. Do not attempt to submit a paper copy in class, as it will not be accepted.


Suppose you have the following directed graph.

hw18-graph

(1 point) If you were to perform a breadth-first search, starting at S and trying to reach either of the two goal vertices (G1 or G2), in what order would the vertices be added to the frontier? Use the BFS algorithm we covered in class (findPath).

Assume that the neighbors of each vertex are returned in alphabetical order. For example, the only neighbors of S are A and B, in that order — S is a neighbor of C, but C is not a neighbor of S in this directed graph!

(1 point) What is the first path from S to one of the goal vertices that this search would return?