Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. Also, you can not use any other libraries except numpy, csv, matplotlib and networkx. Code this as soon as possible.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions