2 Dijkstra’s Shortest Path Algorithm: Consider the following algorithm to find the shortest distance between two cities (S G)A. Maintain a list of cities C that you have visited so far.Cache the total path-cost g(c) and the predecessor city p(c) for every city c in C.B. Maintain a list of neighboring cities F (the fringe) that are not in C:Cache the total path-cost g(f) and the predecessor city p(f) for every city f in F.Cities in F are ordered according to their total path cost g(f)C. At every iteration of the algorithm, starting at S, visit the city in the fringe that has the lowest path-costAdd it to C and remove it from F.D. Add all new neighboring cities (including their g(f) and p(f)) into the fringethat are not already in C. (They could already be in F though with a different predecessor)E. If more than 1 copy of a city is in the fringe, only retain the one with lowest g(f). Delete all other copies.F. If you reach G, reconstruct the path from SG and report g(G) and the path.1. [2pts] Work out the first 3 steps of Dijkstra’s algorithm and uniform cost search (UC with repeated states).This means: visit and expand the first 3 nodes starting at 0.Use the graph to the right. “0” is the source and “6” is the goal.2. [2pts] Is this algorithm an instance of a informed or an uninformed searchalgorithm? (explain)3. [2pts] Is this algorithm an instance of a tree search or a graph search4. [2pts] Is this algorithm complete? (explain)5. [2pts] Is this algorithm optimal? (explain – you may describe it asan instance of some algorithm in the book and refer to resultsdescribed in the book)
3 Solution Notation for Dijkstra: node (total path cost, predecessor) Notation for Uniform cost: node (total path cost)DijkstraNodes visited and expanded: 0 (0, null), 1 (1.1, 0), 3 (3.5, 1)Uniform costNodes visited and expanded: 0 (0), 1 (1.1), 0 (2.2)Uninformed (since does not use any estimate of the cost from node to a goal)Graph search (since the algorithm maintains a list of already expanded nodes)Yes, it is complete (guaranteed to find a solution)Yes, it is optimal (because it is uniform cost search with a detection of repeated states)
Your consent to our cookies if you continue to use this website.