Question 1: Rifat loves to travel. She travels around the world taking photos and souvenirs. This week she went to Buganda. Common Tourists would surely travel around the main city and some other nearby cities, but Rifat has a different idea. She wants to measure the distances of all the cities from her source and then decide the route Problem is that Buganda is very large so she has no idea how to figure this out. Luckily, you are around so she asked you for help. If the nodes of the graph represent citie and edge path costs represent driving distances. Can you tell her, from "node A what will be the shortest path to go to other cities with minimum cost? 6 A B 2 E 3 с a. Which algorithm will you suggest to Rifat? Does this algorithm always work on a negative weighted edge? Explain with an example (3) b. Show the simulation of your suggested algorithm to solve Rifat's problem. Mention the total driving distance of all the paths found in the simulation above and also mention the whole shortest path for each destination. (6) What is the time complexity of your algorithm? (1)
Question 1: Priya loves to travel. She travels around the world taking photos and souvenirs. This week she went to Buganda. Common Tourists would surely travel around the main city and some other nearby cities, but Rifat has a different idea. She wants to measure the distances of all the cities from her source and then decide the route. Problem is that Buganda is very large so she has no idea how to figure this out. Luckily, you are around so she asked you for help. If the nodes of the graph represent cities and edge path costs represent driving distances, Can you tell her, from "node a" what will be the shortest path to go to other cities with minimum cost? с a. Which algorithm will you suggest to Priya? Does this algorithm always work on a negative weighted edge? Explain with an example. (3) b. Show the simulation of your suggested algorithm to solve Priya's problem. Mention the total driving distance of all the paths found in the simulation above and also mention the whole shortest path for each destination. (6) C. What is the time complexity of your algorithm? (1)
没有找到相关结果