Exercise 7.3: Shortest routes
4 + 2 = 6 points
1. Calculate the shortest path in each of the two graphs given a and e, by doing the following:
- Apply the Dijkstra algorithm to one graph.
- Apply the Bellman-Ford algorithm to the other graph.
Think about which algorithm makes sense to use for each graph. In each step, explicitly state what information about the nodes is to be saved. For the Bellman-Ford algorithm, process the edges in "alphabetical descending order". This means you walk each node from e to a and the neighbors of the respective node, working again from e to a.
Graph 1:
Graph 2: