Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what information you require Path Finding Agent Problem Statement Assume that you are the head of the corporation team that clears the roads in a

image text in transcribed

image text in transcribed

what information you require

Path Finding Agent Problem Statement Assume that you are the head of the corporation team that clears the roads in a city like Chennai for traffic. It is the time of the year with cyclones causing trees to fall. It is your duty to clear the roads for traffic. The problem here is defined as to find the shortest route that travels through all the roads in an area clearing them. The shortest path includes all the roads but only once. Help your cleaning robot in finding such a path given a starting point and the map. Here the area map is represented as a graph. The algorithm takes the starting point and the graph as the input and produces the shortest path covering all the edges only once. T. Nagar Anna Central Station Nagar Guindy Kotturpuram Tambaram Note: Vertices can be travelled more than once. 1. Explain the environment of the agent [20% weightage] 2. First calculate the degree of the vertices and check if Euler path exists in the graph. If it exists then find the path. [20% weightage] 3. Use appropriate data structures and implement search algorithms (BFS and DFS) to find the path that covers all the roads from different areas in Chennai as provided in the graph. [40% weightage] 4. Compare BFS and DFS using your implementation in terms of space and time complexity. [20% weightage] 5. The starting point is to be obtained from the user as input NOTE: You are provided with the python notebook template which stipulates the structure of code and documentation. You are free to add as many code cells as possible. Use well intended python code. The implementation code must be completely original. Please keep your work (code, documentation) confidential. If your code is found to be plagiarized, you will be penalized severely. Parties involved in the copy will be considered equal partners and will be penalized severely. Problem solving by BFS or DFS Things to follow 1. Use appropriate data structures to represent the graph and the path using python libraries 2. Provide proper documentation 3. Find the path and print it Coding begins here 1. Define the robot environment in the following block In [ ]: PEAS environment. Initial data structures to define the graph and variab le declarations 1. Define a formula that Checks for existence of Euler path Euler circuit In [ ]: Function for checking for the Euler path 1. Implementation of BFS for finding the path In [ ]: Code block 1 1. Implementation of DFS In [ ]: Code block 2 1. Calling main function In [ ]: Function call to BFS In [ ]: Function call to DFS 1. The agent should provide the following output 5.1. Whether an Euler path or circuit exists In [ ]: Function to find the existence of Euler path circuit 5.2. The Euler path that covers all the edges in the graph In [ ]: Function that prints the path covering all the edges (Both DFS and BFS) 5.3. Print the total number of vertices (areas) visited by the agent in finding the path In (): Execute code to print the number of vertices travelled to cover the pat h. (BFS and DFS)

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

More Books

Students also viewed these Databases questions