Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python project AI: A person wanted to navigate between cities according to the map in the image and the heuristic in the image. Project requirements:

Python project AI:

A person wanted to navigate between cities according to the map in the image and the heuristic in the image.

Project requirements:

Create a class named Cities containing:

1- A function to create a dictionary named createCities

2 - function to create a heuristic named createH

3- A function for calculating A* algorithm within the class

4- A function for calculating greeay algorithmin within the class

The main menu of the project consists of:

1- Add city and heuristic

2- A* algorithm

3- Greedy algorithm

Where if the user enters the number 1, it adds the cities to the existing dictionary

If the number 2 is entered by the user, it adds a heuristic

If the number 3 is entered, we calculate the algorithm A * based on the dictionary and heuristics and output the result

If the number 4 is entered, we calculate the greedy algorithm based on the heuristic and output the result

If 5 is entered, the program will be terminated. As long as user No. 5 does not enter, we display the project main menu again.

The program should be free from errors and give the correct output

image text in transcribed
image text in transcribed
\begin{tabular}{|c|r|} \hline \multicolumn{2}{|c|}{ heuristic } \\ \hline Gaza & 75 \\ \hline Cairo & 60 \\ \hline Amman & 45 \\ \hline Makkah & 45 \\ \hline Dubai & 25 \\ \hline Damascus & 40 \\ \hline Yafa & 30 \\ \hline Morocco & 0 \\ \hline \end{tabular}

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

Students also viewed these Databases questions