Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Submit the submission.py file. The deliverable for the assignment is this ' submission.py ' file with the necessary functions / methods completed. Also include snapshots
Submit the
submission.py file. The deliverable for the assignment is this
submission.py file with the necessary functionsmethods completed.
Also include snapshots of the output of your program and the generated graph showing the search results in your submission.
Your task is to implement an informed search algorithm that will calculate a driving route between two points in Romania with a minimal time and space cost. The searchsubmissiontests.py file to help you along the way. We will be using an undirected network representing a map of Romania.
search
The implemented search uses Euclidean distance as the default heuristic, which is implemented in function euclideandistheuristic It is passed to astar as provide nullheuristic as a baseline heuristic to test against when calling astar tests.
Notes:
You need to include start and goal in the path.
If your start and goal are the same then just return
The above are just to keep your results consistent with our test cases.
You can access all the neighbors of a given node by calling graphinode or graph.neighborsnode ONLY.
You can access the weight of an edge using: graph.getedgeweightnode node Not using this method will result in your explored nodes count being hig
You can access the position of a node using: graph.nodesnpos You will need this for calculating the heuristic distance.
Bidirectional search
implement bidirectional search. Remember that you need to calculate a heuristic for both the starttogoal search and the goaltostart search. bidirectionalastar should return the path from the start node to the goal node, as a list of nodes.
submission.py file:
import heapq
import os
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started