Solution:Dijkstra Algorithm (Shortest Path Algorithm) - For a given source node in the graph, the algorithm finds the shortest path between that node and every other. It can also be used for finding the shortest paths from a single node to a single destination node by stopping the algorithm once the shortest path to the destination node has been determined.For these type of question to get shortest distance need to start with starting point and choose the nearest point with minimum distance. Again from that particular point choose the point with minimum distance and this process will go one till the destination point.
So here the path with minimum distance is as follows:
P โ Q โ R โ S โ T โ V โ U
Shortest distance from P to U = 4 + 2 + 1 + 3 + 1 + 1 = 12 Km
Hence, "12 Km" is the correct answer.