Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I would like to ask about this specific problem for the Artificial Intelligence subject. Can you explain to me the solution as well as

image text in transcribedimage text in transcribed

Hi, I would like to ask about this specific problem for the Artificial Intelligence subject. Can you explain to me the solution as well as explaining the code for especially when running this in Spyder Python. I have a code for GraphData, Node, QueueBFS, and State.py if it helps?

For this, write a script that would use Breadth First Search to allow for the students introductions to each other with the least number of intermediate students for the introduction, i.e find the shortest path. Must consider the following: 1.) Store the relationships in a dictionary structure, For example: grap={'Adam':['Bob', 'You', 'Ema'), 'Bob':{'Adam','Dolly','Ema'l, 2.) Use any of the python data structures queues, stacks, priority queues or create your own using python native data structures such as list, dictionaries,etc. connect, (end/goal) student name of target person). For example, if you store the relationships under graph and "Ema" wishes to get introduced to "Bob" then you would call the function from the main as follows: BFS_firstname (graph, "Ema", "Bob") 6.) If a relationship cannot be established then the code should give an appropriate apology message. 7.)If any of the passed arguments do not exist then an appropriate message should be returned. 8.) If any names passed as arguments do not exist on the graph then it should display an appropriate message. 9.) As output print the final path and the tree traversed, use Graphviz to illustrate the result or print out. Run the script on the basis that Dolly needs to get introduced to 'You'. Then rerun on the basis that George needs to get introduced to Bob. Will run the script on Spyder Python (3.8) Undirected Graph that illustrates relationships among students in class Adam mdd am Ema You Bob George Frank nk Dolly For this, write a script that would use Breadth First Search to allow for the students introductions to each other with the least number of intermediate students for the introduction, i.e find the shortest path. Must consider the following: 1.) Store the relationships in a dictionary structure, For example: grap={'Adam':['Bob', 'You', 'Ema'), 'Bob':{'Adam','Dolly','Ema'l, 2.) Use any of the python data structures queues, stacks, priority queues or create your own using python native data structures such as list, dictionaries,etc. connect, (end/goal) student name of target person). For example, if you store the relationships under graph and "Ema" wishes to get introduced to "Bob" then you would call the function from the main as follows: BFS_firstname (graph, "Ema", "Bob") 6.) If a relationship cannot be established then the code should give an appropriate apology message. 7.)If any of the passed arguments do not exist then an appropriate message should be returned. 8.) If any names passed as arguments do not exist on the graph then it should display an appropriate message. 9.) As output print the final path and the tree traversed, use Graphviz to illustrate the result or print out. Run the script on the basis that Dolly needs to get introduced to 'You'. Then rerun on the basis that George needs to get introduced to Bob. Will run the script on Spyder Python (3.8) Undirected Graph that illustrates relationships among students in class Adam mdd am Ema You Bob George Frank nk Dolly

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 Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions