Spring 2014 CSCI 470 Homework 4

Find the optimal set of nodes to visit to get from A to D in this graph using the pseudocode shown below.

I want you to complete the following table after each iteration of the loop:

procedure UniformCostSearch(Graph, root, goal) node := root, cost = 0 frontier := priority queue containing node only explored := empty set do   if frontier is empty return failure node := frontier.pop if node is goal return solution explored.add(node) for each of node's neighbors n     if n is not in explored if n is not in frontier frontier.add(n) else if n is in frontier with higher cost replace existing node with n