Nadine decided to visit her parents. She will drive from her city of residence (Point A) to her parent’s house (point K) on a network of roads and highways. The following matrix shows the possible road segments and their distance she can drive from Point A to point K. According to given matrix, for instance, the distance from Point A to B is 90 kms. The dash sign (-) mean that it is not possible to directly travel between the corresponding points. The red values show that the corresponding segment is a paid-road. a) Find the shortest distance from point A to point K using Dijkstra Algorithm (Assume there is no restriction for paid-roads.) b) If Nadine do not want to pay for the roads, how will the result in part a) change? Use Dijkstra Algorithm to answer. c) Suppose Nadine wants to minimize total oil and paid-road cost of her travel. Assume her car consumes 70$ per 100km in average and paid-road price is calculated as 0.5 $ per km. Which route should Nadine follow to minimize the total cost? Use Dijkstra Algorithm to answer.
Nadine decided to visit her parents. She will drive from her city of residence (Point A) to her parent’s house (point K) on a network of roads and highways. The following matrix shows the possible road segments and their distance she can drive from Point A to point K. According to given matrix, for instance, the distance from Point A to B is 90 kms. The dash sign (-) mean that it is not possible to directly travel between the corresponding points. The red values show that the corresponding segment is a paid-road.
a) Find the shortest distance from point A to point K using Dijkstra Algorithm (Assume there is no restriction for paid-roads.)
b) If Nadine do not want to pay for the roads, how will the result in part a) change? Use Dijkstra Algorithm to answer.
c) Suppose Nadine wants to minimize total oil and paid-road cost of her travel. Assume her car consumes 70$ per 100km in average and paid-road price is calculated as 0.5 $ per km. Which route should Nadine follow to minimize the total cost? Use Dijkstra Algorithm to answer.
Step by step
Solved in 3 steps with 3 images