Consider the following directed, weighted graph. (6 marks)
3
a) Calculate the shortest paths (Dijkstra's algorithm) from A to every other vertex. Show your steps in the table below. (2 points)
Vertex 1 2 3 4 5
Distance 0
Path
b) Can Dijkstra's algorithm calculate the shortest path in part a? If not, where exactly does it fail? (2 points)
c) What single edge could be removed from the graph in such a way that Dijkstra's algorithm would work correctly? (2 points)
d) Calculate the shortest path for the above graph using the Bellman-Ford Algorithm. (2 points)