


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Artificial Intelligence assignment number 4
Typology: Thesis
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Question: Find out the shortest path from Oradea to Craiova in the given graphical map using uniform cost graph search algorithm? a. Complete details and steps of the algorithm. Answer: Steps of Algorithm: Initialize priority queue and a set to keep track of explored nodes. Add the starting node (Oradea) with a cost of 0 to the priority queue. While the priority queue is not empty: a. Pop the node with the lowest cost from the priority queue. This node is the current node. b. If the current node is the goal node (Craiova), you have found the shortest path. c. If not, mark the current node as explored. d. For each neighbor of the current node that has not been visited: i. Calculate the cost to reach that neighbor from the start node via the current node. ii. If the neighbor is not in the priority queue, add it with the calculated cost. If the priority queue becomes empty and the goal node (Craiova) has not been reached, there is no path from Oradea to Craiova.
b. Order of steps/actions taken by the algorithm, and what is in the memory at each step/action. Step 1 : Oradea will be added to the priority queue along with 0 as the cost. Priority Queue (Memory) → ['[Oradea,0]'] Step 2 : As the cost of ‘Oradea’ is lowest it will pop out from queue and its successors that are ‘Zerind’ and ‘Sibiu’ are added to queue along with their costs. Priority Queue (Memory) → ['[Zerind,71]', '[Sibiu,151]'] Step 3 : As the cost of ‘Zerind’ is lowest it will be removed from the queue and its successor ‘Arad’ is added to queue along with its cost from the root node. Memory → ['[Arad,146]', '[Sibiu,151]'] Step 4 : Successors of ‘Arad’ are added to queue also it is added to explored. Memory → ['[Sibiu,151]', '[Sibiu,286]', '[Timisoara,264]'] Step 5 : As ‘Sibiu’ is added to the explored also its successors are added to priority queue. Memory → ['[Rimnicu,231]', '[Fagaras,250]', '[Timisoara,264]', '[Sibiu,286]']
C. Estimate the space and time complexity for the given state Space. d. Describe whether uniform cost search provides a complete solution or not. Give at least one example to justify your claim. The uniform cost search algorithm is complete if the cost function satisfies two conditions: