Question: python please, need the your code here for the searches from queue import PriorityQueue from pprint import pprint # Graph of cities with connections to

python please, need the "your code here" for the searches
from queue import PriorityQueue
from pprint import pprint
# Graph of cities with connections to each city. Similar to our class exercises, you can draw it on a piece of paper
# with step-by-step node inspection for better understanding
graph ={
'San Bernardino': ['Riverside', 'Rancho Cucamonga'],
'Riverside': ['San Bernardino', 'Ontario', 'Pomona'],
'Rancho Cucamonga': ['San Bernardino', 'Azusa', 'Los Angeles'],
'Ontario': ['Riverside', 'Whittier', 'Los Angeles'],
'Pomona': ['Riverside', 'Whittier', 'Azusa', 'Los Angeles'],
'Whittier': ['Ontario','Pomona', 'Los Angeles'],
'Azusa': ['Rancho Cucamonga', 'Pomona', 'Arcadia'],
'Arcadia': ['Azusa', 'Los Angeles'],
'Los Angeles': ['Rancho Cucamonga', 'Ontario', 'Pomona', 'Whittier', 'Arcadia']
}
# Weights are treated as g(n) function as we studied in our class lecture which represents the backward cost.
# In the data structure below, the key represents the cost from a source to target node. For example, the first
# entry shows that there is a cost of 2 for going from San Bernardino to Riverside.
weights ={
('San Bernardino', 'Riverside'): 2,
('San Bernardino', 'Rancho Cucamonga'): 1,
('Riverside', 'Ontario'): 1,
('Riverside', 'Pomona'): 3,
('Rancho Cucamonga', 'Los Angeles'): 5,
('Pomona', 'Los Angeles'): 2,
('Ontario', 'Whittier'): 2,
('Ontario', 'Los Angeles'): 3,
('Rancho Cucamonga', 'Azusa'): 3,
('Pomona', 'Azusa'): 2,
('Pomona', 'Whittier'): 2,
('Azusa', 'Arcadia'): 1,
('Whittier', 'Los Angeles'): 2,
('Arcadia', 'Los Angeles'): 2
}
# heurist is the h(n) function as we studied in our class lecture which represents the forward cost.
# In the data structure below, each entry represents the h(n) value. For example, the second entry
# shows that h(Riverside) is 2(i.e., h value as forward cost for eaching at Riverside assuming that
# your current/start city is San Bernardino)
heuristic ={
'San Bernardino': 4,
'Riverside': 2,
'Rancho Cucamonga': 1,
'Ontario': 1,
'Pomona': 3,
'Whittier': 4,
'Azusa': 3,
'Arcadia': 2,
'Los Angeles': 0
}
# Data structure to implement search algorithms. Each function below currently has one line of code
# returning empty solution with empty expanded cities. You can remove the current return statement and
# implement your code to complete the functions.
 python please, need the "your code here" for the searches from

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!