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

Gaza 160 50 50 100 Amman Safad Cairo 250 80 200 220 Makkah
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
