Question: We are going to find the optimal solution for the goal nodes that we specify using the Uniform Cost Search algorithm, where we will get

We are going to find the optimal solution for the goal nodes that we specify using the Uniform Cost Search algorithm, where we will get the costs from the costs.csv. Your function should return two things; a list of lists, where each independent list represents the least cost path to be taken to reach the specific goal node, and a list of numbers, where each number represents the minimum cost to reach the specific goal node. For a good revision of this algorithm, you can use this link.

NOTE that there can be more than one goal node, and your solution should handle this. Also, be careful of corner cases, including, but not limited to, having no goal nodes or giving the source node as the goal node. Furthermore, IF there exists any case where there exists no path from the root(source) node of one of the goal nodes, then the cost returned for that should be -1, and the path returned should be an empty list.

The contents of the file cost.csv are too long to paste here as chegg gets stuck if I try to paste them here. Please make a file with your own dataset containing more than one goal node and solve the problem above in python.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!