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 MakkahStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started