How can I write a function that will return the estimated number of minutes it will take to reach a destination from the source based on the data stored in the route dictionary. The route is one-way only and any destination can be reached from any source.
EDIT: The sources and destinations are names of actual places.
route = {
("San Mateo","Cabatuan"):{
"travel_time_mins":10
},
("Cabatuan","Cauayan"):{
"travel_time_mins":35
},
("Cauayan","Ilagan"):{
"travel_time_mins":55
},
("Ilagan","Cordon"):{
"travel_time_mins":30
},
("Cordon","Santiago"):{
"travel_time_mins":25
},
("Santiago","Roxas"):{
"travel_time_mins":15
},
("Roxas","Aurora"):{
"travel_time_mins":30
},
("Aurora","Magat"):{
"travel_time_mins":35
},
("Magat","Ramon"):{
"travel_time_mins":40
},
("Ramon","San Mateo"):{
"travel_time_mins":20
}
}
Please help.