Text: 5
3
2
Figure 1: A network consisting of nodes {U, x, y, w}
2. (a) A network is illustrated in Fig. 1. Use Dijkstra's algorithm to find the shortest paths from node U to all other nodes in the network. Show all intermediate steps. [10 marks] (b) Given a graph G which consists of N nodes and E edges. In the worst case, the computation that must be done to compute Dijkstra's algorithm incurs a cost of O(N^2) flops. Explain (or prove) why this is the case.