Homework 19: Directed Graph Search, again
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.
(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.
(1 point) What is the first path from S to one of the goal vertices that this search would return?