Data Structure Algorithm, Programming, Dijkstras Algorithm, Bellman Ford Algorithm, Graph.
3rd node. Current Distance of 4 = (Distance of 3) + (Weight from 3 to 4) = 2 + 4 = 6 Current Distance of 5 = (Distance of 3) + (Weight from 3 to 5) = 2 + 3 = 5 The distances of 4 and 5 are less than infinity. Then, we update the distances. Step 4: Start calculating a distance at the 4th node.