Question: Using Python language, make a function that calculates the cheapest route for a traveler from one point to another point, the function will take the

Using Python language, make a function that calculates the cheapest route for a traveler from one point to another point, the function will take the following inputs (graph, src, dest) The input (graph) represents the cities and prices to move from one city to another, the entrance (src) represents the city from which the traveler will depart, and the entrance (dest) represents the city the traveler will go to, the output for this function is a numerical value representing the total price.

Example: If the traveler wants to travel from Gaza to Mecca, the exit will be (50 + 80 = 130).

And if he wants to travel from Amman to Cairo, the exit will be (no Travel Found) because there is no road between the two points

 Using Python language, make a function that calculates the cheapest route

Gaza 160 50 50 100 Amman Safad Cairo 250 80 200 220 Makkah

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!