Python, Graph, Algorithms.
-1 to B, 2 to C, infinity to D, and infinity to E. After the third iteration, the distances are -1 to B, 2 to C, 4 to D, and infinity to E. After the fourth iteration, the distances are -1 to B, 2 to C, 4 to D, and infinity to E, which are the final shortest distances from A to all other vertices.