Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . A - Applying Algorithms In this step, you will apply the three uninformed search algorithms to 1 0 0 different instances of the

2.A - Applying Algorithms
In this step, you will apply the three uninformed search algorithms to 100 different instances of the Route Planning environment, recording various metrics for each algorithm/environment pair. Starter code has been provided for you in the cell below.
The outer loop in the cell below will execute 100 times. Each time it runs, it creates a new Route Planning environment with 800 sites. Each time the inner loop executes, a different search algorithm will be applied to the current environment. After applying the algorithm, the path length, path cost, and search time for that search should each be recorded in the appropriate dictionaries.
Complete the cell below by filling in the blanks to defined the variables p, c, and t as described in the comments below.
algorithms =['DFS','BFS', 'UCS']
lengths ={alg:[] for alg in algorithms}
costs ={alg:[] for alg in algorithms}
times ={alg:[] for alg in algorithms}
for i in tqdm(range(100)):
state = RoutePlanning(num_sites=800, random_state=i)
for alg in algorithms:
soln, log = general_search(root=state, alg=alg, display_results=False)
p = # p should be set to the path for the solution found.
c = # c should be set to the path cost for the solution.
t = # t should be the runtime for the algorithm
lengths[alg].append(len(p))
costs[alg].append(c)
times[alg].append(t)

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_2

Step: 3

blur-text-image_3

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

=+should about distributors and dealers attitudes towards it?

Answered: 1 week ago

Question

understand the limitations of classic models of job design.

Answered: 1 week ago