2. Uniform Cost Search (UCS) Algorithm
Uniform-cost search is an uninformed search algorithm that uses the lowest cumulative cost to find a path from the source to the destination. Nodes are expanded, starting from the root, according to the minimum cumulative cost. The uniform-cost search is then implemented using a Priority Queue.
The Algorithm
Insert the root node into the priority queue. Remove the element with the highest priority. If the removed node is the destination, print total cost and stop the algorithm Else if, Check if the node is in the visited list. Else Enqueue all the children of the current node to the priority queue, with their cumulative cost from the root as priority and the current not to the visited list.
Suppose that the following graph is constructed for your search problem;
Let S be initial state/node and G be goal state/node. Apply Uniform Cost Search to this graph Construct search tree, and show each step on the tree. (No implementation is expected for this question)