The last node to visit is F
, which is also our destination node. The shortest path is now completed by adding the path from node D
to F
. The total weight of this shortest path is 10. All other paths that lead to the destination node F
will give a larger distance than 10.

Now that we've seen an illustrative example, let's think a little more about the algorithm.